mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Define "brokenRedHatKernel = true" in $NIXPKGS_CONFIG to build a system that
works on Red Hat Linux, i.e. that is based on glibc version 2.5. Furthermore, this patch fixes a number of gcc 4.3.3 build errors in glibc 2.5 that occur on both x86 and x86_64. The older version of this library is still useful for running Nix on a Red Hat host. Newer version of glibc fail to detect the kernel's capabilities correctly (due to mad patches applied to the kernel by Red Hat). The individual changes are: * Re-activated glibc 2.5 in all-packages.nix. * Fix incomplete header search path in bootstrap tools. Gcc-wrapper sets "-B<prefix>" to tell the compiler about its installation root. Unfortunately, the setting doesn't add $gcc/lib/gcc/*/*/include-fixed to the search path. That directory is required, however, because it contains the system-specific "limits.h" file, and the glibc 2.5 builds tries to find that file via #include_next. * Support intrinsic functions like __signbit() or atof() correctly to avoid compile-time conflicts. * Switch to NPTL. Linuxthreads is no longer supported. * Added a meta attribute to glibc package. * Updated nixUnstable to version 0.13pre15614 from trunk. The previous version failed regression tests. * Fix more strict type checking in binutils since 2.18.50.0.3. Without this patch, the build failed on x86, saying: ../sysdeps/i386/fpu/ftestexcept.c: Assembler messages: ../sysdeps/i386/fpu/ftestexcept.c:33: Error: suffix or operands invalid for `fnstsw' svn path=/nixpkgs/branches/stdenv-updates/; revision=16037
This commit is contained in:
parent
8f0f5c403d
commit
7534cbe4b8
|
@ -17,8 +17,15 @@ if test -z "$nativeLibc"; then
|
||||||
# against the crt1.o from our own glibc, rather than the one in
|
# against the crt1.o from our own glibc, rather than the one in
|
||||||
# /usr/lib. (This is only an issue when using an `impure'
|
# /usr/lib. (This is only an issue when using an `impure'
|
||||||
# compiler/linker, i.e., one that searches /usr/lib and so on.)
|
# compiler/linker, i.e., one that searches /usr/lib and so on.)
|
||||||
echo "-B$libc/lib/ -idirafter $libc/include" > $out/nix-support/libc-cflags
|
#
|
||||||
|
# Unfortunately, setting -B appears to override the default search
|
||||||
|
# path. Thus, the gcc-specific "../includes-fixed" directory is
|
||||||
|
# now longer searched and glibc's <limits.h> header fails to
|
||||||
|
# compile, because it uses "#include_next <limits.h>" to find the
|
||||||
|
# limits.h file in ../includes-fixed. To remedy the problem,
|
||||||
|
# another -idirafter is necessary to add that directory again.
|
||||||
|
echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
|
||||||
|
|
||||||
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
|
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
|
||||||
|
|
||||||
# The dynamic linker is passed in `ldflagsBefore' to allow
|
# The dynamic linker is passed in `ldflagsBefore' to allow
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# glibc cannot have itself in its rpath.
|
# glibc cannot have itself in its rpath.
|
||||||
export NIX_NO_SELF_RPATH=1
|
export NIX_NO_SELF_RPATH=1
|
||||||
export NIX_DONT_SET_RPATH=1
|
|
||||||
|
|
||||||
source $stdenv/setup
|
source $stdenv/setup
|
||||||
|
|
||||||
|
@ -9,17 +8,12 @@ export PWD_P=$(type -tP pwd)
|
||||||
|
|
||||||
|
|
||||||
postUnpack() {
|
postUnpack() {
|
||||||
cd $sourceRoot
|
cd $sourceRoot/..
|
||||||
unpackFile $linuxthreadsSrc
|
|
||||||
cd ..
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
preConfigure() {
|
preConfigure() {
|
||||||
|
|
||||||
# Use Linuxthreads instead of NPTL.
|
|
||||||
rm -rf nptl
|
|
||||||
|
|
||||||
for i in configure io/ftwtest-sh; do
|
for i in configure io/ftwtest-sh; do
|
||||||
substituteInPlace "$i" \
|
substituteInPlace "$i" \
|
||||||
--replace "@PWD@" "pwd"
|
--replace "@PWD@" "pwd"
|
||||||
|
@ -27,7 +21,7 @@ preConfigure() {
|
||||||
|
|
||||||
mkdir ../build
|
mkdir ../build
|
||||||
cd ../build
|
cd ../build
|
||||||
|
|
||||||
configureScript=../$sourceRoot/configure
|
configureScript=../$sourceRoot/configure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +32,7 @@ postConfigure() {
|
||||||
# test binaries.
|
# test binaries.
|
||||||
export NIX_CFLAGS_LINK=
|
export NIX_CFLAGS_LINK=
|
||||||
export NIX_LDFLAGS_BEFORE=
|
export NIX_LDFLAGS_BEFORE=
|
||||||
|
export NIX_DONT_SET_RPATH=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,11 +43,6 @@ postInstall() {
|
||||||
rm $out/etc/ld.so.cache
|
rm $out/etc/ld.so.cache
|
||||||
(cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
|
(cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
|
||||||
|
|
||||||
# Workaround for the wrong <semaphore.h> getting installed. This
|
|
||||||
# appears to be a regression:
|
|
||||||
# http://www.mail-archive.com/debian-glibc@lists.debian.org/msg31543.html
|
|
||||||
cp ../$sourceRoot/linuxthreads/semaphore.h $out/include
|
|
||||||
|
|
||||||
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
|
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
|
||||||
# "lib64" to "lib".
|
# "lib64" to "lib".
|
||||||
if test -n "$is64bit"; then
|
if test -n "$is64bit"; then
|
||||||
|
|
|
@ -12,22 +12,26 @@ stdenv.mkDerivation {
|
||||||
md5 = "1fb29764a6a650a4d5b409dda227ac9f";
|
md5 = "1fb29764a6a650a4d5b409dda227ac9f";
|
||||||
};
|
};
|
||||||
|
|
||||||
linuxthreadsSrc = fetchurl {
|
patches = [ ./glibc-pwd.patch ./glibc-getcwd-param-MAX.patch ./glibc-inline.patch ./x86-fnstsw.patch ];
|
||||||
url = http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2;
|
|
||||||
md5 = "870d76d46dcaba37c13d01dca47d1774";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [ ./glibc-pwd.patch ./glibc-getcwd-param-MAX.patch ];
|
|
||||||
|
|
||||||
inherit kernelHeaders installLocales;
|
inherit kernelHeaders installLocales;
|
||||||
|
|
||||||
inherit (stdenv) is64bit;
|
inherit (stdenv) is64bit;
|
||||||
|
|
||||||
# `--with-tls --without-__thread' enables support for TLS but causes
|
|
||||||
# it not to be used. Required if we don't want to barf on 2.4
|
|
||||||
# kernels. Or something.
|
|
||||||
configureFlags="--enable-add-ons
|
configureFlags="--enable-add-ons
|
||||||
--with-headers=${kernelHeaders}/include
|
--with-headers=${kernelHeaders}/include
|
||||||
--with-tls --without-__thread --disable-sanity-checks
|
--disable-sanity-checks
|
||||||
${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
|
${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
|
||||||
|
|
||||||
|
# Workaround for this bug:
|
||||||
|
# http://sourceware.org/bugzilla/show_bug.cgi?id=411
|
||||||
|
# I.e. when gcc is compiled with --with-arch=i686, then the
|
||||||
|
# preprocessor symbol `__i686' will be defined to `1'. This causes
|
||||||
|
# the symbol __i686.get_pc_thunk.dx to be mangled.
|
||||||
|
NIX_CFLAGS_COMPILE = "-U__i686";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = http://www.gnu.org/software/libc/;
|
||||||
|
description = "The GNU C Library";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
1822
pkgs/development/libraries/glibc-2.5/glibc-inline.patch
Normal file
1822
pkgs/development/libraries/glibc-2.5/glibc-inline.patch
Normal file
File diff suppressed because it is too large
Load diff
32
pkgs/development/libraries/glibc-2.5/x86-fnstsw.patch
Normal file
32
pkgs/development/libraries/glibc-2.5/x86-fnstsw.patch
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# --- T2-COPYRIGHT-NOTE-BEGIN ---
|
||||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
||||||
|
#
|
||||||
|
# T2 SDE: package/.../glibc/x86-fnstsw.patch
|
||||||
|
# Copyright (C) 2008 The T2 SDE Project
|
||||||
|
#
|
||||||
|
# More information can be found in the files COPYING and README.
|
||||||
|
#
|
||||||
|
# This patch file is dual-licensed. It is available under the license the
|
||||||
|
# patched project is licensed under, as long as it is an OpenSource license
|
||||||
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
|
||||||
|
# of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
# --- T2-COPYRIGHT-NOTE-END ---
|
||||||
|
|
||||||
|
Fix more strict checking in binutils since 2.18.50.0.3:
|
||||||
|
sysdeps/i386/fpu/ftestexcept.c:33: Error: suffix or operands invalid for `fnstsw'
|
||||||
|
|
||||||
|
- Rene Rebe <rene@exactcode.de>
|
||||||
|
|
||||||
|
--- glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c.vanilla 2008-09-02 12:45:07.000000000 +0200
|
||||||
|
+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-09-02 12:46:37.000000000 +0200
|
||||||
|
@@ -26,7 +26,7 @@
|
||||||
|
int
|
||||||
|
fetestexcept (int excepts)
|
||||||
|
{
|
||||||
|
- int temp;
|
||||||
|
+ short temp;
|
||||||
|
int xtemp = 0;
|
||||||
|
|
||||||
|
/* Get current exceptions. */
|
|
@ -4,12 +4,12 @@
|
||||||
, supportOldDBs ? true
|
, supportOldDBs ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
name = "nix-0.13pre15214";
|
name = "nix-0.13pre15614";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://hydra.nixos.org/build/17407/download/1/nix-0.13pre15214.tar.bz2;
|
url = "http://hydra.nixos.org/build/32581/download/4/${name}.tar.bz2";
|
||||||
sha256 = "b2423eebb0c70fa2c38d11b5d5e6d8794ebc7283dfde8d1f1c02c54846014ab2";
|
sha256 = "236c84cf85739fe1deddd8f98f634eac03df9c7a588f4c1e234e80e84a471d00";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [perl curl openssl];
|
buildInputs = [perl curl openssl];
|
||||||
|
|
|
@ -3028,7 +3028,12 @@ let
|
||||||
inherit fetchurl stdenv pkgconfig gettext;
|
inherit fetchurl stdenv pkgconfig gettext;
|
||||||
};
|
};
|
||||||
|
|
||||||
glibc = useFromStdenv "glibc" glibc29;
|
glibc = useFromStdenv "glibc" (if getConfig ["brokenRedHatKernel"] false then glibc25 else glibc29);
|
||||||
|
|
||||||
|
glibc25 = import ../development/libraries/glibc-2.5 {
|
||||||
|
inherit fetchurl stdenv kernelHeaders;
|
||||||
|
installLocales = getPkgConfig "glibc" "locales" false;
|
||||||
|
};
|
||||||
|
|
||||||
glibc27 = import ../development/libraries/glibc-2.7 {
|
glibc27 = import ../development/libraries/glibc-2.7 {
|
||||||
inherit fetchurl stdenv kernelHeaders;
|
inherit fetchurl stdenv kernelHeaders;
|
||||||
|
|
Loading…
Reference in a new issue