monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit f3753cd19cac147edd77464b49fad31a362ef073
parent 714c013b9bbe185258b91d3d9fe5624699cd4d89
Author: z3bra <willy@mailoo.org>
Date:   Sun, 16 Aug 2015 20:05:11 +0200

pcc+musl: moved scripts/patches into downloadable files

Diffstat:
2015/08/cross-compiling-with-pcc-and-musl.txt | 302++-----------------------------------------------------------------------------
css/monochrome.css | 2+-
data/cross-pcc.sh | 210+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
data/pcc-1.1.0-deflibdirs.diff | 30++++++++++++++++++++++++++++++
data/pcc-1.1.0-musl.diff | 21+++++++++++++++++++++
data/pcc-libs-1.1.0-musl.diff | 22++++++++++++++++++++++
6 files changed, 291 insertions(+), 296 deletions(-)

diff --git a/2015/08/cross-compiling-with-pcc-and-musl.txt b/2015/08/cross-compiling-with-pcc-and-musl.txt @@ -1,223 +1,14 @@ # [cross-compiling with PCC and musl](#) ## &mdash; 16 August, 2015 +**TL;DR**: See the full script here: [cross-pcc.sh](/data/cross-pcc.sh). It will +create your toolchain in `$HOME/cross/pcc-x86_64` and name the tools +`x86_64-linux-musl-*`. + I've recently been playing around with [PCC](http://pcc.ludd.ltu.se/) and [musl](http://www.musl-libc.org/), and to make the process of compiling softwares with them easier, I decided to setup a cross-compiler relying on both. -**TL;DR**: here is the full script. It will create your toolchain in `$HOME/cross/pcc-x86_64` and name the tools `x86_64-linux-musl-*`. - - #!/bin/sh -ex - # - # Couple of useful links: - # + http://pcc.ludd.ltu.se/cross-compiler/ - # + http://wiki.osdev.org/Cross-Compiler_Successful_Builds - # + https://git.framasoft.org/Ypnose/solyste/blob/master/scripts/create-crossenv - # + http://kegel.com/crosstool/ - # + https://github.com/GregorR/musl-cross/tree/master/patches - # - # 0. download and extract sources - # 1. patch everything that require patching - # 2. install linux headers - # 3. build binutils - # 4. build musl - # 5. build pcc with gcc - # 6. add pkg-config wrapper - - # cross compiler environment - MARCH=$(uname -m) - TRIPLE=${TRIPLE:-${MARCH}-linux-musl} - PREFIX=${PREFIX:-${HOME}/cross/pcc-${MARCH}} - BLDDIR=${BLDDIR:-${HOME}/cross/build} - SRCDIR=${SRCDIR:-${HOME}/cross/source} - PATCHD=${PATCHD:-${HOME}/cross/patches} - - # compilation variables - PATH="${PREFIX}/bin:${PATH}" - CFLAGS="-Os -fomit-frame-pointer -pipe" - CXXFLAGS="${CFLAGS}" - CPPFLAGS="${CFLAGS}" - LDFLAGS="-Wl,--as-needed" - MAKEFLAGS="-j8" - - # versions - PCCV=${PCCV:-1.1.0} - BINV=${BINV:-2.25} - MUSLV=${MUSLV:-1.1.10} - KERNV=${KERNV:-4.1.4} - - - # source mirrors - PCCMIRROR=ftp://pcc.ludd.ltu.se/pub/pcc-releases - GNUMIRROR=ftp://ftp.gnu.org/gnu - MUSLMIRROR=http://www.musl-libc.org/releases - LINUXMIRROR=https://www.kernel.org/pub/linux/kernel/v4.x - - # Preparing sources - mkdir -p "${SRCDIR}" "${BLDDIR}" "${PREFIX}" - cd "${SRCDIR}" - - # - # ┏━┓ - # ┃┃┃ - # ┗━┛╹ - # Get all GNU tarballs - grab_sources() { - curl -# "${PCCMIRROR}/pcc-${PCCV}.tgz" | tar xz - curl -# "${PCCMIRROR}/pcc-libs-${PCCV}.tgz" | tar xz - curl -# "${GNUMIRROR}/binutils/binutils-${BINV}.tar.gz" | tar xz - curl -# "${MUSLMIRROR}/musl-${MUSLV}.tar.gz" | tar xz - curl -# "${LINUXMIRROR}/linux-${KERNV}.tar.xz" | tar xJ - } - - # - # ╺┓ - # ┃ - # ╺┻╸╹ - # Patch all source trees. - # This will take all patches in $PATCHD matching the programs - patch_sources() { - for DIR in $(find "${SRCDIR}" -maxdepth 1 -type d); do - cd "${DIR}" - cat "${PATCHD}/$(basename ${DIR})"-*.diff | patch -Np1 - done - } - - # - # ┏━┓ - # ┏━┛ - # ┗━╸╹ - # Get linux headers - install_headers() { - cd "${SRCDIR}/linux-${KERNV}" - make ARCH=${MARCH} headers_check - make ARCH=${MARCH} INSTALL_HDR_PATH=${PREFIX}/${TRIPLE} headers_install - rm -r "${SRCDIR}/linux-${KERNV}" - } - - # - # ┏━┓ - # ╺━┫ - # ┗━┛╹ - # Build binutils and install them to ${PREFIX} - install_binutils() { - mkdir -p "${BLDDIR}/binutils" - cd "${BLDDIR}/binutils" - ${SRCDIR}/binutils-${BINV}/configure --target=${TRIPLE} \ - --prefix=${PREFIX} \ - --with-sysroot=${PREFIX}/${TRIPLE} \ - --disable-nls \ - --disable-shared \ - --disable-multilib - make configure-host - make LDFLAGS="${LDFLAGS} -all-static -static" - make install - rm -rf "${BLDDIR}/binutils" - rm -rf "${SRCDIR}/binutils-${BINV}" - } - - # - # ╻ ╻ - # ┗━┫ - # ╹╹ - # Build the musl libc - install_musl() { - cd "${SRCDIR}/musl-${MUSLV}" - ./configure --prefix=${PREFIX}/${TRIPLE} \ - --target=${TRIPLE} \ - --disable-gcc-wrapper \ - --disable-debug \ - --disable-shared \ - --disable-warning - make LDFLAGS="${LDFLAGS}" - make install - rm -rf "${SRCDIR}/musl-${MUSLV}" - } - - # - # ┏━╸ - # ┗━┓ - # ┗━┛╹ - # Build pcc linked against musl - install_pcc() { - mkdir -p "${BLDDIR}/pcc" - mkdir -p "${BLDDIR}/pcc-libs" - cd "${BLDDIR}/pcc" - ${SRCDIR}/pcc-${PCCV}/configure --target=${TRIPLE} \ - --with-libdir=${PREFIX}/${TRIPLE}/lib \ - --with-incdir=${PREFIX}/${TRIPLE}/include \ - --prefix=${PREFIX} - - make LDFLAGS="${LDFLAGS} -static" \ - PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ - PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include - make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ - PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \ - install - rm -rf "${BLDDIR}/pcc" - rm -rf "${SRCDIR}/pcc-${PCCV}" - } - - # - # ┏━┓ - # ┣━┓ - # ┗━┛╹ - # Build pcc libraries against musl - install_pcc_libs() { - cd "${BLDDIR}/pcc-libs" - ${SRCDIR}/pcc-libs-${PCCV}/configure --target=${TRIPLE} \ - --prefix=${PREFIX} - - make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ - PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include - make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ - PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \ - install - rm -rf "${BLDDIR}/pcc-libs" - rm -rf "${SRCDIR}/pcc-libs-${PCCV}" - } - - # - # ┏━┓ - # ┃ - # ╹╹ - # Add pkg-config wrapper - install_pkgconfig() { - cat << EOF > "${PREFIX}/bin/${TRIPLE}-pkg-config" - #!/bin/sh - export PKG_CONFIG_SYSROOT_DIR=${PREFIX}/${TRIPLE} - export PKG_CONFIG_LIBDIR=${PREFIX}/${TRIPLE}/usr/lib/pkgconfig - export PKG_CONFIG_PATH=\$PKG_CONFIG_LIBDIR - - exec pkg-config --static "\$@" - EOF - chmod 755 "${PREFIX}/bin/${TRIPLE}-pkg-config" - } - - grab_sources - patch_sources - install_headers - install_binutils - install_musl - install_pcc - install_pcc_libs - install_pkgconfig - - # clean environment - rm -rf "${SRCDIR}" - rm -rf "${BLDDIR}" - rm -rf "${PREFIX}/share" - rm -f "${PREFIX}/lib/libiberty.a" - - cat << EOF | tee ${PREFIX}/README - TRIPLET : $TRIPLE - PREFIX : $PREFIX - PCC : $PCCV - BINUTILS: $BINV - MUSL : $MUSLV - KERNEL : $KERNV - EOF - The process is (in theory) pretty simple: 0. download and extract sources @@ -262,87 +53,9 @@ with an alternative libc. It *seems* to be fixed in 1.2.0 (DEVEL version), if you're interrested. They fix the `configure` script to accept musl based targets, and fix the default library pass of the compiler. -pcc-1.1.0-musl.diff - - diff -urN a/config.sub b/config.sub - --- a/config.sub 2015-08-11 21:55:34.497619099 +0200 - +++ b/config.sub 2015-08-11 21:56:21.652621262 +0200 - @@ -120,7 +120,7 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in - - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - + nto-qnx* | linux-gnu* | linux-dietlibc | linux-musl | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - @@ -1289,6 +1289,9 @@ - -linux-dietlibc) - os=-linux-dietlibc - ;; - + -linux-musl) - + os=-linux-musl - + ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -pcc-libs-1.1.0-musl.diff - diff -urN a/config.sub b/config.sub - --- a/config.sub 2015-08-11 21:55:34.497619099 +0200 - +++ b/config.sub 2015-08-11 21:56:21.652621262 +0200 - @@ -120,7 +120,7 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in - - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - + nto-qnx* | linux-gnu* | linux-dietlibc | linux-musl | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - @@ -1289,6 +1289,9 @@ - -linux-dietlibc) - os=-linux-dietlibc - ;; - + -linux-musl) - + os=-linux-musl - + ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -pcc-1.1.0-deflibdirs.diff - - diff -urN a/cc/cc/cc.c b/cc/cc/cc.c - --- a/cc/cc/cc.c 2015-08-16 16:00:18.867457413 +0200 - +++ b/cc/cc/cc.c 2015-08-16 16:03:28.963466133 +0200 - @@ -207,9 +207,9 @@ - #endif - #ifndef DEFLIBDIRS /* default library search paths */ - #ifdef MULTIARCH_PATH - -#define DEFLIBDIRS { "/usr/lib/", 0 } - +#define DEFLIBDIRS { LIBDIR, 0 } - #else - -#define DEFLIBDIRS { "/usr/lib/", "/usr/lib/" MULTIARCH_PATH "/", 0 } - +#define DEFLIBDIRS { LIBDIR, LIBDIR MULTIARCH_PATH "/", 0 } - #endif - #endif - #ifndef DEFLIBS /* default libraries included */ - diff -urN a/os/linux/ccconfig.h b/os/linux/ccconfig.h - --- a/os/linux/ccconfig.h 2015-08-16 16:00:18.873457413 +0200 - +++ b/os/linux/ccconfig.h 2015-08-16 16:05:23.446471384 +0200 - @@ -48,9 +48,9 @@ - "-D__amd64", "-D__LP64__", "-D_LP64", NULL, } - #define DYNLINKER { "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", NULL } - #ifndef MULTIARCH_PATH - -#define DEFLIBDIRS { "/usr/lib64/", 0 } - +#define DEFLIBDIRS { LIBDIR, 0 } - #else - -#define DEFLIBDIRS { "/usr/lib64/", "/usr/lib/" MULTIARCH_PATH "/", 0 } - +#define DEFLIBDIRS { LIBDIR, LIBDIR MULTIARCH_PATH "/", 0 } - #endif - #elif defined(mach_mips) - #define CPPMDADD { "-D__mips__", NULL, } ++ [pcc-1.1.0-musl.diff](/data/pcc-1.1.0-musl.diff) ++ [pcc-libs-1.1.0-musl.diff](/data/pcc-libs-1.1.0-musl.diff) ++ [pcc-1.1.0-deflibdirs.diff](/data/pcc-1.1.0-deflibdirs.diff) ### 3,4,5,6. build everything @@ -376,5 +89,4 @@ chroot (so there are only the libressl files): Looks like we have a winner! - <!-- vim: set ft=markdown ts=4 et tw=80: --> diff --git a/css/monochrome.css b/css/monochrome.css @@ -89,7 +89,7 @@ code, pre { color: inherit; font-family: monospace; font-size: 90%; - padding: 4px; + padding: 2px; background-color: #eee; border: 1px solid #bbb; border-radius: 4px; diff --git a/data/cross-pcc.sh b/data/cross-pcc.sh @@ -0,0 +1,210 @@ +#!/bin/sh -ex +# +# Couple of useful links: +# + http://pcc.ludd.ltu.se/cross-compiler/ +# + http://wiki.osdev.org/Cross-Compiler_Successful_Builds +# + https://git.framasoft.org/Ypnose/solyste/blob/master/scripts/create-crossenv +# + http://kegel.com/crosstool/ +# + https://github.com/GregorR/musl-cross/tree/master/patches +# +# 0. download and extract sources +# 1. patch everything that require patching +# 2. install linux headers +# 3. build binutils +# 4. build musl +# 5. build pcc with gcc +# 6. add pkg-config wrapper + +# cross compiler environment +MARCH=$(uname -m) +TRIPLE=${TRIPLE:-${MARCH}-linux-musl} +PREFIX=${PREFIX:-${HOME}/cross/pcc-${MARCH}} +BLDDIR=${BLDDIR:-${HOME}/cross/build} +SRCDIR=${SRCDIR:-${HOME}/cross/source} +PATCHD=${PATCHD:-${HOME}/cross/patches} + +# compilation variables +PATH="${PREFIX}/bin:${PATH}" +CFLAGS="-Os -fomit-frame-pointer -pipe" +CXXFLAGS="${CFLAGS}" +CPPFLAGS="${CFLAGS}" +LDFLAGS="-Wl,--as-needed" +MAKEFLAGS="-j8" + +# versions +PCCV=${PCCV:-1.1.0} +BINV=${BINV:-2.25} +MUSLV=${MUSLV:-1.1.10} +KERNV=${KERNV:-4.1.4} + + +# source mirrors +PCCMIRROR=ftp://pcc.ludd.ltu.se/pub/pcc-releases +GNUMIRROR=ftp://ftp.gnu.org/gnu +MUSLMIRROR=http://www.musl-libc.org/releases +LINUXMIRROR=https://www.kernel.org/pub/linux/kernel/v4.x + +# Preparing sources +mkdir -p "${SRCDIR}" "${BLDDIR}" "${PREFIX}" +cd "${SRCDIR}" + +# +# ┏━┓ +# ┃┃┃ +# ┗━┛╹ +# Get all GNU tarballs +grab_sources() { +curl -# "${PCCMIRROR}/pcc-${PCCV}.tgz" | tar xz +curl -# "${PCCMIRROR}/pcc-libs-${PCCV}.tgz" | tar xz +curl -# "${GNUMIRROR}/binutils/binutils-${BINV}.tar.gz" | tar xz +curl -# "${MUSLMIRROR}/musl-${MUSLV}.tar.gz" | tar xz +curl -# "${LINUXMIRROR}/linux-${KERNV}.tar.xz" | tar xJ +} + +# +# ╺┓ +# ┃ +# ╺┻╸╹ +# Patch all source trees. +# This will take all patches in $PATCHD matching the programs +patch_sources() { +for DIR in $(find "${SRCDIR}" -maxdepth 1 -type d); do + cd "${DIR}" + cat "${PATCHD}/$(basename ${DIR})"-*.diff | patch -Np1 +done +} + +# +# ┏━┓ +# ┏━┛ +# ┗━╸╹ +# Get linux headers +install_headers() { +cd "${SRCDIR}/linux-${KERNV}" +make ARCH=${MARCH} headers_check +make ARCH=${MARCH} INSTALL_HDR_PATH=${PREFIX}/${TRIPLE} headers_install +rm -r "${SRCDIR}/linux-${KERNV}" +} + +# +# ┏━┓ +# ╺━┫ +# ┗━┛╹ +# Build binutils and install them to ${PREFIX} +install_binutils() { +mkdir -p "${BLDDIR}/binutils" +cd "${BLDDIR}/binutils" +${SRCDIR}/binutils-${BINV}/configure --target=${TRIPLE} \ + --prefix=${PREFIX} \ + --with-sysroot=${PREFIX}/${TRIPLE} \ + --disable-nls \ + --disable-shared \ + --disable-multilib +make configure-host +make LDFLAGS="${LDFLAGS} -all-static -static" +make install +rm -rf "${BLDDIR}/binutils" +rm -rf "${SRCDIR}/binutils-${BINV}" +} + +# +# ╻ ╻ +# ┗━┫ +# ╹╹ +# Build the musl libc +install_musl() { +cd "${SRCDIR}/musl-${MUSLV}" +./configure --prefix=${PREFIX}/${TRIPLE} \ + --target=${TRIPLE} \ + --disable-gcc-wrapper \ + --disable-debug \ + --disable-shared \ + --disable-warning +make LDFLAGS="${LDFLAGS}" +make install +rm -rf "${SRCDIR}/musl-${MUSLV}" +} + +# +# ┏━╸ +# ┗━┓ +# ┗━┛╹ +# Build pcc linked against musl +install_pcc() { +mkdir -p "${BLDDIR}/pcc" +mkdir -p "${BLDDIR}/pcc-libs" +cd "${BLDDIR}/pcc" +${SRCDIR}/pcc-${PCCV}/configure --target=${TRIPLE} \ + --with-libdir=${PREFIX}/${TRIPLE}/lib \ + --with-incdir=${PREFIX}/${TRIPLE}/include \ + --prefix=${PREFIX} + +make LDFLAGS="${LDFLAGS} -static" \ + PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ + PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include +make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ + PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \ + install +rm -rf "${BLDDIR}/pcc" +rm -rf "${SRCDIR}/pcc-${PCCV}" +} + +# +# ┏━┓ +# ┣━┓ +# ┗━┛╹ +# Build pcc libraries against musl +install_pcc_libs() { +cd "${BLDDIR}/pcc-libs" +${SRCDIR}/pcc-libs-${PCCV}/configure --target=${TRIPLE} \ + --prefix=${PREFIX} + +make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ + PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include +make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \ + PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \ + install +rm -rf "${BLDDIR}/pcc-libs" +rm -rf "${SRCDIR}/pcc-libs-${PCCV}" +} + +# +# ┏━┓ +# ┃ +# ╹╹ +# Add pkg-config wrapper +install_pkgconfig() { +cat << EOF > "${PREFIX}/bin/${TRIPLE}-pkg-config" +#!/bin/sh +export PKG_CONFIG_SYSROOT_DIR=${PREFIX}/${TRIPLE} +export PKG_CONFIG_LIBDIR=${PREFIX}/${TRIPLE}/usr/lib/pkgconfig +export PKG_CONFIG_PATH=\$PKG_CONFIG_LIBDIR + +exec pkg-config --static "\$@" +EOF +chmod 755 "${PREFIX}/bin/${TRIPLE}-pkg-config" +} + +grab_sources +patch_sources +install_headers +install_binutils +install_musl +install_pcc +install_pcc_libs +install_pkgconfig + +# clean environment +rm -rf "${SRCDIR}" +rm -rf "${BLDDIR}" +rm -rf "${PREFIX}/share" +rm -f "${PREFIX}/lib/libiberty.a" + +cat << EOF | tee ${PREFIX}/README +TRIPLET : $TRIPLE +PREFIX : $PREFIX +PCC : $PCCV +BINUTILS: $BINV +MUSL : $MUSLV +KERNEL : $KERNV +EOF diff --git a/data/pcc-1.1.0-deflibdirs.diff b/data/pcc-1.1.0-deflibdirs.diff @@ -0,0 +1,30 @@ +diff -urN a/cc/cc/cc.c b/cc/cc/cc.c +--- a/cc/cc/cc.c 2015-08-16 16:00:18.867457413 +0200 ++++ b/cc/cc/cc.c 2015-08-16 16:03:28.963466133 +0200 +@@ -207,9 +207,9 @@ + #endif + #ifndef DEFLIBDIRS /* default library search paths */ + #ifdef MULTIARCH_PATH +-#define DEFLIBDIRS { "/usr/lib/", 0 } ++#define DEFLIBDIRS { LIBDIR, 0 } + #else +-#define DEFLIBDIRS { "/usr/lib/", "/usr/lib/" MULTIARCH_PATH "/", 0 } ++#define DEFLIBDIRS { LIBDIR, LIBDIR MULTIARCH_PATH "/", 0 } + #endif + #endif + #ifndef DEFLIBS /* default libraries included */ +diff -urN a/os/linux/ccconfig.h b/os/linux/ccconfig.h +--- a/os/linux/ccconfig.h 2015-08-16 16:00:18.873457413 +0200 ++++ b/os/linux/ccconfig.h 2015-08-16 16:05:23.446471384 +0200 +@@ -48,9 +48,9 @@ + "-D__amd64", "-D__LP64__", "-D_LP64", NULL, } + #define DYNLINKER { "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", NULL } + #ifndef MULTIARCH_PATH +-#define DEFLIBDIRS { "/usr/lib64/", 0 } ++#define DEFLIBDIRS { LIBDIR, 0 } + #else +-#define DEFLIBDIRS { "/usr/lib64/", "/usr/lib/" MULTIARCH_PATH "/", 0 } ++#define DEFLIBDIRS { LIBDIR, LIBDIR MULTIARCH_PATH "/", 0 } + #endif + #elif defined(mach_mips) + #define CPPMDADD { "-D__mips__", NULL, } diff --git a/data/pcc-1.1.0-musl.diff b/data/pcc-1.1.0-musl.diff @@ -0,0 +1,21 @@ +diff -urN a/config.sub b/config.sub +--- a/config.sub 2015-08-11 21:55:34.497619099 +0200 ++++ b/config.sub 2015-08-11 21:56:21.652621262 +0200 +@@ -120,7 +120,7 @@ +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in +- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-musl | linux-newlib* | linux-uclibc* | \ +uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ +storm-chaos* | os2-emx* | rtmk-nova*) +os=-$maybe_os +@@ -1289,6 +1289,9 @@ +-linux-dietlibc) +os=-linux-dietlibc +;; ++ -linux-musl) ++ os=-linux-musl ++ ;; +-linux*) +os=`echo $os | sed -e 's|linux|linux-gnu|'` diff --git a/data/pcc-libs-1.1.0-musl.diff b/data/pcc-libs-1.1.0-musl.diff @@ -0,0 +1,22 @@ +diff -urN a/config.sub b/config.sub +--- a/config.sub 2015-08-11 21:55:34.497619099 +0200 ++++ b/config.sub 2015-08-11 21:56:21.652621262 +0200 +@@ -120,7 +120,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-musl | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os +@@ -1289,6 +1289,9 @@ + -linux-dietlibc) + os=-linux-dietlibc + ;; ++ -linux-musl) ++ os=-linux-musl ++ ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;;