Skip to content

Commit 3cc3138

Browse files
committed
Update musl-cross-make to v0.9.9
Fixes #14 Fixes #13
1 parent 35c92f1 commit 3cc3138

File tree

2 files changed

+52
-37
lines changed

2 files changed

+52
-37
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ brew install FiloSottile/musl-cross/musl-cross
99

1010
By default it will build a full cross compiler toolchain targeting musl Linux amd64.
1111

12-
(It takes a while, getting a cup of coffee won't do.)
12+
(Note: a full build can take up to several hours.)
1313

1414
You can then use `x86_64-linux-musl-` versions of the tools to build for the target.
1515
For example `x86_64-linux-musl-cc` will compile C code to run on musl Linux amd64.
1616

1717
The "musl" part of the target is important: the binaries will ONLY run on a musl-based system, like Alpine.
18-
However, if you build them as static binaries by passing `-static` as a LDFLAG they will run **anywhere**.
18+
However, if you build them as static binaries by passing `-static` as an LDFLAG they will run **anywhere**.
1919
Musl is specifically engineered to support static binaries.
2020

2121
Other architectures are supported. For example to get a Raspberry Pi cross-compiler use:
@@ -26,4 +26,4 @@ brew install FiloSottile/musl-cross/musl-cross --without-x86_64 --with-arm-hf
2626

2727
You can also use `--with-i486` (x86 32-bit), `--with-aarch64` (ARM 64-bit), `--with-arm` (ARM soft-float) and `--with-mips`.
2828

29-
Only tested on macOS Mojave.
29+
Only tested on macOS Catalina.

musl-cross.rb

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class MuslCross < Formula
22
desc "Linux cross compilers based on musl libc"
33
homepage "https://github.com/richfelker/musl-cross-make"
4-
url "https://github.com/richfelker/musl-cross-make/archive/v0.9.8.tar.gz"
5-
sha256 "886ac2169c569455862d19789a794a51d0fbb37209e6fae1bda7d6554a689aac"
4+
url "https://github.com/richfelker/musl-cross-make/archive/v0.9.9.tar.gz"
5+
sha256 "ff3e2188626e4e55eddcefef4ee0aa5a8ffb490e3124850589bcaf4dd60f5f04"
66
head "https://github.com/richfelker/musl-cross-make.git"
77

88
option "with-aarch64", "Build cross-compilers targeting arm-linux-muslaarch64"
@@ -15,51 +15,53 @@ class MuslCross < Formula
1515
depends_on "gnu-sed" => :build
1616
depends_on "make" => :build
1717

18-
resource "linux-4.4.10.tar.xz" do
19-
url "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.10.tar.xz"
20-
sha256 "4ac22e4a619417213cfdab24714413bb9118fbaebe6012c6c89c279cdadef2ce"
18+
resource "linux-4.19.88.tar.xz" do
19+
url "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.88.tar.xz"
20+
sha256 "c1923b6bd166e6dd07be860c15f59e8273aaa8692bc2a1fce1d31b826b9b3fbe"
2121
end
2222

23-
resource "mpfr-3.1.4.tar.bz2" do
24-
url "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2"
25-
sha256 "d3103a80cdad2407ed581f3618c4bed04e0c92d1cf771a65ead662cc397f7775"
23+
resource "mpfr-4.0.2.tar.bz2" do
24+
url "https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.bz2"
25+
sha256 "c05e3f02d09e0e9019384cdd58e0f19c64e6db1fd6f5ecf77b4b1c61ca253acc"
2626
end
2727

28-
resource "mpc-1.0.3.tar.gz" do
29-
url "https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz"
30-
sha256 "617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3"
28+
resource "mpc-1.1.0.tar.gz" do
29+
url "https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz"
30+
sha256 "6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e"
3131
end
3232

33-
resource "gmp-6.1.1.tar.bz2" do
34-
url "https://ftp.gnu.org/gnu/gmp/gmp-6.1.1.tar.bz2"
35-
sha256 "a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6"
33+
resource "gmp-6.1.2.tar.bz2" do
34+
url "https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2"
35+
sha256 "5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2"
3636
end
3737

38-
resource "musl-1.1.22.tar.gz" do
39-
url "https://www.musl-libc.org/releases/musl-1.1.22.tar.gz"
40-
sha256 "8b0941a48d2f980fd7036cfbd24aa1d414f03d9a0652ecbd5ec5c7ff1bee29e3"
38+
resource "musl-1.2.0.tar.gz" do
39+
url "https://www.musl-libc.org/releases/musl-1.2.0.tar.gz"
40+
sha256 "c6de7b191139142d3f9a7b5b702c9cae1b5ee6e7f57e582da9328629408fd4e8"
4141
end
4242

43-
resource "binutils-2.27.tar.bz2" do
44-
url "https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2"
45-
sha256 "369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88"
43+
resource "binutils-2.33.1.tar.bz2" do
44+
url "https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2"
45+
sha256 "0cb4843da15a65a953907c96bad658283f3c4419d6bcc56bf2789db16306adb2"
4646
end
4747

4848
resource "config.sub" do
4949
url "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=3d5db9ebe860"
5050
sha256 "75d5d255a2a273b6e651f82eecfabf6cbcd8eaeae70e86b417384c8f4a58d8d3"
5151
end
5252

53-
resource "gcc-6.4.0.tar.xz" do
54-
url "https://ftp.gnu.org/gnu/gcc/gcc-6.4.0/gcc-6.4.0.tar.xz"
55-
sha256 "850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4"
53+
resource "gcc-9.2.0.tar.xz" do
54+
url "https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz"
55+
sha256 "ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206"
5656
end
5757

58-
resource "isl-0.15.tar.bz2" do
59-
url "http://isl.gforge.inria.fr/isl-0.15.tar.bz2"
60-
sha256 "8ceebbf4d9a81afa2b4449113cee4b7cb14a687d7a549a963deb5e2a41458b6b"
58+
resource "isl-0.21.tar.bz2" do
59+
url "http://isl.gforge.inria.fr/isl-0.21.tar.bz2"
60+
sha256 "d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
6161
end
6262

63+
patch :DATA # https://github.com/richfelker/musl-cross-make/pull/89
64+
6365
def install
6466
ENV.deparallelize
6567

@@ -93,20 +95,19 @@ def install
9395
SOURCES = #{buildpath/"resources"}
9496
OUTPUT = #{libexec}
9597
96-
# Recommended options for faster/simpler build:
98+
# Drop some features for faster and smaller builds
9799
COMMON_CONFIG += --disable-nls
98-
GCC_CONFIG += --enable-languages=c,c++
99100
GCC_CONFIG += --disable-libquadmath --disable-decimal-float
100-
GCC_CONFIG += --disable-multilib
101-
# Recommended options for smaller build for deploying binaries:
102-
COMMON_CONFIG += CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"
103-
# Keep the local build path out of binaries and libraries:
104-
COMMON_CONFIG += --with-debug-prefix-map=$(PWD)=
101+
GCC_CONFIG += --disable-libitm --disable-fixed-point
102+
103+
# Keep the local build path out of binaries and libraries
104+
COMMON_CONFIG += --with-debug-prefix-map=#{buildpath}=
105105
106106
# Explicitly enable libisl support to avoid opportunistic linking
107-
ISL_VER = 0.15
107+
ISL_VER = 0.21
108108
109109
# https://llvm.org/bugs/show_bug.cgi?id=19650
110+
# https://github.com/richfelker/musl-cross-make/issues/11
110111
ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang"), 1)
111112
TOOLCHAIN_CONFIG += CXX="$(CXX) -fbracket-depth=512"
112113
endif
@@ -150,3 +151,17 @@ def install
150151
end
151152
end
152153
end
154+
__END__
155+
diff --git a/Makefile b/Makefile
156+
index 3d688f7..e1d4c8e 100644
157+
--- a/Makefile
158+
+++ b/Makefile
159+
@@ -26,7 +26,7 @@ LINUX_HEADERS_SITE = http://ftp.barfooze.de/pub/sabotage/tarballs/
160+
161+
DL_CMD = wget -c -O
162+
163+
-COWPATCH = $(PWD)/cowpatch.sh
164+
+COWPATCH = $(CURDIR)/cowpatch.sh
165+
166+
HOST = $(if $(NATIVE),$(TARGET))
167+
BUILD_DIR = build/$(if $(HOST),$(HOST),local)/$(TARGET)

0 commit comments

Comments
 (0)