9a979af1d3
In 3.3, a C++ class defined in a header will get a typeinfo symbol like this (e.g. in Nix's src/libutil/util.o): (__DATA,__datacoal_nt) weak external typeinfo for nix::BaseError But in 3.4, this has changed to: (__DATA,__datacoal_nt) weak external automatically hidden typeinfo for nix::BaseError This causes the linker to change the symbol to: (__DATA,__data) non-external (was signed char private external) typeinfo for nix::BaseError i.e. losing its weak linkage. But without weak linkage, dynamic_cast and other RTTI-based mechanisms (such as catching an exception of a certain type) don't work across shared libraries / executables. The clang compiler in the SDK doesn't have this behaviour, but it's not clear exactly which version it is (it just says "based on LLVM 3.4svn").
50 lines
1.5 KiB
Nix
50 lines
1.5 KiB
Nix
{ stdenv, pkgs, config
|
|
, haveLibCxx ? true
|
|
, useClang33 ? true }:
|
|
|
|
import ../generic rec {
|
|
inherit config;
|
|
|
|
preHook =
|
|
''
|
|
export NIX_ENFORCE_PURITY=
|
|
export NIX_IGNORE_LD_THROUGH_GCC=1
|
|
export NIX_DONT_SET_RPATH=1
|
|
export NIX_NO_SELF_RPATH=1
|
|
dontFixLibtool=1
|
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
|
xargsFlags=" "
|
|
export MACOSX_DEPLOYMENT_TARGET=10.6
|
|
export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true)
|
|
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
|
|
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib"
|
|
'';
|
|
|
|
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
|
|
|
|
system = stdenv.system;
|
|
|
|
gcc = import ../../build-support/gcc-wrapper {
|
|
nativeTools = false;
|
|
nativeLibc = true;
|
|
inherit stdenv;
|
|
extraPackages = stdenv.lib.optional haveLibCxx pkgs.libcxx;
|
|
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
|
|
gcc = if useClang33 then pkgs.clang_33.gcc else pkgs.clang.gcc;
|
|
coreutils = pkgs.coreutils;
|
|
shell = pkgs.bash + "/bin/sh";
|
|
};
|
|
|
|
shell = pkgs.bash + "/bin/sh";
|
|
|
|
fetchurlBoot = stdenv.fetchurlBoot;
|
|
|
|
overrides = pkgs_: {
|
|
inherit gcc;
|
|
inherit (gcc) binutils;
|
|
inherit (pkgs)
|
|
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
|
gnumake gnused gnutar gnugrep gnupatch perl libcxx libcxxabi;
|
|
};
|
|
}
|