diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2018-04-09 16:10:47 +0100 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2018-04-09 16:12:47 +0100 |
commit | 654ce4ba29620c0bddfbd8b42f4451ba5c26bac2 (patch) | |
tree | bfa8297fbb32fc4c73ae2ad652497f7d9002f53c /pkgs/os-specific/linux/musl | |
parent | 2e0dfb49f7a973e8701e00c88c4e97340fa6c623 (diff) |
musl: enable musl-gcc, ld.musl-clang, musl-clang
These are convenient for projects with mixed musl/glibc build targets. For pure musl builds in nixpkgs, we probably want a musl stdenv.
Diffstat (limited to 'pkgs/os-specific/linux/musl')
-rw-r--r-- | pkgs/os-specific/linux/musl/default.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix index 005a12f5b94dc..4d1c2cad2e33c 100644 --- a/pkgs/os-specific/linux/musl/default.nix +++ b/pkgs/os-specific/linux/musl/default.nix @@ -50,8 +50,7 @@ stdenv.mkDerivation rec { "--enable-static" "--enable-debug" "CFLAGS=-fstack-protector-strong" - # Fix cycle between outputs - "--disable-wrapper" + "--enable-wrapper=all" ]; outputs = [ "out" "dev" ]; @@ -59,18 +58,25 @@ stdenv.mkDerivation rec { dontDisableStatic = true; separateDebugInfo = true; - postInstall = - '' + postInstall = '' # Not sure why, but link in all but scsi directory as that's what uclibc/glibc do. # Apparently glibc provides scsi itself? (cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .) - '' + '' + # Strip debug out of the static library $STRIP -S $out/lib/libc.a - '' + '' mkdir -p $out/bin + # Create 'ldd' symlink, builtin ln -s $out/lib/libc.so $out/bin/ldd + + # (impure) cc wrapper around musl for interactive usuage + for i in musl-gcc musl-clang ld.musl-clang; do + moveToOutput bin/$i $dev + done + moveToOutput lib/musl-gcc.specs $dev + substituteInPlace $dev/bin/musl-gcc \ + --replace $out/lib/musl-gcc.specs $dev/lib/musl-gcc.specs '' + lib.optionalString useBSDCompatHeaders '' install -D ${queue_h} $dev/include/sys/queue.h install -D ${cdefs_h} $dev/include/sys/cdefs.h |