···46 "-DLIBCXX_ENABLE_THREADS=OFF"
47 "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
48 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
49+ ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"
50+51+ # TODO: this is a bit of a hack to cross compile to Apple Silicon. libcxx
52+ # starting with 11 enables CMAKE_BUILD_WITH_INSTALL_NAME_DIR which requires
53+ # platform setup for rpaths. In cmake, this is enabled when macos is newer
54+ # than 10.5. However CMAKE_SYSTEM_VERSION is set to empty (TODO: why?)
55+ # which prevents the conditional configuration, and configure fails. The
56+ # value here corresponds to `uname -r`. If stdenv.hostPlatform.release is
57+ # not null, then this property will be set via mkDerivation (TODO: how can
58+ # we set this?).
59+ ++ lib.optional (
60+ stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 &&
61+ stdenv.hostPlatform != stdenv.buildPlatform
62+ ) "-DCMAKE_SYSTEM_VERSION=20.1.0";
6364 passthru = {
65 isLLVM = true;
···48 # the magic combination of necessary CMake variables
49 # if you fancy a try, take a look at
50 # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
51- install_name_tool -id $out/$file $file
52 done
53 make install
54 install -d 755 $out/include
···48 # the magic combination of necessary CMake variables
49 # if you fancy a try, take a look at
50 # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
51+ ${stdenv.cc.targetPrefix}install_name_tool -id $out/$file $file
52 done
53 make install
54 install -d 755 $out/include
+1
pkgs/top-level/all-packages.nix
···14848 inherit (stdenv.targetPlatform) libc;
14849 in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
14850 else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers
014851 else null;
1485214853 # We can choose:
···14848 inherit (stdenv.targetPlatform) libc;
14849 in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
14850 else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers
14851+ else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross
14852 else null;
1485314854 # We can choose: