diff options
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/8')
6 files changed, 27 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix index 2d7fc8068900..5c1dca5e33b1 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix @@ -20,10 +20,10 @@ let ''; nativeBuildInputs = [ cmake python3 ] - ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx; + ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx + ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm lld ] - ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; + buildInputs = [ libxml2 llvm lld ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix index a907d4086550..3c6265c4fca0 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix @@ -41,6 +41,11 @@ stdenv.mkDerivation { "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ stdenv.lib.optionals (bareMetal) [ "-DCOMPILER_RT_OS_DIR=baremetal" + ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [ + # The compiler-rt build infrastructure sniffs supported platforms on Darwin + # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails + # when it tries to use libc++ and libc++api for i386. + "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}" ]; outputs = [ "out" "dev" ]; diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix index 9c0c7951c794..2ed54a22069b 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; @@ -25,9 +26,10 @@ stdenv.mkDerivation { patchShebangs utils/cat_files.py ''; nativeBuildInputs = [ cmake ] - ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3; + ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3 + ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; + buildInputs = [ libcxxabi ]; cmakeFlags = [ "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib" diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix index 590872aaab64..50a38dfa967b 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix @@ -1,5 +1,6 @@ { stdenv, cmake, fetch, libcxx, libunwind, llvm, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix index 646cd3c3ca4a..3295d3922034 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix @@ -1,4 +1,6 @@ -{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: +{ stdenv, version, fetch, cmake, fetchpatch +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libunwind"; diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix index 0f6179c2d310..fb928b67ad54 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix @@ -1,5 +1,6 @@ { stdenv , fetch +, fetchpatch , cmake , python3 , libffi @@ -55,6 +56,14 @@ in stdenv.mkDerivation ({ propagatedBuildInputs = [ ncurses zlib ]; + patches = [ + # Fix missing includes for GCC 10 + (fetchpatch { + url = "https://bugs.gentoo.org/attachment.cgi?id=612792"; + sha256 = "0rwx6jpqq4xnf4mvfm8v2d4r34y1yi05am0mx5k2d5bha9j64lqg"; + }) + ]; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ |