diff --git a/pkgs/development/compilers/llvm/3.5/libc++/default.nix b/pkgs/development/compilers/llvm/3.5/libc++/default.nix index abc198b06864..1f1129f578f4 100644 --- a/pkgs/development/compilers/llvm/3.5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.5/libc++/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { '"${libcxxabi}/lib/libc++abi.dylib"' ''; - patches = [ ./darwin.patch ]; + patches = [ + ./darwin.patch + # glibc 2.26 fix + ./xlocale-glibc-2.26.patch + ]; buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; diff --git a/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch new file mode 100644 index 000000000000..250bb49fc231 --- /dev/null +++ b/pkgs/development/compilers/llvm/3.5/libc++/xlocale-glibc-2.26.patch @@ -0,0 +1,17 @@ +diff --git a/include/__locale b/include/__locale +index 3daa1f1..cb8e151 100644 +--- a/include/__locale ++++ b/include/__locale +@@ -29,10 +29,10 @@ + # if __ANDROID_API__ <= 20 + # include + # endif +-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ ++#elif (defined(__APPLE__) || defined(__FreeBSD__) \ + || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) + # include +-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ ++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + #pragma GCC system_header diff --git a/pkgs/development/compilers/llvm/3.7/libc++/default.nix b/pkgs/development/compilers/llvm/3.7/libc++/default.nix index 69ce87bcbf30..4296c0fd192c 100644 --- a/pkgs/development/compilers/llvm/3.7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.7/libc++/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { patches = [ ./darwin.patch ./r242056.patch + # glibc 2.26 fix + ./xlocale-glibc-2.26.patch ]; buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; diff --git a/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch new file mode 100644 index 000000000000..5ee8f6b82305 --- /dev/null +++ b/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch @@ -0,0 +1,17 @@ +diff --git a/include/__locale b/include/__locale +index 1989558..1e42905 100644 +--- a/include/__locale ++++ b/include/__locale +@@ -34,10 +34,10 @@ + # include + #elif defined(_NEWLIB_VERSION) + # include +-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ ++#elif (defined(__APPLE__) || defined(__FreeBSD__) \ + || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) + # include +-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ ++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + #pragma GCC system_header diff --git a/pkgs/development/compilers/llvm/3.8/libc++/default.nix b/pkgs/development/compilers/llvm/3.8/libc++/default.nix index e4198599904c..ea468b3772e0 100644 --- a/pkgs/development/compilers/llvm/3.8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.8/libc++/default.nix @@ -14,7 +14,10 @@ stdenv.mkDerivation rec { cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include") ''; - patches = lib.optional stdenv.isDarwin ./darwin.patch; + patches = [ + # glibc 2.26 fix + ../../3.9/libc++/xlocale-glibc-2.26.patch + ] ++ lib.optional stdenv.isDarwin ./darwin.patch; buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; diff --git a/pkgs/development/compilers/llvm/3.9/libc++/default.nix b/pkgs/development/compilers/llvm/3.9/libc++/default.nix index f656f553f16b..ad514b0daa54 100644 --- a/pkgs/development/compilers/llvm/3.9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.9/libc++/default.nix @@ -14,7 +14,10 @@ stdenv.mkDerivation rec { cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include") ''; - patches = lib.optional stdenv.isDarwin ./darwin.patch; + patches = [ + # glibc 2.26 fix + ./xlocale-glibc-2.26.patch + ] ++ lib.optional stdenv.isDarwin ./darwin.patch; buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; diff --git a/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch new file mode 100644 index 000000000000..4cc042554c85 --- /dev/null +++ b/pkgs/development/compilers/llvm/3.9/libc++/xlocale-glibc-2.26.patch @@ -0,0 +1,19 @@ +diff --git a/include/__locale b/include/__locale +index 7bc701d..ea75c86 100644 +--- a/include/__locale ++++ b/include/__locale +@@ -34,12 +34,12 @@ + # include + #elif defined(_NEWLIB_VERSION) + # include +-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ ++#elif (defined(__APPLE__) || defined(__FreeBSD__) \ + || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) + # include + #elif defined(_LIBCPP_HAS_MUSL_LIBC) + # include +-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ ++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + #pragma GCC system_header diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix index b74d2fb89dcd..db751bcffd42 100644 --- a/pkgs/development/compilers/llvm/4/libc++/default.nix +++ b/pkgs/development/compilers/llvm/4/libc++/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - # https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc - patches = [ ./pthread_mach_thread_np.patch ]; + patches = [ + # https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc + ./pthread_mach_thread_np.patch + # glibc 2.26 fix + ./xlocale-glibc-2.26.patch + ]; prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" diff --git a/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch new file mode 100644 index 000000000000..e411d85066b4 --- /dev/null +++ b/pkgs/development/compilers/llvm/4/libc++/xlocale-glibc-2.26.patch @@ -0,0 +1,19 @@ +diff --git a/include/__locale b/include/__locale +index f4882de..29443b4 100644 +--- a/include/__locale ++++ b/include/__locale +@@ -34,12 +34,12 @@ + # include + #elif defined(_NEWLIB_VERSION) + # include +-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ ++#elif (defined(__APPLE__) || defined(__FreeBSD__) \ + || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) + # include + #elif defined(_LIBCPP_HAS_MUSL_LIBC) + # include +-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ ++#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + #pragma GCC system_header