Skip to content

Commit ff2d388

Browse files
committed
Complete refactoring of the build system to happen in Alpine chroot
This new build results in completely static binaries of the toolchain itself, making them portable across any system.
1 parent daf2b79 commit ff2d388

File tree

339 files changed

+518
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+518
-38
lines changed

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"repositoryUrl": "git@github.com:dyne/musl-dyne.git",
2+
"repositoryUrl": "git@github.com:dyne/musl.git",
33
"plugins": [
44
"@semantic-release/commit-analyzer",
55
"@semantic-release/release-notes-generator",

GNUmakefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ARCH ?= x86_64-linux-musl
2+
3+
all: gcc libs strip
4+
5+
chroot: /alpine/enter-chroot
6+
7+
gcc: dyne/gcc-musl/bin/$(ARCH)-gcc
8+
libs: dyne/$(ARCH)/lib/libssl.a
9+
10+
/alpine/enter-chroot:
11+
./alpine-chroot-install -a x86_64 -d /alpine \
12+
-p "bash make cmake gcc build-base curl patch gawk ccache perl rsync xz samurai coreutils-fmt"
13+
14+
dyne/gcc-musl/bin/$(ARCH)-gcc:
15+
cd gcc-musl/sources && bash download_from_dyne.sh
16+
$(MAKE) -C gcc-musl -j`nproc`
17+
$(MAKE) -C gcc-musl install PREFIX=$(CURDIR)/dyne/gcc-musl
18+
19+
dyne/$(ARCH)/lib/libssl.a:
20+
$(MAKE) -C libs ARCH=$(ARCH) PREFIX=$(CURDIR)/dyne/$(ARCH)
21+
22+
strip:
23+
rm -f dyne/bin/*-lto-dump
24+
rm -rf dyne/share
25+
cat README.md | awk '{gsub(/\[[^][]+\]\([^()]+\)/, gensub(/\[([^][]+)\]\([^()]+\)/, "\\1", "g")); print}' | fmt -w 72 | tee dyne/$(ARCH)/README.txt > dyne/gcc-musl/README.txt
26+
cp settings.cmake dyne/gcc-musl
27+
28+
clean:
29+
rm -rf dyne
30+
$(MAKE) -C gcc-musl clean
31+
$(MAKE) -C libs clean

alpine-chroot-install

Lines changed: 423 additions & 0 deletions
Large diffs are not rendered by default.

config.mak

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/readme.md

Lines changed: 13 additions & 3 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

gcc-musl/config.mak

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARCH ?= x86_64-linux-musl
2+
PREFIX ?= $(shell dirname $(CURDIR))/dyne/gcc-musl
3+
4+
TARGET = $(ARCH)
5+
OUTPUT = $(PREFIX)
6+
GCC_VER = 15.1.0
7+
BINUTILS_VER = 2.44
8+
LINUX_VER = 5.8.5
9+
COMMON_CONFIG += CFLAGS="-g0 -Os -march=x86-64-v2"
10+
COMMON_CONFIG += CXXFLAGS="-g0 -Os -march=x86-64-v2"
11+
# -march=x86-64-v2 -march=haswell
12+
COMMON_CONFIG += LDFLAGS="-s"
13+
COMMON_CONFIG += CC="ccache gcc -static"
14+
COMMON_CONFIG += CXX="ccache g++ -static"
15+
COMMON_CONFIG += --disable-nls --disable-libmudflap --disable-libsanitizer --disable-lto
16+
# --disable-libquadmath --disable-decimal-float --disable-libitm
17+
# --disable-fixed-point --disable-lto
18+
GCC_CONFIG += --enable-languages=c,c++

0 commit comments

Comments
 (0)