mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #38651 from Mic92/musl-gcc
musl: enable musl-gcc, ld.musl-clang, musl-clang
This commit is contained in:
commit
daa17416c6
1 changed files with 12 additions and 6 deletions
|
@ -50,8 +50,7 @@ stdenv.mkDerivation rec {
|
||||||
"--enable-static"
|
"--enable-static"
|
||||||
"--enable-debug"
|
"--enable-debug"
|
||||||
"CFLAGS=-fstack-protector-strong"
|
"CFLAGS=-fstack-protector-strong"
|
||||||
# Fix cycle between outputs
|
"--enable-wrapper=all"
|
||||||
"--disable-wrapper"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
@ -59,18 +58,25 @@ stdenv.mkDerivation rec {
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
separateDebugInfo = true;
|
separateDebugInfo = true;
|
||||||
|
|
||||||
postInstall =
|
postInstall = ''
|
||||||
''
|
|
||||||
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
|
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
|
||||||
# Apparently glibc provides scsi itself?
|
# Apparently glibc provides scsi itself?
|
||||||
(cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
|
(cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
|
||||||
'' + ''
|
|
||||||
# Strip debug out of the static library
|
# Strip debug out of the static library
|
||||||
$STRIP -S $out/lib/libc.a
|
$STRIP -S $out/lib/libc.a
|
||||||
'' + ''
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
|
||||||
# Create 'ldd' symlink, builtin
|
# Create 'ldd' symlink, builtin
|
||||||
ln -s $out/lib/libc.so $out/bin/ldd
|
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 ''
|
'' + lib.optionalString useBSDCompatHeaders ''
|
||||||
install -D ${queue_h} $dev/include/sys/queue.h
|
install -D ${queue_h} $dev/include/sys/queue.h
|
||||||
install -D ${cdefs_h} $dev/include/sys/cdefs.h
|
install -D ${cdefs_h} $dev/include/sys/cdefs.h
|
||||||
|
|
Loading…
Reference in a new issue