-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jorge Aparicio
committed
Dec 31, 2016
1 parent
2033c73
commit 17abfe3
Showing
10 changed files
with
142 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc-multilib | ||
|
||
COPY musl.sh / | ||
RUN bash /musl.sh 1.1.15 i386 -m32 | ||
|
||
RUN apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
cmake \ | ||
make \ | ||
pkg-config | ||
|
||
ENV CC_i686_unknown_linux_musl=musl-gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%rename cpp_options old_cpp_options | ||
|
||
*cpp_options: | ||
-nostdinc -isystem /usr/local/include -isystem include%s %(old_cpp_options) | ||
|
||
*cc1: | ||
%(cc1_cpu) -nostdinc -isystem /usr/local/include -isystem include%s | ||
|
||
*link_libgcc: | ||
-L/usr/local/lib -L .%s | ||
|
||
*libgcc: | ||
libgcc.a%s %:if-exists(libgcc_eh.a%s) | ||
|
||
*startfile: | ||
%{!shared: /usr/local/lib/%{pie:S}crt1.o} /usr/local/lib/crti.o %{shared|pie:crtbeginS.o%s;:crtbegin.o%s} | ||
|
||
*endfile: | ||
%{shared|pie:crtendS.o%s;:crtend.o%s} /usr/local/lib/crtn.o | ||
|
||
*link: | ||
-dynamic-linker /lib/ld-musl-x86_64.so.1 -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic} | ||
|
||
*esp_link: | ||
|
||
|
||
*esp_options: | ||
|
||
|
||
*esp_cpp_options: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec "${REALGCC:-cc}" "$@" -specs "/usr/local/lib/musl-gcc.specs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set -ex | ||
|
||
main() { | ||
local version=$1 \ | ||
target=$2 | ||
|
||
local dependencies=( | ||
ca-certificates | ||
curl | ||
make | ||
) | ||
|
||
apt-get install -y --no-install-recommends ${dependencies[@]} | ||
|
||
local td=$(mktemp -d) | ||
|
||
pushd $td | ||
curl https://www.musl-libc.org/releases/musl-$version.tar.gz | \ | ||
tar --strip-components=1 -xz | ||
|
||
if [ ! -z $target ]; then | ||
ln -s /usr/bin/{,$target-}ar | ||
ln -s /usr/bin/{,$target-}cc | ||
ln -s /usr/bin/{,$target-}ranlib | ||
fi | ||
|
||
CFLAGS="-fPIC ${@:3}" ./configure \ | ||
--disabled-shared \ | ||
--prefix=/usr/local \ | ||
$(test -z $target || echo --target=$target) | ||
nice make -j$(nproc) | ||
nice make install | ||
ln -s /usr/bin/ar /usr/local/bin/musl-ar | ||
|
||
if [ ! -z $target ]; then | ||
rm /usr/bin/$target-{ar,ranlib} | ||
fi | ||
|
||
apt-get purge --auto-remove -y ${dependencies[@]} | ||
|
||
popd | ||
|
||
rm -rf $td | ||
rm $0 | ||
} | ||
|
||
main "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters