libc++: Fix /usr/lib references

The install name and libc++abi reexport were pointing to /usr/lib,
preventing our libc++ from being used at runtime.
This commit is contained in:
Eelco Dolstra 2014-09-24 14:43:05 +02:00
parent 43424d9028
commit be330c47eb
2 changed files with 40 additions and 5 deletions

View file

@ -0,0 +1,30 @@
diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
--- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100
+++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200
@@ -56,7 +56,7 @@
"-compatibility_version 1"
"-current_version ${LIBCXX_VERSION}"
"-install_name /usr/lib/libc++.1.dylib"
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
"/usr/lib/libSystem.B.dylib")
else()
@@ -64,14 +64,14 @@
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
if (OSX_HAS_ARMV7)
set(OSX_RE_EXPORT_LINE
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
else()
set(OSX_RE_EXPORT_LINE
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
endif()
else()
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
endif()
list(APPEND link_flags

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, cmake, libcxxabi }:
{ lib, stdenv, fetchurl, cmake, libcxxabi, fixDarwinDylibNames }:
let version = "3.4.2"; in
@ -10,11 +10,16 @@ stdenv.mkDerivation rec {
sha256 = "0z3jdvgcq995khkpis5c5vaxhbmvbqjlalbhn09k6pgb5zp46rc2";
};
buildInputs = [ cmake libcxxabi ];
patches = [ ./darwin.patch ];
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release"
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
"-DLIBCXX_CXX_ABI=libcxxabi" ];
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags =
[ "-DCMAKE_BUILD_TYPE=Release"
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
enableParallelBuilding = true;