gcc, glibc: merge changes from original multiple-output
Can't be done automatically because of file copies/moves.
This commit is contained in:
parent
def75f0282
commit
c96f4d7949
@ -8,9 +8,10 @@ mkdir $NIX_FIXINC_DUMMY
|
|||||||
if test "$staticCompiler" = "1"; then
|
if test "$staticCompiler" = "1"; then
|
||||||
EXTRA_LDFLAGS="-static"
|
EXTRA_LDFLAGS="-static"
|
||||||
else
|
else
|
||||||
EXTRA_LDFLAGS=""
|
EXTRA_LDFLAGS="-Wl,-rpath,$lib/lib"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# GCC interprets empty paths as ".", which we don't want.
|
# GCC interprets empty paths as ".", which we don't want.
|
||||||
if test -z "$CPATH"; then unset CPATH; fi
|
if test -z "$CPATH"; then unset CPATH; fi
|
||||||
if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi
|
if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi
|
||||||
@ -29,7 +30,7 @@ if test "$noSysDirs" = "1"; then
|
|||||||
# Use *real* header files, otherwise a limits.h is generated
|
# Use *real* header files, otherwise a limits.h is generated
|
||||||
# that does not include Glibc's limits.h (notably missing
|
# that does not include Glibc's limits.h (notably missing
|
||||||
# SSIZE_MAX, which breaks the build).
|
# SSIZE_MAX, which breaks the build).
|
||||||
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
|
export NIX_FIXINC_DUMMY=$libc_dev/include
|
||||||
|
|
||||||
# The path to the Glibc binaries such as `crti.o'.
|
# The path to the Glibc binaries such as `crti.o'.
|
||||||
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
||||||
@ -171,9 +172,8 @@ preConfigure() {
|
|||||||
# Patch the configure script so it finds glibc headers. It's
|
# Patch the configure script so it finds glibc headers. It's
|
||||||
# important for example in order not to get libssp built,
|
# important for example in order not to get libssp built,
|
||||||
# because its functionality is in glibc already.
|
# because its functionality is in glibc already.
|
||||||
glibc_headers="$(cat $NIX_GCC/nix-support/orig-libc)/include"
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \
|
-e "s,glibc_header_dir=/usr/include,glibc_header_dir=$libc_dev/include", \
|
||||||
gcc/configure
|
gcc/configure
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -210,6 +210,14 @@ preInstall() {
|
|||||||
|
|
||||||
|
|
||||||
postInstall() {
|
postInstall() {
|
||||||
|
# Move runtime libraries to $lib.
|
||||||
|
mkdir -p $lib/lib
|
||||||
|
ln -s lib $lib/lib64
|
||||||
|
mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/
|
||||||
|
for i in $lib/lib/*.la; do
|
||||||
|
substituteInPlace $i --replace $out $lib
|
||||||
|
done
|
||||||
|
|
||||||
# Remove precompiled headers for now. They are very big and
|
# Remove precompiled headers for now. They are very big and
|
||||||
# probably not very useful yet.
|
# probably not very useful yet.
|
||||||
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
|
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
|
||||||
@ -221,6 +229,7 @@ postInstall() {
|
|||||||
|
|
||||||
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
|
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
|
||||||
rm -rf $out/bin/gccbug
|
rm -rf $out/bin/gccbug
|
||||||
|
|
||||||
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
|
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
|
||||||
for i in $out/libexec/gcc/*/*/*; do
|
for i in $out/libexec/gcc/*/*/*; do
|
||||||
if PREV_RPATH=`patchelf --print-rpath $i`; then
|
if PREV_RPATH=`patchelf --print-rpath $i`; then
|
||||||
@ -229,7 +238,7 @@ postInstall() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Get rid of some "fixed" header files
|
# Get rid of some "fixed" header files
|
||||||
rm -rf $out/lib/gcc/*/*/include/root
|
rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux}
|
||||||
|
|
||||||
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
||||||
for i in $out/bin/*-gcc*; do
|
for i in $out/bin/*-gcc*; do
|
||||||
|
@ -195,7 +195,7 @@ let version = "4.8.3";
|
|||||||
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
|
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
|
||||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||||
|
|
||||||
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -214,6 +214,13 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
inherit patches;
|
inherit patches;
|
||||||
|
|
||||||
|
outputs = [ "out" "lib" ];
|
||||||
|
|
||||||
|
setOutputConfigureFlags = false;
|
||||||
|
|
||||||
|
|
||||||
|
libc_dev = stdenv.gcc.libc_dev;
|
||||||
|
|
||||||
postPatch =
|
postPatch =
|
||||||
if (stdenv.isGNU
|
if (stdenv.isGNU
|
||||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||||
|
@ -12,8 +12,10 @@ postConfigure() {
|
|||||||
|
|
||||||
export NIX_DONT_SET_RPATH=1
|
export NIX_DONT_SET_RPATH=1
|
||||||
unset CFLAGS
|
unset CFLAGS
|
||||||
}
|
|
||||||
|
|
||||||
|
# Apparently --bindir is not respected.
|
||||||
|
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
|
||||||
|
}
|
||||||
|
|
||||||
postInstall() {
|
postInstall() {
|
||||||
if test -n "$installLocales"; then
|
if test -n "$installLocales"; then
|
||||||
@ -27,7 +29,7 @@ postInstall() {
|
|||||||
if test -z "$hurdHeaders"; then
|
if test -z "$hurdHeaders"; then
|
||||||
# Include the Linux kernel headers in Glibc, except the `scsi'
|
# Include the Linux kernel headers in Glibc, except the `scsi'
|
||||||
# subdirectory, which Glibc provides itself.
|
# subdirectory, which Glibc provides itself.
|
||||||
(cd $out/include && \
|
(cd $dev/include && \
|
||||||
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
|
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -52,6 +54,17 @@ postInstall() {
|
|||||||
|
|
||||||
# Get rid of more unnecessary stuff.
|
# Get rid of more unnecessary stuff.
|
||||||
rm -rf $out/var $out/sbin/sln
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
genericBuild
|
genericBuild
|
||||||
|
@ -25,6 +25,8 @@ in
|
|||||||
|
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" "bin" "static" ];
|
||||||
|
|
||||||
# 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
|
||||||
# store path than that determined when built (as a source for the
|
# store path than that determined when built (as a source for the
|
||||||
@ -95,7 +97,7 @@ in
|
|||||||
|
|
||||||
# To avoid a dependency on the build system 'bash'.
|
# To avoid a dependency on the build system 'bash'.
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
|
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
else {}))
|
else {}))
|
||||||
|
@ -25,7 +25,7 @@ build null {
|
|||||||
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
|
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
|
||||||
buildPhase =
|
buildPhase =
|
||||||
''
|
''
|
||||||
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
|
mkdir -p $TMPDIR/"${stdenv.gcc.libc}/lib/locale"
|
||||||
|
|
||||||
# Hack to allow building of the locales (needed since glibc-2.12)
|
# Hack to allow building of the locales (needed since glibc-2.12)
|
||||||
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
|
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user