Unverified Commit e2a9e8c4 authored by Tristan Ross's avatar Tristan Ross
Browse files

llvmPackages_git: update to 19.0.0-unstable-2024-03-16

parent aac3118a
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -70,9 +70,6 @@ let
    postInstall = ''
      ln -sv $out/bin/clang $out/bin/cpp

      mkdir -p $lib/lib/clang
      mv $lib/lib/${lib.versions.major version} $lib/lib/clang/${lib.versions.major version}

      # Move libclang to 'lib' output
      moveToOutput "lib/libclang.*" "$lib"
      moveToOutput "lib/libclang-cpp.*" "$lib"
+1 −28
Original line number Diff line number Diff line
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7936d72e088..a362fa49b534 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,21 @@ if(CLANG_BUILT_STANDALONE)
   find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
   list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
 
-  # Turn into CACHE PATHs for overwritting
+  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
+  # LLVM_CONFIG.
+  if (NOT LLVM_CONFIG_FOUND)
+    # Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
+    # path is removed.
+    set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
+    set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
+    # N.B. this is just a default value, the CACHE PATHs below can be overriden.
+    set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
+    set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
+    set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
+  else()
+    set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
+  endif()
+
   set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
   set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
index 75b0080f6715..c895b884cd27 100644
--- a/cmake/modules/AddClang.cmake
@@ -48,7 +21,7 @@ index f2b0c5cddcbb..52f37fc368ce 100644
 add_header_target("utility-resource-headers" ${utility_files})
 
 get_clang_resource_dir(header_install_dir SUBDIR include)
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${CLANG_VERSION_MAJOR}/include)
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include)
 
 #############################################################
 # Install rules for the catch-all clang-resource-headers target
+2 −3
Original line number Diff line number Diff line
@@ -87,12 +87,9 @@ stdenv.mkDerivation {

  patches = [
    ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config
    ./gnu-install-dirs.patch
    # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
    # extra `/`.
    ./normalize-var.patch
    # Prevent a compilation error on darwin
    ./darwin-targetconditionals.patch
    # See: https://github.com/NixOS/nixpkgs/pull/186575
    ../../common/compiler-rt/darwin-plistbuddy-workaround.patch
    # See: https://github.com/NixOS/nixpkgs/pull/194634#discussion_r999829893
@@ -111,6 +108,8 @@ stdenv.mkDerivation {
    substituteInPlace cmake/config-ix.cmake \
      --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
  '' + lib.optionalString (useLLVM && !haveLibc) ''
    substituteInPlace lib/builtins/aarch64/sme-libc-routines.c \
      --replace "<stdlib.h>" "<stddef.h>"
    substituteInPlace lib/builtins/int_util.c \
      --replace "#include <stdlib.h>" ""
    substituteInPlace lib/builtins/clear_cache.c \
+0 −20
Original line number Diff line number Diff line
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
index 8a6219568b3f..30ee68a47ccf 100644
--- a/cmake/base-config-ix.cmake
+++ b/cmake/base-config-ix.cmake
@@ -100,13 +100,13 @@ endif()
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
   set(COMPILER_RT_OUTPUT_LIBRARY_DIR
     ${COMPILER_RT_OUTPUT_DIR}/lib)
-  extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib)
+  extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}")
   set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
     "Path where built compiler-rt libraries should be installed.")
 else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
   set(COMPILER_RT_OUTPUT_LIBRARY_DIR
     ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-  extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}")
+  extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}")
   set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
     "Path where built compiler-rt libraries should be installed.")
 endif()
+8 −3
Original line number Diff line number Diff line
@@ -17,15 +17,20 @@
    else pkgs.bintools
, darwin
# LLVM release information; specify one of these but not both:
, gitRelease ? null
, gitRelease ? {
    version = "19.0.0-git";
    rev = "65058a8d732c3c41664a4dad1a1ae2a504d5c98e";
    rev-version = "19.0.0-unstable-2024-03-16";
    sha256 = "sha256-xV33kx/8OZ2KLtaz25RmudDrlIX7nScauTykf87jyTE=";
}
  # i.e.:
  # {
  #   version = /* i.e. "15.0.0" */;
  #   rev = /* commit SHA */;
  #   rev-version = /* human readable version; i.e. "unstable-2022-26-07" */;
  #   rev-version = /* human readable version; i.e. "15.0.0-unstable-2022-07-26" */;
  #   sha256 = /* checksum for this release, can omit if specifying your own `monorepoSrc` */;
  # }
, officialRelease ? { version = "18.1.0-rc4"; sha256 = "sha256-fVpwewbjoPMPslIEZ+WAtaQ+YKc0XWGl8EbP/TbQb8o="; }
, officialRelease ? null
  # i.e.:
  # {
  #   version = /* i.e. "15.0.0" */;
Loading