Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ stdenv.mkDerivation {
--replace "#include <stdlib.h>" ""
substituteInPlace lib/builtins/clear_cache.c \
--replace "#include <assert.h>" ""
substituteInPlace lib/builtins/cpu_model.c \
substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast version "18") "/x86"}.c \
--replace "#include <assert.h>" ""
'';

Expand Down
9 changes: 2 additions & 7 deletions pkgs/development/compilers/llvm/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@
else pkgs.bintools
, darwin
# LLVM release information; specify one of these but not both:
, gitRelease ? {
version = "18.0.0";
rev = "2fd7657b6609454af7adb75765d164ec7d1bb80b";
rev-version = "18.0.0-unstable-2023-12-13";
sha256 = "sha256-/sMQzzFid0tAnreOIV9SUm2H6QbEGhpNcizl3LDPM5s=";
}
, gitRelease ? null
# i.e.:
# {
# version = /* i.e. "15.0.0" */;
# rev = /* commit SHA */;
# rev-version = /* human readable version; i.e. "unstable-2022-26-07" */;
# sha256 = /* checksum for this release, can omit if specifying your own `monorepoSrc` */;
# }
, officialRelease ? null
, officialRelease ? { version = "18.1.0-rc3"; sha256 = "sha256-qRzY2kTLeRxXQCSuVP592Awafm5wjVeFY60d6082mSc="; }
# i.e.:
# {
# version = /* i.e. "15.0.0" */;
Expand Down
15 changes: 3 additions & 12 deletions pkgs/development/compilers/llvm/git/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ stdenv.mkDerivation rec {
chmod -R u+w .
'';

patches = [
# fix for https://github.com/NixOS/nixpkgs/issues/269548
# https://github.com/llvm/llvm-project/pull/77218
(fetchpatch {
name = "darwin-system-libcxxabi-link-flags.patch";
url = "https://github.com/llvm/llvm-project/commit/c5b89b29ee6e3c444a355fd1cf733ce7ab2e316a.patch";
hash = "sha256-LNoPg1KCoP8RWxU/AzHR52f4Dww24I9BGQJedMhFxyQ=";
relative = "libcxx";
})
];

postPatch = ''
cd ../runtimes
'';
Expand All @@ -82,7 +71,9 @@ stdenv.mkDerivation rec {
"-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}"
] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1"
++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
++ lib.optionals (lib.versionAtLeast version "18" && !(stdenv.hostPlatform.useLLVM or false) && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic) [
"-DLIBCXX_ADDITIONAL_LIBRARIES=gcc_s"
] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
"-DLIBCXX_USE_COMPILER_RT=ON"
# There's precedent for this in llvm-project/libcxx/cmake/caches.
# In a monorepo build you might do the following in the libcxxabi build:
Expand Down
16 changes: 16 additions & 0 deletions pkgs/development/compilers/llvm/git/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ stdenv.mkDerivation rec {
sha256 = "1xyjd56m4pfwq8p3xh6i8lhkk9kq15jaml7qbhxdf87z4jjkk63a";
stripLen = 1;
})
] ++ lib.optionals (lib.versionAtLeast version "18") [
# Allow building libcxxabi alone when using LLVM unwinder
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/77610dd10454e87bb387040d2b51100a17ac5755.patch";
stripLen = 1;
revert = true;
hash = "sha256-Jogx/cvTJ6fdyprTD1QzMIeRWcBlZZMWE/y9joOtVH0=";
})
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/48e5b5ea92674ded69b998cf35724d9012c0f57d.patch";
stripLen = 1;
revert = true;
hash = "sha256-7VeBFjG7CnEMWn0hpBvyNOyhRfz50PnD3zyQNDhNChk=";
})
];

postPatch = ''
Expand All @@ -63,6 +77,8 @@ stdenv.mkDerivation rec {
# CMake however checks for this anyways; this flag tells it not to. See:
# https://github.com/llvm/llvm-project/blob/4bd3f3759259548e159aeba5c76efb9a0864e6fa/llvm/runtimes/CMakeLists.txt#L243
"-DCMAKE_CXX_COMPILER_WORKS=ON"
] ++ lib.optionals (lib.versionAtLeast version "18" && !(stdenv.hostPlatform.useLLVM or false && !stdenv.hostPlatform.isWasm)) [
"-DLIBCXXABI_USE_LLVM_UNWINDER=OFF"
] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false && !stdenv.hostPlatform.isWasm) [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macr
index 518a09b45a42..bd9d6f5542ad 100644
--- a/tools/polly/cmake/polly_macros.cmake
+++ b/tools/polly/cmake/polly_macros.cmake
@@ -44,8 +44,8 @@ macro(add_polly_library name)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly")
@@ -45,8 +45,8 @@ macro(add_polly_library name)
install(TARGETS ${name}
COMPONENT ${name}
EXPORT LLVMExports
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
add_llvm_install_targets(install-${name}
COMPONENT ${name})
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
endmacro(add_polly_library)
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ index b6ddbe90516d..311ab1d50e7f 100644
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
"Suffix of lib installation directory, e.g. 64 => lib64")
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}" CACHE STRING
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}" CACHE STRING
"Path where built OpenMP libraries should be installed.")

# Group test settings.
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD)
@@ -47,7 +47,7 @@ if (OPENMP_STANDALONE_BUILD)
else()
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# If building in tree, we honor the same install suffix LLVM uses.
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Path where built OpenMP libraries should be installed.")

if (NOT MSVC)
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)