Skip to content

Commit

Permalink
toolchain: enable lto for musl
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Oct 6, 2023
1 parent e7dae56 commit 0d806fa
Show file tree
Hide file tree
Showing 1,976 changed files with 25 additions and 292,427 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ jobs:
libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget libc-dev-bin
- name: Build
run: |
make CT_TARGET=${{ matrix.target }}
cd crosstool-ng/toolchain-mipsel
tar cJf ../${{ matrix.target }}.tar.xz *
make CT_TARGET=${CT_TARGET} CT_VERSION=${CT_VERSION}
cd crosstool-ng-${CT_VERSION}/toolchain-mipsel
tar cJf ../../${CT_TARGET}.tar.xz *
env:
CT_TARGET: ${{ matrix.target }}
CT_VERSION: 1.26.0
working-directory: toolchain
- uses: actions/upload-artifact@v3
with:
name: toolchain
path: toolchain/crosstool-ng/${{ matrix.target }}.tar.xz
path: toolchain/${{ matrix.target }}.tar.xz
- uses: svenstaro/upload-release-action@2.2.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: toolchain/crosstool-ng/${{ matrix.target }}.tar.xz
file: toolchain/${{ matrix.target }}.tar.xz
tag: toolchain
overwrite: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
toolchain/crosstool-ng-*/
toolchain/toolchain-*/
19 changes: 14 additions & 5 deletions toolchain/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
TOPDIR = ${CURDIR}
CT_DIR = $(TOPDIR)/crosstool-ng
CT_PREFIX = $(TOPDIR)/toolchain-mipsel
CT_VERSION := 1.26.0
CT_DIR := $(TOPDIR)/crosstool-ng-$(CT_VERSION)
CT_PREFIX := $(TOPDIR)/toolchain-mipsel
CT_TARGET := mipsel-linux-musl
CT_URL := https://github.com/crosstool-ng/crosstool-ng/releases/download/crosstool-ng-$(CT_VERSION)/crosstool-ng-$(CT_VERSION).tar.xz
TOOLCHAIN_URL := https://github.com/tsl0922/padavan/releases/download/toolchain/$(CT_TARGET).tar.xz

all: build

build:
@if [ ! -d $(CT_DIR) ]; then \
echo "Downloading crosstool-ng..."; \
curl -fSsLo- $(CT_URL) | tar Jx; \
fi

@echo "Building toolchain..."
cp -r $(TOPDIR)/configs/$(CT_TARGET) $(CT_DIR)/samples
@(cd $(CT_DIR); \
./bootstrap && \
./configure --enable-local && \
Expand All @@ -17,11 +25,12 @@ build:
)

clean:
@(cd $(CT_DIR); \
@if [ -d $(CT_DIR) ]; then \
cd $(CT_DIR); \
if [ -f ct-ng ]; then ./ct-ng distclean; fi; \
if [ -f Makefile ]; then make distclean; fi; \
if [ -d $(CT_PREFIX) ]; then rm -rf $(CT_PREFIX); fi \
)
fi
@if [ -d $(CT_PREFIX) ]; then rm -rf $(CT_PREFIX); fi

download:
@if [ ! -d $(CT_PREFIX) ]; then \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CT_CONFIG_VERSION="4"
CT_EXPERIMENTAL=y
# CT_SHOW_CT_VERSION is not set
CT_ALLOW_BUILD_AS_ROOT=y
CT_ALLOW_BUILD_AS_ROOT_SURE=y
CT_PREFIX_DIR="${CT_TOP_DIR}/toolchain-mipsel"
Expand All @@ -17,7 +18,6 @@ CT_OMIT_TARGET_VENDOR=y
CT_ARCH_LE=y
CT_ARCH_FLOAT_HW=y
CT_TARGET_CFLAGS="-pipe -O2 -mips32r2"
CT_STATIC_TOOLCHAIN=y
CT_KERNEL_LINUX=y
CT_LINUX_SRC_CUSTOM=y
CT_LINUX_CUSTOM_LOCATION="${CT_TOP_DIR}/../../trunk/linux-4.4.x"
Expand All @@ -29,5 +29,6 @@ CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--with-gnu-ld"
CT_CC_GCC_EXTRA_CONFIG_ARRAY="--with-gnu-ld"
CT_CC_GCC_CONFIG_TLS=y
# CT_CC_GCC_USE_GRAPHITE is not set
CT_CC_GCC_USE_LTO=y
CT_CC_LANG_CXX=y
CT_DEBUG_GDB=y
54 changes: 0 additions & 54 deletions toolchain/crosstool-ng/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion toolchain/crosstool-ng/.tarball-version

This file was deleted.

48 changes: 0 additions & 48 deletions toolchain/crosstool-ng/COPYING

This file was deleted.

48 changes: 0 additions & 48 deletions toolchain/crosstool-ng/LICENSE

This file was deleted.

105 changes: 0 additions & 105 deletions toolchain/crosstool-ng/Makefile.am

This file was deleted.

Loading

0 comments on commit 0d806fa

Please sign in to comment.