From 662721a4616e7e0a854897845aebf8d8198cb1d2 Mon Sep 17 00:00:00 2001 From: Alexey Shmalko Date: Wed, 3 Aug 2016 03:28:14 +0300 Subject: [PATCH 1/3] gcc-cross-wrapper: fix for non-chroot build When `libc` is not set, many lines expand to `/lib`, `/include`, which makes gccCross use host libraries outside Nix (with a different architecture). --- pkgs/build-support/gcc-cross-wrapper/builder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh index 9396ace84f1..1bdda969653 100644 --- a/pkgs/build-support/gcc-cross-wrapper/builder.sh +++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh @@ -7,7 +7,7 @@ mkdir $out/nix-support # Force gcc to use ld-wrapper.sh when calling ld. cflagsCompile="-B$out/bin/" -if test -z "$nativeLibc"; then +if test -z "$nativeLibc" -a -n "$libc"; then cflagsCompile="$cflagsCompile -B$gccLibs/lib -B$libc/lib/ -isystem $libc/include" ldflags="$ldflags -L$libc/lib" # Get the proper dynamic linker for glibc and uclibc. From a9bc2d530b45ad0356e253c6bb437e2edc631a2b Mon Sep 17 00:00:00 2001 From: Alexey Shmalko Date: Wed, 3 Aug 2016 03:32:30 +0300 Subject: [PATCH 2/3] gcc: disable libsanitizer for uclibc libsanitizer requires header files which are not present in uclibc. Also, libsanitizer is disabled with uclibc for buildroot[1] and openwrt[2]. [1]: https://git.busybox.net/buildroot/commit/?id=554e29e267e6b36a0fd78c82cbad2c82d939eb7f [2]: https://gitlab.labs.nic.cz/turris/openwrt/commit/5f372a8ca08de4b2253b87253ca7762450e5641f --- pkgs/development/compilers/gcc/4.9/default.nix | 3 +++ pkgs/development/compilers/gcc/5/default.nix | 3 +++ pkgs/development/compilers/gcc/6/default.nix | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 475349ed4ba..f955c6ace0d 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -189,6 +189,9 @@ let version = "4.9.3"; # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if cross.libc == "uclibc" then + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + " --disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. " --disable-libgomp" else "") + diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 4802c3fe278..2ac4f553f85 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -189,6 +189,9 @@ let version = "5.4.0"; # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if cross.libc == "uclibc" then + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + " --disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. " --disable-libgomp" else "") + diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index e87554c25ab..ec6f0ca8d14 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -188,6 +188,9 @@ let version = "6.1.0"; # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if cross.libc == "uclibc" then + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + " --disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. " --disable-libgomp" else "") + From 5ab8e0d2aa88a5d4e0d71cd384221ef6f868d307 Mon Sep 17 00:00:00 2001 From: Alexey Shmalko Date: Wed, 3 Aug 2016 03:35:54 +0300 Subject: [PATCH 3/3] uclibc: claim maintainership --- pkgs/os-specific/linux/uclibc/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix index 472d432bc63..6fe0a5ce5d0 100644 --- a/pkgs/os-specific/linux/uclibc/default.nix +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -104,6 +104,7 @@ stdenv.mkDerivation { meta = { homepage = http://www.uclibc.org/; description = "A small implementation of the C library"; + maintainers = with stdenv.lib.maintainers; [ rasendubi ]; license = stdenv.lib.licenses.lgpl2; }; }