* gcc-apple: produce a libstdc++.dylib that doesn't depend on
/usr/lib/libstdc++.dylib. svn path=/nixpkgs/branches/stdenv-updates/; revision=32365
This commit is contained in:
parent
0e6c77befa
commit
da3ecd1256
@ -84,22 +84,32 @@ postInstall() {
|
|||||||
rm -rf $out/libexec/gcc/*/*/install-tools
|
rm -rf $out/libexec/gcc/*/*/install-tools
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
postUnpack() {
|
postUnpack() {
|
||||||
mv $libstdcxx/libstdcxx $sourceRoot/
|
mv $libstdcxx/libstdcxx $sourceRoot/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
STDCXX_INCDIR="$out/include/c++/4.2.1"
|
STDCXX_INCDIR="$out/include/c++/4.2.1"
|
||||||
|
|
||||||
genericBuild
|
genericBuild
|
||||||
|
|
||||||
|
|
||||||
echo '-------------------------------------------------------------------------------------------------------------------------'
|
echo '-------------------------------------------------------------------------------------------------------------------------'
|
||||||
echo 'libstdcxx-16'
|
echo 'libstdcxx'
|
||||||
echo '-------------------------------------------------------------------------------------------------------------------------'
|
echo '-------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
pwd
|
pwd
|
||||||
|
|
||||||
|
unpackPhase () {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
patchPhase() {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
preConfigure() {
|
preConfigure() {
|
||||||
# Perform the build in a different directory.
|
# Perform the build in a different directory.
|
||||||
mkdir ../build_libstdcxx
|
mkdir ../build_libstdcxx
|
||||||
@ -111,18 +121,9 @@ preConfigure() {
|
|||||||
configureFlags="--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR}"
|
configureFlags="--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
unpackPhase () {
|
|
||||||
echo '-'
|
|
||||||
}
|
|
||||||
|
|
||||||
postInstall() {
|
postInstall() {
|
||||||
echo '-'
|
echo "cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/"
|
||||||
echo "cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/"
|
cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/
|
||||||
cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/
|
|
||||||
}
|
|
||||||
|
|
||||||
patchPhase() {
|
|
||||||
echo '-'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
genericBuild
|
genericBuild
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
{ stdenv, fetchurl, noSysDirs
|
{ stdenv, fetchurl, noSysDirs
|
||||||
, langC ? true, langCC ? true, langObjC ? true, langF77 ? false
|
, langCC ? true, langObjC ? true, langF77 ? false
|
||||||
, profiledCompiler ? false
|
, profiledCompiler ? false
|
||||||
, gmp ? null, mpfr ? null, bison ? null, flex ? null
|
, gmp ? null, mpfr ? null, bison ? null, flex ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert langC;
|
|
||||||
assert stdenv.isDarwin;
|
assert stdenv.isDarwin;
|
||||||
assert langF77 -> gmp != null;
|
assert langF77 -> gmp != null;
|
||||||
|
|
||||||
@ -12,27 +11,34 @@ let
|
|||||||
version = "4.2.1"; # Upstream GCC version, from `gcc/BASE-VER'.
|
version = "4.2.1"; # Upstream GCC version, from `gcc/BASE-VER'.
|
||||||
revision = "5666.3"; # Apple's fork revision number.
|
revision = "5666.3"; # Apple's fork revision number.
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation ({
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
name = "gcc-apple-${version}.${revision}";
|
name = "gcc-apple-${version}.${revision}";
|
||||||
|
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
|
||||||
src =
|
src =
|
||||||
stdenv.lib.optional /*langC*/ true (fetchurl {
|
stdenv.lib.optional true (fetchurl {
|
||||||
url = "http://www.opensource.apple.com/tarballs/gcc/gcc-${revision}.tar.gz";
|
url = "http://www.opensource.apple.com/tarballs/gcc/gcc-${revision}.tar.gz";
|
||||||
sha256 = "0nq1szgqx9ryh1qsn5n6yd55gpvf56wr8f7w1jzabb8idlvz8ikc";
|
sha256 = "0nq1szgqx9ryh1qsn5n6yd55gpvf56wr8f7w1jzabb8idlvz8ikc";
|
||||||
}) ++
|
}) ++
|
||||||
stdenv.lib.optional langCC (fetchurl {
|
stdenv.lib.optional langCC (fetchurl {
|
||||||
url = http://www.opensource.apple.com/tarballs/libstdcxx/libstdcxx-39.tar.gz ;
|
url = http://www.opensource.apple.com/tarballs/libstdcxx/libstdcxx-39.tar.gz;
|
||||||
sha256 = "ccf4cf432c142778c766affbbf66b61001b6c4f1107bc2b2c77ce45598786b6d";
|
sha256 = "ccf4cf432c142778c766affbbf66b61001b6c4f1107bc2b2c77ce45598786b6d";
|
||||||
}) ;
|
});
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
libstdcxx = "libstdcxx-39";
|
libstdcxx = "libstdcxx-39";
|
||||||
|
|
||||||
sourceRoot = "gcc-${revision}/";
|
sourceRoot = "gcc-${revision}/";
|
||||||
|
|
||||||
patches =
|
patches =
|
||||||
[./pass-cxxcpp.patch ]
|
[ ./pass-cxxcpp.patch ./fix-libstdc++-link.patch ]
|
||||||
++ (if noSysDirs then [./no-sys-dirs.patch] else []);
|
++ stdenv.lib.optional noSysDirs [ ./no-sys-dirs.patch ];
|
||||||
inherit noSysDirs langC langCC langF77 langObjC profiledCompiler;
|
|
||||||
} // (if langF77 then {buildInputs = [gmp mpfr bison flex];} else {}))
|
inherit noSysDirs langCC langF77 langObjC;
|
||||||
|
langC = true;
|
||||||
|
|
||||||
|
buildInputs = stdenv.lib.optionals langF77 [ gmp mpfr bison flex ];
|
||||||
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
Prevent our libstdc++.dylib from having a runtime dependency on
|
||||||
|
/usr/lib/libstdc++.dylib. This is caused by the implicit -lstdc++
|
||||||
|
passed by g++ when it links libstdc++.dylib. Adding "-nostdlib" to
|
||||||
|
the g++ invocation prevents this.
|
||||||
|
|
||||||
|
diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstdcxx-39/libstdcxx/libstdc++-v3/src/Makefile.in
|
||||||
|
--- x/libstdcxx/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
|
||||||
|
+++ y/libstdcxx/libstdc++-v3/src/Makefile.in 2012-02-17 18:44:05.210570590 +0100
|
||||||
|
@@ -388,7 +388,7 @@
|
||||||
|
|
||||||
|
libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
|
||||||
|
libstdc___la_LDFLAGS = \
|
||||||
|
- -version-info $(libtool_VERSION) ${version_arg} -lm
|
||||||
|
+ -version-info $(libtool_VERSION) ${version_arg} -lm -Wc,-nostdlib
|
||||||
|
|
||||||
|
|
||||||
|
# Use special rules for the deprecated source files so that they find
|
Loading…
Reference in New Issue
Block a user