mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
Merge #15867: glibc, gcc: fixes for ARM targets
... needed after closure-size merge (#7701)
This commit is contained in:
commit
46f22d89b9
|
@ -44,7 +44,8 @@ stdenv.mkDerivation {
|
||||||
ldWrapper = ./ld-wrapper.sh;
|
ldWrapper = ./ld-wrapper.sh;
|
||||||
utils = ./utils.sh;
|
utils = ./utils.sh;
|
||||||
addFlags = ./add-flags;
|
addFlags = ./add-flags;
|
||||||
inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
|
inherit nativeTools nativeLibc nativePrefix gcc binutils;
|
||||||
|
libc = if libc ? out then libc.out else libc;
|
||||||
crossConfig = if cross != null then cross.config else null;
|
crossConfig = if cross != null then cross.config else null;
|
||||||
osxMinVersion = cross.osxMinVersion or null;
|
osxMinVersion = cross.osxMinVersion or null;
|
||||||
gccLibs = if gcc != null then gccLibs else null;
|
gccLibs = if gcc != null then gccLibs else null;
|
||||||
|
|
|
@ -179,11 +179,11 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
sed -i gcc/config/t-gnu \
|
sed -i gcc/config/t-gnu \
|
||||||
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
|
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -197,7 +197,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -205,10 +205,10 @@ stdenv.mkDerivation ({
|
||||||
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
|
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
|
||||||
libcCross crossMingw;
|
libcCross crossMingw;
|
||||||
|
|
||||||
nativeBuildInputs = [ texinfo which ]
|
nativeBuildInputs = [ texinfo which gettext ]
|
||||||
++ optional (perl != null) perl;
|
++ optional (perl != null) perl;
|
||||||
|
|
||||||
buildInputs = [ gmp mpfr libmpc libelf gettext ]
|
buildInputs = [ gmp mpfr libmpc libelf ]
|
||||||
++ (optional (ppl != null) ppl)
|
++ (optional (ppl != null) ppl)
|
||||||
++ (optional (cloogppl != null) cloogppl)
|
++ (optional (cloogppl != null) cloogppl)
|
||||||
++ (optional (zlib != null) zlib)
|
++ (optional (zlib != null) zlib)
|
||||||
|
@ -346,15 +346,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||||
|
|
|
@ -209,7 +209,9 @@ postInstall() {
|
||||||
# Move runtime libraries to $lib.
|
# Move runtime libraries to $lib.
|
||||||
mkdir -p $lib/lib
|
mkdir -p $lib/lib
|
||||||
ln -s lib $lib/lib64
|
ln -s lib $lib/lib64
|
||||||
mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/
|
moveToOutput "lib/lib*.so" "$lib"
|
||||||
|
moveToOutput "lib/lib*.so.*[0-9]" "$lib"
|
||||||
|
moveToOutput "lib/*.la" "$lib"
|
||||||
for i in $lib/lib/*.la; do
|
for i in $lib/lib/*.la; do
|
||||||
substituteInPlace $i --replace $out $lib
|
substituteInPlace $i --replace $out $lib
|
||||||
done
|
done
|
||||||
|
|
|
@ -229,11 +229,11 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
sed -i gcc/config/t-gnu \
|
sed -i gcc/config/t-gnu \
|
||||||
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
|
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -247,7 +247,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -421,15 +421,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||||
|
|
|
@ -164,8 +164,8 @@ let version = "4.8.5";
|
||||||
" --disable-libatomic " + # libatomic requires libc
|
" --disable-libatomic " + # libatomic requires libc
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
else
|
else
|
||||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
(if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
|
||||||
else " --with-headers=${libcCross}/include") +
|
else " --with-headers=${libcCross.dev}/include") +
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||||
|
@ -255,9 +255,9 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -271,7 +271,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -482,15 +482,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru =
|
passthru =
|
||||||
|
|
|
@ -166,8 +166,8 @@ let version = "4.9.3";
|
||||||
" --disable-libatomic " + # libatomic requires libc
|
" --disable-libatomic " + # libatomic requires libc
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
else
|
else
|
||||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
(if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
|
||||||
else " --with-headers=${libcCross}/include") +
|
else " --with-headers=${libcCross.dev}/include") +
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||||
|
@ -258,9 +258,9 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -274,7 +274,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -489,15 +489,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru =
|
passthru =
|
||||||
|
|
|
@ -166,8 +166,8 @@ let version = "5.4.0";
|
||||||
" --disable-libatomic " + # libatomic requires libc
|
" --disable-libatomic " + # libatomic requires libc
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
else
|
else
|
||||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
(if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
|
||||||
else " --with-headers=${libcCross}/include") +
|
else " --with-headers=${libcCross.dev}/include") +
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||||
|
@ -257,9 +257,9 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -273,7 +273,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -483,15 +483,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru =
|
passthru =
|
||||||
|
|
|
@ -165,8 +165,8 @@ let version = "6.1.0";
|
||||||
" --disable-libatomic " + # libatomic requires libc
|
" --disable-libatomic " + # libatomic requires libc
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
else
|
else
|
||||||
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
|
(if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
|
||||||
else " --with-headers=${libcCross}/include") +
|
else " --with-headers=${libcCross.dev}/include") +
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
|
||||||
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
|
||||||
|
@ -256,9 +256,9 @@ stdenv.mkDerivation ({
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.cc.libc != null then
|
else if cross != null || stdenv.cc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
|
@ -272,7 +272,7 @@ stdenv.mkDerivation ({
|
||||||
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
|
||||||
echo " fixing \`$header'..."
|
echo " fixing \`$header'..."
|
||||||
sed -i "$header" \
|
sed -i "$header" \
|
||||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g'
|
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else null;
|
else null;
|
||||||
|
@ -482,15 +482,28 @@ stdenv.mkDerivation ({
|
||||||
++ optional (libpthread != null) libpthread)));
|
++ optional (libpthread != null) libpthread)));
|
||||||
|
|
||||||
EXTRA_TARGET_CFLAGS =
|
EXTRA_TARGET_CFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-idirafter ${libcCross}/include"
|
"-idirafter ${libcCross.dev}/include"
|
||||||
|
]
|
||||||
|
++ optionals (! crossStageStatic) [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
EXTRA_TARGET_LDFLAGS =
|
EXTRA_TARGET_LDFLAGS =
|
||||||
if cross != null && libcCross != null
|
if cross != null && libcCross != null then [
|
||||||
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
|
"-Wl,-L${libcCross.out}/lib"
|
||||||
(optionalString (libpthreadCross != null)
|
]
|
||||||
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
|
++ (if crossStageStatic then [
|
||||||
|
"-B${libcCross.out}/lib"
|
||||||
|
] else [
|
||||||
|
"-Wl,-rpath,${libcCross.out}/lib"
|
||||||
|
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||||
|
])
|
||||||
|
++ optionals (libpthreadCross != null) [
|
||||||
|
"-L${libpthreadCross}/lib"
|
||||||
|
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||||
|
]
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
passthru =
|
passthru =
|
||||||
|
|
|
@ -70,10 +70,6 @@ if test "$noSysDirs" = "1"; then
|
||||||
# gcj in.
|
# gcj in.
|
||||||
unset LIBRARY_PATH
|
unset LIBRARY_PATH
|
||||||
unset CPATH
|
unset CPATH
|
||||||
if test -z "$crossStageStatic"; then
|
|
||||||
EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
|
|
||||||
EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if test -z "$NIX_CC_CROSS"; then
|
if test -z "$NIX_CC_CROSS"; then
|
||||||
EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
|
EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
|
||||||
|
|
|
@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
|
||||||
sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
|
sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ xz xz.bin libiconv ];
|
nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
# Glibc cannot have itself in its RPATH.
|
|
||||||
export NIX_NO_SELF_RPATH=1
|
|
||||||
|
|
||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
postConfigure() {
|
|
||||||
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
|
|
||||||
# This has to be done *after* `configure' because it builds some
|
|
||||||
# test binaries.
|
|
||||||
export NIX_CFLAGS_LINK=
|
|
||||||
export NIX_LDFLAGS_BEFORE=
|
|
||||||
|
|
||||||
export NIX_DONT_SET_RPATH=1
|
|
||||||
unset CFLAGS
|
|
||||||
|
|
||||||
# Apparently --bindir is not respected.
|
|
||||||
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
|
|
||||||
}
|
|
||||||
|
|
||||||
postInstall() {
|
|
||||||
if test -n "$installLocales"; then
|
|
||||||
make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
|
|
||||||
fi
|
|
||||||
|
|
||||||
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
|
|
||||||
|
|
||||||
if test -n "$linuxHeaders"; then
|
|
||||||
# Include the Linux kernel headers in Glibc, except the `scsi'
|
|
||||||
# subdirectory, which Glibc provides itself.
|
|
||||||
(cd $dev/include && \
|
|
||||||
ln -sv $(ls -d $linuxHeaders/include/* | grep -v 'scsi$') .)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
|
|
||||||
# "lib64" to "lib".
|
|
||||||
if test -n "$is64bit"; then
|
|
||||||
ln -s lib $out/lib64
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get rid of more unnecessary stuff.
|
|
||||||
rm -rf $out/var $out/sbin/sln
|
|
||||||
|
|
||||||
for i in $out/lib/*.a; do
|
|
||||||
strip -S "$i"
|
|
||||||
done
|
|
||||||
# Put libraries for static linking in a separate output. Note
|
|
||||||
# that libc_nonshared.a and libpthread_nonshared.a are required
|
|
||||||
# for dynamically-linked applications.
|
|
||||||
mkdir -p $static/lib
|
|
||||||
mv $out/lib/*.a $static/lib
|
|
||||||
mv $static/lib/lib*_nonshared.a $out/lib
|
|
||||||
|
|
||||||
# Work around a Nix bug: hard links across outputs cause a build failure.
|
|
||||||
cp $bin/bin/getconf $bin/bin/getconf_
|
|
||||||
mv $bin/bin/getconf_ $bin/bin/getconf
|
|
||||||
}
|
|
||||||
|
|
||||||
genericBuild
|
|
|
@ -54,6 +54,7 @@ stdenv.mkDerivation ({
|
||||||
./glob-simplify-interface.patch
|
./glob-simplify-interface.patch
|
||||||
./cve-2016-1234.patch
|
./cve-2016-1234.patch
|
||||||
./cve-2016-3706.patch
|
./cve-2016-3706.patch
|
||||||
|
./fix_warnings.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch =
|
postPatch =
|
||||||
|
|
|
@ -17,7 +17,21 @@ in
|
||||||
inherit lib stdenv fetchurl linuxHeaders installLocales
|
inherit lib stdenv fetchurl linuxHeaders installLocales
|
||||||
profilingLibraries gccCross withGd gd libpng;
|
profilingLibraries gccCross withGd gd libpng;
|
||||||
|
|
||||||
builder = ./builder.sh;
|
NIX_NO_SELF_RPATH = true;
|
||||||
|
|
||||||
|
postConfigure = ''
|
||||||
|
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
|
||||||
|
# This has to be done *after* `configure' because it builds some
|
||||||
|
# test binaries.
|
||||||
|
export NIX_CFLAGS_LINK=
|
||||||
|
export NIX_LDFLAGS_BEFORE=
|
||||||
|
|
||||||
|
export NIX_DONT_SET_RPATH=1
|
||||||
|
unset CFLAGS
|
||||||
|
|
||||||
|
# Apparently --bindir is not respected.
|
||||||
|
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
|
||||||
|
'';
|
||||||
|
|
||||||
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
|
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
|
||||||
# any program we run, because the gcc will have been placed at a new
|
# any program we run, because the gcc will have been placed at a new
|
||||||
|
@ -26,7 +40,7 @@ in
|
||||||
# Building from a proper gcc staying in the path where it was installed,
|
# Building from a proper gcc staying in the path where it was installed,
|
||||||
# libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
|
# libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
|
||||||
# any special hack.
|
# any special hack.
|
||||||
preInstall = if cross != null then "" else ''
|
preInstall = ''
|
||||||
if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
|
if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
|
cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
|
||||||
|
@ -35,6 +49,41 @@ in
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
if test -n "$installLocales"; then
|
||||||
|
make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales
|
||||||
|
fi
|
||||||
|
|
||||||
|
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
|
||||||
|
|
||||||
|
if test -n "$linuxHeaders"; then
|
||||||
|
# Include the Linux kernel headers in Glibc, except the `scsi'
|
||||||
|
# subdirectory, which Glibc provides itself.
|
||||||
|
(cd $dev/include && \
|
||||||
|
ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
|
||||||
|
# "lib64" to "lib".
|
||||||
|
if test -n "$is64bit"; then
|
||||||
|
ln -s lib $out/lib64
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get rid of more unnecessary stuff.
|
||||||
|
rm -rf $out/var $out/sbin/sln
|
||||||
|
|
||||||
|
# Put libraries for static linking in a separate output. Note
|
||||||
|
# that libc_nonshared.a and libpthread_nonshared.a are required
|
||||||
|
# for dynamically-linked applications.
|
||||||
|
mkdir -p $static/lib
|
||||||
|
mv $out/lib/*.a $static/lib
|
||||||
|
mv $static/lib/lib*_nonshared.a $out/lib
|
||||||
|
|
||||||
|
# Work around a Nix bug: hard links across outputs cause a build failure.
|
||||||
|
cp $bin/bin/getconf $bin/bin/getconf_
|
||||||
|
mv $bin/bin/getconf_ $bin/bin/getconf
|
||||||
|
'';
|
||||||
|
|
||||||
separateDebugInfo = true;
|
separateDebugInfo = true;
|
||||||
|
|
||||||
meta.description = "The GNU C Library";
|
meta.description = "The GNU C Library";
|
||||||
|
@ -62,6 +111,10 @@ in
|
||||||
dontStrip=1
|
dontStrip=1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
preInstall = null; # clobber the native hook
|
||||||
|
|
||||||
|
separateDebugInfo = false; # this is currently broken for crossDrv
|
||||||
|
|
||||||
# To avoid a dependency on the build system 'bash'.
|
# To avoid a dependency on the build system 'bash'.
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
|
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
|
||||||
|
|
36
pkgs/development/libraries/glibc/fix_warnings.patch
Normal file
36
pkgs/development/libraries/glibc/fix_warnings.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
--- a/stdlib/setenv.c 2016-05-30 11:09:14.487180254 +0000
|
||||||
|
+++ b/stdlib/setenv.c 2016-05-30 11:08:25.560390748 +0000
|
||||||
|
@@ -277,6 +277,7 @@
|
||||||
|
|
||||||
|
ep = __environ;
|
||||||
|
if (ep != NULL)
|
||||||
|
+ {
|
||||||
|
while (*ep != NULL)
|
||||||
|
if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
|
||||||
|
{
|
||||||
|
@@ -290,6 +291,7 @@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++ep;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
UNLOCK;
|
||||||
|
|
||||||
|
--- a/nis/nis_call.c 2016-05-30 08:05:59.359855696 -0700
|
||||||
|
+++ b/nis/nis_call.c 2016-05-30 08:05:55.679873221 -0700
|
||||||
|
@@ -680,6 +680,7 @@
|
||||||
|
/* Choose which entry should be evicted from the cache. */
|
||||||
|
loc = &nis_server_cache[0];
|
||||||
|
if (*loc != NULL)
|
||||||
|
+ {
|
||||||
|
for (i = 1; i < 16; ++i)
|
||||||
|
if (nis_server_cache[i] == NULL)
|
||||||
|
{
|
||||||
|
@@ -690,6 +691,7 @@
|
||||||
|
|| ((*loc)->uses == nis_server_cache[i]->uses
|
||||||
|
&& (*loc)->expires > nis_server_cache[i]->expires))
|
||||||
|
loc = &nis_server_cache[i];
|
||||||
|
+ }
|
||||||
|
old = *loc;
|
||||||
|
*loc = new;
|
||||||
|
|
Loading…
Reference in a new issue