llvmPackages_17: drop

Emily 2dac87bb a892ce39

+1 -1
doc/release-notes/rl-2511.section.md
···
- GCC 9, 10, 11, and 12 have been removed, as they have reached end‐of‐life upstream and are no longer supported.
-
- LLVM 12, 13, 14, 15, and 16 have been removed, as they have reached end‐of‐life upstream and are no longer supported.
+
- LLVM 12, 13, 14, 15, 16, and 17 have been removed, as they have reached end‐of‐life upstream and are no longer supported.
- GHCJS 8.10, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS.
-39
pkgs/development/compilers/llvm/17/clang/aarch64-tblgen.patch
···
-
diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def
-
index ef0dad0f2..afd101b00 100644
-
--- a/include/clang/Basic/TokenKinds.def
-
+++ b/include/clang/Basic/TokenKinds.def
-
@@ -753,7 +753,7 @@ KEYWORD(__builtin_sycl_unique_stable_name, KEYSYCL)
-
-
// Keywords defined by Attr.td.
-
#ifndef KEYWORD_ATTRIBUTE
-
-#define KEYWORD_ATTRIBUTE(X) KEYWORD(X, KEYALL)
-
+#define KEYWORD_ATTRIBUTE(X, EMPTY) KEYWORD(EMPTY ## X, KEYALL)
-
#endif
-
#include "clang/Basic/AttrTokenKinds.inc"
-
-
diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h
-
index e4857405b..ff117bd5a 100644
-
--- a/include/clang/Basic/TokenKinds.h
-
+++ b/include/clang/Basic/TokenKinds.h
-
@@ -109,7 +109,7 @@ bool isPragmaAnnotation(TokenKind K);
-
-
inline constexpr bool isRegularKeywordAttribute(TokenKind K) {
-
return (false
-
-#define KEYWORD_ATTRIBUTE(X) || (K == tok::kw_##X)
-
+#define KEYWORD_ATTRIBUTE(X, ...) || (K == tok::kw_##X)
-
#include "clang/Basic/AttrTokenKinds.inc"
-
);
-
}
-
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
-
index b5813c6ab..79db17501 100644
-
--- a/utils/TableGen/ClangAttrEmitter.cpp
-
+++ b/utils/TableGen/ClangAttrEmitter.cpp
-
@@ -3430,7 +3430,7 @@ void EmitClangAttrTokenKinds(RecordKeeper &Records, raw_ostream &OS) {
-
"RegularKeyword attributes with arguments are not "
-
"yet supported");
-
OS << "KEYWORD_ATTRIBUTE("
-
- << S.getSpellingRecord().getValueAsString("Name") << ")\n";
-
+ << S.getSpellingRecord().getValueAsString("Name") << ", )\n";
-
}
-
OS << "#undef KEYWORD_ATTRIBUTE\n";
-
}
-98
pkgs/development/compilers/llvm/17/clang/gnu-install-dirs.patch
···
-
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
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -119,8 +119,8 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (NOT LLVM_ENABLE_IDE)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index f2b0c5cddcbb..52f37fc368ce 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -473,6 +473,7 @@ add_header_target("windows-resource-headers" ${windows_only_files})
-
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)
-
-
#############################################################
-
# Install rules for the catch-all clang-resource-headers target
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 4f23065a2472..6a0f55991e24 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -234,7 +234,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-
diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt
-
index 3aca22c0b0a8..3115353e3fe3 100644
-
--- a/tools/scan-build-py/CMakeLists.txt
-
+++ b/tools/scan-build-py/CMakeLists.txt
-
@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
-
install(FILES lib/libscanbuild/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
-
install(FILES lib/libscanbuild/resources/${resource}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -122,7 +122,7 @@ foreach(lib ${LibEar})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
-
install(FILES lib/libear/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear"
-
COMPONENT scan-build-py)
-
endforeach()
-
-29
pkgs/development/compilers/llvm/17/clang/purity.patch
···
-
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Thu, 18 May 2017 11:56:12 -0500
-
Subject: [PATCH] "purity" patch for 5.0
-
-
---
-
lib/Driver/ToolChains/Gnu.cpp | 7 -------
-
1 file changed, 7 deletions(-)
-
-
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
-
index fe3c0191bb..c6a482bece 100644
-
--- a/lib/Driver/ToolChains/Gnu.cpp
-
+++ b/lib/Driver/ToolChains/Gnu.cpp
-
@@ -487,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
-
} else {
-
if (Args.hasArg(options::OPT_rdynamic))
-
CmdArgs.push_back("-export-dynamic");
-
-
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE &&
-
- !Args.hasArg(options::OPT_r)) {
-
- CmdArgs.push_back("-dynamic-linker");
-
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
-
- ToolChain.getDynamicLinker(Args)));
-
- }
-
}
-
-
CmdArgs.push_back("-o");
-
--
-
2.11.0
pkgs/development/compilers/llvm/17/compiler-rt/X86-support-extension.patch pkgs/development/compilers/llvm/18/compiler-rt/X86-support-extension.patch
pkgs/development/compilers/llvm/17/compiler-rt/armv6-scudo-libatomic.patch pkgs/development/compilers/llvm/18/compiler-rt/armv6-scudo-libatomic.patch
-71
pkgs/development/compilers/llvm/17/compiler-rt/darwin-targetconditionals.patch
···
-
diff --git a/lib/sanitizer_common/sanitizer_mac.cpp b/lib/sanitizer_common/sanitizer_mac.cpp
-
--- a/lib/sanitizer_common/sanitizer_mac.cpp
-
+++ b/lib/sanitizer_common/sanitizer_mac.cpp
-
@@ -613,9 +613,15 @@ HandleSignalMode GetHandleSignalMode(int signum) {
-
// Offset example:
-
// XNU 17 -- macOS 10.13 -- iOS 11 -- tvOS 11 -- watchOS 4
-
constexpr u16 GetOSMajorKernelOffset() {
-
- if (TARGET_OS_OSX) return 4;
-
- if (TARGET_OS_IOS || TARGET_OS_TV) return 6;
-
- if (TARGET_OS_WATCH) return 13;
-
+#if TARGET_OS_OSX
-
+ return 4;
-
+#endif
-
+#if TARGET_OS_IOS || TARGET_OS_TV
-
+ return 6;
-
+#endif
-
+#if TARGET_OS_WATCH
-
+ return 13;
-
+#endif
-
}
-
-
using VersStr = char[64];
-
@@ -627,13 +633,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) {
-
u16 os_major = kernel_major - offset;
-
-
const char *format = "%d.0";
-
- if (TARGET_OS_OSX) {
-
- if (os_major >= 16) { // macOS 11+
-
- os_major -= 5;
-
- } else { // macOS 10.15 and below
-
- format = "10.%d";
-
- }
-
+#if TARGET_OS_OSX
-
+ if (os_major >= 16) { // macOS 11+
-
+ os_major -= 5;
-
+ } else { // macOS 10.15 and below
-
+ format = "10.%d";
-
}
-
+#endif
-
return internal_snprintf(vers, sizeof(VersStr), format, os_major);
-
}
-
-
@@ -681,15 +687,14 @@ void ParseVersion(const char *vers, u16 *major, u16 *minor) {
-
// Aligned versions example:
-
// macOS 10.15 -- iOS 13 -- tvOS 13 -- watchOS 6
-
static void MapToMacos(u16 *major, u16 *minor) {
-
- if (TARGET_OS_OSX)
-
- return;
-
-
-
- if (TARGET_OS_IOS || TARGET_OS_TV)
-
+#if !TARGET_OS_OSX
-
+#if TARGET_OS_IOS || TARGET_OS_TV
-
*major += 2;
-
- else if (TARGET_OS_WATCH)
-
+#elif TARGET_OS_WATCH
-
*major += 9;
-
- else
-
+#else
-
UNREACHABLE("unsupported platform");
-
+#endif
-
-
if (*major >= 16) { // macOS 11+
-
*major -= 5;
-
@@ -697,6 +702,7 @@ static void MapToMacos(u16 *major, u16 *minor) {
-
*minor = *major;
-
*major = 10;
-
}
-
+#endif
-
}
-
-
static MacosVersion GetMacosAlignedVersionInternal() {
-20
pkgs/development/compilers/llvm/17/compiler-rt/gnu-install-dirs.patch
···
-
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()
pkgs/development/compilers/llvm/17/compiler-rt/normalize-var.patch pkgs/development/compilers/llvm/18/compiler-rt/normalize-var.patch
pkgs/development/compilers/llvm/17/libclc/gnu-install-dirs.patch pkgs/development/compilers/llvm/18/libclc/gnu-install-dirs.patch
-190
pkgs/development/compilers/llvm/17/lld/add-table-base.patch
···
-
From 93adcb770b99351b18553089c164fe3ef2119699 Mon Sep 17 00:00:00 2001
-
From: Sam Clegg <sbc@chromium.org>
-
Date: Fri, 25 Aug 2023 13:56:16 -0700
-
Subject: [PATCH] [lld][WebAssembly] Add `--table-base` setting
-
-
This is similar to `--global-base` but determines where to place the
-
table segments rather than that data segments.
-
-
See https://github.com/emscripten-core/emscripten/issues/20097
-
-
Differential Revision: https://reviews.llvm.org/D158892
-
---
-
test/wasm/table-base.s | 72 ++++++++++++++++++++++++++++++++++++++
-
wasm/Driver.cpp | 19 ++++++++--
-
wasm/Options.td | 5 ++-
-
wasm/Writer.cpp | 8 -----
-
4 files changed, 93 insertions(+), 11 deletions(-)
-
create mode 100644 test/wasm/table-base.s
-
-
diff --git a/test/wasm/table-base.s b/test/wasm/table-base.s
-
new file mode 100644
-
index 000000000000000..56fff414fd31d96
-
--- /dev/null
-
+++ b/test/wasm/table-base.s
-
@@ -0,0 +1,72 @@
-
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
-
+
-
+# RUN: wasm-ld --export=__table_base -o %t.wasm %t.o
-
+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-DEFAULT
-
+
-
+# RUN: wasm-ld --table-base=100 --export=__table_base -o %t.wasm %t.o
-
+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-100
-
+
-
+.globl _start
-
+_start:
-
+ .functype _start () -> ()
-
+ i32.const _start
-
+ drop
-
+ end_function
-
+
-
+# CHECK-DEFAULT: - Type: TABLE
-
+# CHECK-DEFAULT-NEXT: Tables:
-
+# CHECK-DEFAULT-NEXT: - Index: 0
-
+# CHECK-DEFAULT-NEXT: ElemType: FUNCREF
-
+# CHECK-DEFAULT-NEXT: Limits:
-
+# CHECK-DEFAULT-NEXT: Flags: [ HAS_MAX ]
-
+# CHECK-DEFAULT-NEXT: Minimum: 0x2
-
+# CHECK-DEFAULT-NEXT: Maximum: 0x2
-
+
-
+# CHECK-DEFAULT: - Type: GLOBAL
-
+# CHECK-DEFAULT-NEXT: Globals:
-
+# CHECK-DEFAULT-NEXT: - Index: 0
-
+# CHECK-DEFAULT-NEXT: Type: I32
-
+# CHECK-DEFAULT-NEXT: Mutable: true
-
+# CHECK-DEFAULT-NEXT: InitExpr:
-
+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST
-
+# CHECK-DEFAULT-NEXT: Value: 66560
-
+# CHECK-DEFAULT-NEXT: - Index: 1
-
+# CHECK-DEFAULT-NEXT: Type: I32
-
+# CHECK-DEFAULT-NEXT: Mutable: false
-
+# CHECK-DEFAULT-NEXT: InitExpr:
-
+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST
-
+# CHECK-DEFAULT-NEXT: Value: 1
-
+
-
+# CHECK-DEFAULT: - Type: EXPORT
-
+# CHECK-DEFAULT: - Name: __table_base
-
+# CHECK-DEFAULT-NEXT: Kind: GLOBAL
-
+# CHECK-DEFAULT-NEXT: Index: 1
-
+
-
+# CHECK-100: - Type: TABLE
-
+# CHECK-100-NEXT: Tables:
-
+# CHECK-100-NEXT: - Index: 0
-
+# CHECK-100-NEXT: ElemType: FUNCREF
-
+# CHECK-100-NEXT: Limits:
-
+# CHECK-100-NEXT: Flags: [ HAS_MAX ]
-
+# CHECK-100-NEXT: Minimum: 0x65
-
+# CHECK-100-NEXT: Maximum: 0x65
-
+
-
+# CHECK-100: - Type: GLOBAL
-
+# CHECK-100-NEXT: Globals:
-
+# CHECK-100-NEXT: - Index: 0
-
+# CHECK-100-NEXT: Type: I32
-
+# CHECK-100-NEXT: Mutable: true
-
+# CHECK-100-NEXT: InitExpr:
-
+# CHECK-100-NEXT: Opcode: I32_CONST
-
+# CHECK-100-NEXT: Value: 66560
-
+# CHECK-100-NEXT: - Index: 1
-
+# CHECK-100-NEXT: Type: I32
-
+# CHECK-100-NEXT: Mutable: false
-
+# CHECK-100-NEXT: InitExpr:
-
+# CHECK-100-NEXT: Opcode: I32_CONST
-
+# CHECK-100-NEXT: Value: 100
-
+
-
+# CHECK-100: - Type: EXPORT
-
+# CHECK-100: - Name: __table_base
-
+# CHECK-100-NEXT: Kind: GLOBAL
-
+# CHECK-100-NEXT: Index: 1
-
diff --git a/wasm/Driver.cpp b/wasm/Driver.cpp
-
index 84304881f5ca34e..c2f5f0185781f36 100644
-
--- a/wasm/Driver.cpp
-
+++ b/wasm/Driver.cpp
-
@@ -502,6 +502,7 @@ static void readConfigs(opt::InputArgList &args) {
-
-
config->initialMemory = args::getInteger(args, OPT_initial_memory, 0);
-
config->globalBase = args::getInteger(args, OPT_global_base, 0);
-
+ config->tableBase = args::getInteger(args, OPT_table_base, 0);
-
config->maxMemory = args::getInteger(args, OPT_max_memory, 0);
-
config->zStackSize =
-
args::getZOptionValue(args, OPT_z, "stack-size", WasmPageSize);
-
@@ -573,6 +574,17 @@ static void setConfigs() {
-
if (config->exportTable)
-
error("-shared/-pie is incompatible with --export-table");
-
config->importTable = true;
-
+ } else {
-
+ // Default table base. Defaults to 1, reserving 0 for the NULL function
-
+ // pointer.
-
+ if (!config->tableBase)
-
+ config->tableBase = 1;
-
+ // The default offset for static/global data, for when --global-base is
-
+ // not specified on the command line. The precise value of 1024 is
-
+ // somewhat arbitrary, and pre-dates wasm-ld (Its the value that
-
+ // emscripten used prior to wasm-ld).
-
+ if (!config->globalBase && !config->relocatable && !config->stackFirst)
-
+ config->globalBase = 1024;
-
}
-
-
if (config->relocatable) {
-
@@ -666,8 +678,11 @@ static void checkOptions(opt::InputArgList &args) {
-
warn("-Bsymbolic is only meaningful when combined with -shared");
-
}
-
-
- if (config->globalBase && config->isPic) {
-
- error("--global-base may not be used with -shared/-pie");
-
+ if (config->isPic) {
-
+ if (config->globalBase)
-
+ error("--global-base may not be used with -shared/-pie");
-
+ if (config->tableBase)
-
+ error("--table-base may not be used with -shared/-pie");
-
}
-
}
-
-
diff --git a/wasm/Options.td b/wasm/Options.td
-
index 50417d2928e0a34..bb764396bf4df14 100644
-
--- a/wasm/Options.td
-
+++ b/wasm/Options.td
-
@@ -191,7 +191,7 @@ def growable_table: FF<"growable-table">,
-
HelpText<"Remove maximum size from function table, allowing table to grow">;
-
-
def global_base: JJ<"global-base=">,
-
- HelpText<"Where to start to place global data">;
-
+ HelpText<"Memory offset at which to place global data (Defaults to 1024)">;
-
-
def import_memory: FF<"import-memory">,
-
HelpText<"Import the module's memory from the default module of \"env\" with the name \"memory\".">;
-
@@ -224,6 +224,9 @@ def no_entry: FF<"no-entry">,
-
def stack_first: FF<"stack-first">,
-
HelpText<"Place stack at start of linear memory rather than after data">;
-
-
+def table_base: JJ<"table-base=">,
-
+ HelpText<"Table offset at which to place address taken functions (Defaults to 1)">;
-
+
-
defm whole_archive: B<"whole-archive",
-
"Force load of all members in a static library",
-
"Do not force load of all members in a static library (default)">;
-
diff --git a/wasm/Writer.cpp b/wasm/Writer.cpp
-
index f25d358dc5bae6f..0576bf2907e49c4 100644
-
--- a/wasm/Writer.cpp
-
+++ b/wasm/Writer.cpp
-
@@ -358,13 +358,6 @@ void Writer::layoutMemory() {
-
memoryPtr = config->globalBase;
-
}
-
} else {
-
- if (!config->globalBase && !config->relocatable && !config->isPic) {
-
- // The default offset for static/global data, for when --global-base is
-
- // not specified on the command line. The precise value of 1024 is
-
- // somewhat arbitrary, and pre-dates wasm-ld (Its the value that
-
- // emscripten used prior to wasm-ld).
-
- config->globalBase = 1024;
-
- }
-
memoryPtr = config->globalBase;
-
}
-
-
@@ -1685,7 +1678,6 @@ void Writer::run() {
-
// For PIC code the table base is assigned dynamically by the loader.
-
// For non-PIC, we start at 1 so that accessing table index 0 always traps.
-
if (!config->isPic) {
-
- config->tableBase = 1;
-
if (WasmSym::definedTableBase)
-
WasmSym::definedTableBase->setVA(config->tableBase);
-
if (WasmSym::definedTableBase32)
-46
pkgs/development/compilers/llvm/17/lld/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 3d6225646fe6..9b5d0b15af13 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -33,10 +33,22 @@ if(LLD_BUILT_STANDALONE)
-
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
-
-
- # Turn into CACHE PATHs for overwriting
-
- 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")
-
+ # 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 overridden.
-
+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
+ endif()
-
+
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
-
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-
NO_DEFAULT_PATH)
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index d3924f7243d4..42a7cd62281c 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -18,8 +18,8 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-19
pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs-polly.patch
···
-
This is the one remaining Polly install dirs related change that hasn't made it
-
into upstream yet; previously this patch file also included:
-
https://reviews.llvm.org/D117541
-
-
diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake
-
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")
-
install(TARGETS ${name}
-
EXPORT LLVMExports
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
endif()
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-
endmacro(add_polly_library)
-137
pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 471817d68286..c51463304159 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -1010,7 +1010,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
-
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
-
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
-
install(TARGETS tf_xla_runtime EXPORT LLVMExports
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
-
# Once we add more modules, we should handle this more automatically.
-
if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 230620c37027..dd16cab1835e 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -876,8 +876,8 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -2069,7 +2069,7 @@ function(llvm_install_library_symlink name dest type)
-
set(LLVM_LINK_OR_COPY copy)
-
endif()
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir "${CMAKE_INSTALL_BINDIR}")
-
endif()
-
@@ -2344,16 +2344,37 @@ function(llvm_setup_rpath name)
-
-
if (APPLE)
-
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
-
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
-
# $ORIGIN is not interpreted at link time by aix ld.
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
-
+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back
-
+ # to `_install_rpath` here.
-
+ #
-
+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e.
-
+ # clang); instead LLVM is its own package and thus lands at its own nix
-
+ # store path. This makes it so that the default relative rpath (`../lib/`)
-
+ # does not point at the LLVM shared objects.
-
+ #
-
+ # More discussion here:
-
+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329
-
+ # - https://reviews.llvm.org/D146918 (16.0.5+)
-
+ #
-
+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is
-
+ # no potential that this will result in us pulling in the "wrong" LLVM.
-
+ # Adding this to the build rpath means we aren't forced to use
-
+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build
-
+ # dir, pre-install, will have the right rpath for LLVM).
-
+ #
-
+ # As noted in the differential above, an alternative solution is to have
-
+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set
-
+ # `CMAKE_INSTALL_RPATH`.
-
+ set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 891c9e6d618c..8d963f3b0069 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index d99af79aa38e..21e794224b99 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
-
)
-
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-
-
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
-
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_LIBRARY_DIRS
-
"${LLVM_CONFIG_LIBRARY_DIR}"
-
# FIXME: Should there be other entries here?
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index 370005cd8d7d..7e790bc52111 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,7 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
#define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index e86eb2b44b10..f63e207e792e 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -366,7 +366,11 @@ int main(int argc, char **argv) {
-
sys::fs::make_absolute(ActivePrefix, Path);
-
ActiveBinDir = std::string(Path.str());
-
}
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveLibDir = std::string(Path.str());
-
+ }
-
{
-
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
-
sys::fs::make_absolute(ActivePrefix, Path);
-17
pkgs/development/compilers/llvm/17/llvm/lit-shell-script-runner-set-dyld-library-path.patch
···
-
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
-
index 0242e0b75af3..d732011306f7 100644
-
--- a/utils/lit/lit/TestRunner.py
-
+++ b/utils/lit/lit/TestRunner.py
-
@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
-
f.write('@echo off\n')
-
f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
-
else:
-
+ # This env var is *purged* when invoking subprocesses so we have to
-
+ # manually set it from within the bash script in order for the commands
-
+ # in run lines to see this var:
-
+ if "DYLD_LIBRARY_PATH" in test.config.environment:
-
+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n')
-
+
-
for i, ln in enumerate(commands):
-
match = re.match(kPdbgRegex, ln)
-
if match:
pkgs/development/compilers/llvm/17/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch pkgs/development/compilers/llvm/18/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch
pkgs/development/compilers/llvm/17/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch pkgs/development/compilers/llvm/18/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch
pkgs/development/compilers/llvm/17/openmp/fix-find-tool.patch pkgs/development/compilers/llvm/18/openmp/fix-find-tool.patch
-22
pkgs/development/compilers/llvm/17/openmp/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b6ddbe90516d..311ab1d50e7f 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD)
-
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}")
-
-
# Group test settings.
-
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
-
@@ -40,7 +40,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}")
-
-
if (NOT MSVC)
-
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
pkgs/development/compilers/llvm/17/openmp/run-lit-directly.patch pkgs/development/compilers/llvm/18/openmp/run-lit-directly.patch
+6 -14
pkgs/development/compilers/llvm/common/clang/default.nix
···
];
stripLen = 1;
hash = "sha256-1NKej08R9SPlbDY/5b0OKUsHjX07i9brR84yXiPwi7E=";
-
})
-
++
-
lib.optional (stdenv.isAarch64 && lib.versions.major release_version == "17")
-
# Fixes llvm17 tblgen builds on aarch64.
-
# https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680
-
(getVersionFile "clang/aarch64-tblgen.patch");
+
});
nativeBuildInputs = [
cmake
python3
ninja
]
-
++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser
-
++ lib.optional enableManpages python3.pkgs.sphinx
+
++ lib.optionals enableManpages [
+
python3.pkgs.myst-parser
+
python3.pkgs.sphinx
+
]
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [
···
postInstall = ''
ln -sv $out/bin/clang $out/bin/cpp
''
-
+ (lib.optionalString (lib.versions.major release_version == "17") ''
-
mkdir -p $lib/lib/clang
-
mv $lib/lib/17 $lib/lib/clang/17
-
'')
+ (lib.optionalString
((lib.versionAtLeast release_version "19") && !(lib.versionAtLeast release_version "21"))
''
···
++ lib.optional (!targetPlatform.isLinux || !targetPlatform.isx86_64) "shadowstack"
++ lib.optional (!targetPlatform.isAarch64 || !targetPlatform.isLinux) "pacret"
++ lib.optional (
-
(targetPlatform.isAarch64 && (lib.versionOlder release_version "18.1"))
-
|| !(targetPlatform.isLinux || targetPlatform.isFreeBSD)
+
!(targetPlatform.isLinux || targetPlatform.isFreeBSD)
|| !(
targetPlatform.isx86
|| targetPlatform.isPower64
-34
pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch
···
-
From ff0b373b959165477f45d9f5f9a8da471ae111ab Mon Sep 17 00:00:00 2001
-
From: Ben Wolsieffer <benwolsieffer@gmail.com>
-
Date: Wed, 7 Dec 2022 18:03:56 -0500
-
Subject: [PATCH] [scudo][standalone] Only use yield on ARMv6K and newer
-
-
The yield instruction is only available in ARMv6K and newer. It behaves as a
-
nop on single threaded platforms anyway, so use nop instead on unsupported
-
architectures.
-
-
Differential Revision: https://reviews.llvm.org/D139600
-
---
-
compiler-rt/lib/scudo/standalone/common.h | 5 +++++
-
1 file changed, 5 insertions(+)
-
-
diff --git a/lib/scudo/standalone/common.h b/lib/scudo/standalone/common.h
-
index bc3dfec6dbba..862cda1d4bc4 100644
-
--- a/lib/scudo/standalone/common.h
-
+++ b/lib/scudo/standalone/common.h
-
@@ -109,7 +109,12 @@ inline void yieldProcessor(u8 Count) {
-
#elif defined(__aarch64__) || defined(__arm__)
-
__asm__ __volatile__("" ::: "memory");
-
for (u8 I = 0; I < Count; I++)
-
+#if __ARM_ARCH >= 6 && !defined(__ARM_ARCH_6__)
-
+ // yield is supported on ARMv6K and newer
-
__asm__ __volatile__("yield");
-
+#else
-
+ __asm__ __volatile__("nop");
-
+#endif
-
#endif
-
__asm__ __volatile__("" ::: "memory");
-
}
-
--
-
2.38.1
-
+1 -20
pkgs/development/compilers/llvm/common/compiler-rt/default.nix
···
(getVersionFile "compiler-rt/normalize-var.patch")
# Fix build on armv6l
./armv6-no-ldrexd-strexd.patch
-
]
-
++ lib.optional (lib.versionOlder release_version "18") (
-
getVersionFile "compiler-rt/gnu-install-dirs.patch"
-
)
-
++ lib.optional (lib.versionOlder release_version "18") (fetchpatch {
-
name = "cfi_startproc-after-label.patch";
-
url = "https://github.com/llvm/llvm-project/commit/7939ce39dac0078fef7183d6198598b99c652c88.patch";
-
stripLen = 1;
-
hash = "sha256-tGqXsYvUllFrPa/r/dsKVlwx5IrcJGccuR1WAtUg7/o=";
-
})
-
++
-
lib.optional (lib.versionOlder release_version "18")
-
# Prevent a compilation error on darwin
-
(getVersionFile "compiler-rt/darwin-targetconditionals.patch")
-
++ [
# See: https://github.com/NixOS/nixpkgs/pull/186575
./darwin-plistbuddy-workaround.patch
-
]
-
++ lib.optionals (lib.versionOlder release_version "18") [
-
# Fix build on armv6l
-
./armv6-scudo-no-yield.patch
]
++ [
(getVersionFile "compiler-rt/armv6-scudo-libatomic.patch")
···
''
substituteInPlace lib/builtins/clear_cache.c \
--replace-fail "#include <assert.h>" ""
-
substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast release_version "18") "/x86"}.c \
+
substituteInPlace lib/builtins/cpu_model/x86.c \
--replace-fail "#include <assert.h>" ""
''
)
+1 -6
pkgs/development/compilers/llvm/common/default.nix
···
# to replacements depending on the llvm outpath (e.g. the LLVMgold patch).
# So take the only patch known to be necessary.
(metadata.getVersionFile "clang/gnu-install-dirs.patch")
-
]
-
++
-
lib.optional (stdenv.isAarch64 && lib.versions.major metadata.release_version == "17")
-
# Fixes llvm17 tblgen builds on aarch64.
-
# https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680
-
(metadata.getVersionFile "clang/aarch64-tblgen.patch");
+
];
};
libclang = callPackage ./clang {
+17 -32
pkgs/development/compilers/llvm/common/libcxx/default.nix
···
# Note: useLLVM is likely false for Darwin but true under pkgsLLVM
useLLVM = stdenv.hostPlatform.useLLVM or false;
-
cxxabiCMakeFlags =
-
lib.optionals (lib.versionAtLeast release_version "18") [
-
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
-
]
-
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) (
-
if lib.versionAtLeast release_version "18" then
-
[
-
(lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind")
-
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
-
]
-
else
-
[
-
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
-
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" true)
-
]
-
)
-
++ lib.optionals stdenv.hostPlatform.isWasm [
-
(lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false)
-
(lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false)
-
]
-
++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [
-
# Required on Windows due to https://github.com/llvm/llvm-project/issues/55245
-
(lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false)
-
];
+
cxxabiCMakeFlags = [
+
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
+
]
+
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [
+
(lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind")
+
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
+
]
+
++ lib.optionals stdenv.hostPlatform.isWasm [
+
(lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false)
+
(lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false)
+
]
+
++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [
+
# Required on Windows due to https://github.com/llvm/llvm-project/issues/55245
+
(lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false)
+
];
cxxCMakeFlags = [
(lib.cmakeFeature "LIBCXX_CXX_ABI" cxxabiName)
···
(lib.cmakeFeature "LIBCXX_HAS_MUSL_LIBC" "1")
]
++
-
lib.optionals
-
(
-
lib.versionAtLeast release_version "18"
-
&& !useLLVM
-
&& stdenv.hostPlatform.libc == "glibc"
-
&& !stdenv.hostPlatform.isStatic
-
)
+
lib.optionals (!useLLVM && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic)
[
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "gcc_s")
]
-
++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [
+
++ lib.optionals stdenv.hostPlatform.isFreeBSD [
# Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind`
# to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind.
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
+3 -8
pkgs/development/compilers/llvm/common/libunwind/default.nix
···
]
++ devExtraCmakeFlags;
-
prePatch = lib.optionalString (lib.versionOlder release_version "18") ''
-
cd ../libunwind
-
chmod -R u+w .
-
'';
-
-
postPatch = lib.optionalString (lib.versionOlder release_version "18") ''
-
cd ../runtimes
-
'';
+
# TODO: Remove on `staging`.
+
prePatch = "";
+
postPatch = "";
postInstall =
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows)
-1
pkgs/development/compilers/llvm/common/lld/default.nix
···
patches = [
(getVersionFile "lld/gnu-install-dirs.patch")
]
-
++ lib.optional (lib.versionOlder release_version "18") (getVersionFile "lld/add-table-base.patch")
++ lib.optional (lib.versions.major release_version == "18") (
# https://github.com/llvm/llvm-project/pull/97122
fetchpatch {
+4 -18
pkgs/development/compilers/llvm/common/lldb/default.nix
···
let
vscodeExt = {
-
name = if lib.versionAtLeast release_version "18" then "lldb-dap" else "lldb-vscode";
-
version = if lib.versionAtLeast release_version "18" then "0.2.0" else "0.1.0";
+
name = "lldb-dap";
+
version = "0.2.0";
};
in
···
sourceRoot = "${finalAttrs.src.name}/lldb";
-
patches =
-
lib.optional (lib.versionOlder release_version "18") (fetchpatch {
-
name = "libcxx-19-char_traits.patch";
-
url = "https://github.com/llvm/llvm-project/commit/68744ffbdd7daac41da274eef9ac0d191e11c16d.patch";
-
stripLen = 1;
-
hash = "sha256-QCGhsL/mi7610ZNb5SqxjRGjwJeK2rwtsFVGeG3PUGc=";
-
})
-
++ [ ./gnu-install-dirs.patch ];
+
patches = [ ./gnu-install-dirs.patch ];
nativeBuildInputs = [
cmake
···
]
++ lib.optionals enableManpages [
python3.pkgs.sphinx
-
]
-
++ lib.optionals (lib.versionOlder release_version "18" && enableManpages) [
-
python3.pkgs.recommonmark
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "18" && enableManpages) [
python3.pkgs.myst-parser
]
# TODO: Clean up on `staging`.
···
# vscode:
install -D ../tools/${vscodeExt.name}/package.json $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/package.json
mkdir -p $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
-
ln -s $out/bin/*${
-
if lib.versionAtLeast release_version "18" then vscodeExt.name else "-vscode"
-
} $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
+
ln -s $out/bin/*${vscodeExt.name} $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
'';
passthru.vscodeExtName = vscodeExt.name;
+5 -24
pkgs/development/compilers/llvm/common/llvm/default.nix
···
pname = "llvm";
inherit version;
-
# Used when creating a version-suffixed symlink of libLLVM.dylib
+
# TODO: Remove on `staging`.
shortVersion = lib.concatStringsSep "." (lib.take 1 (lib.splitString "." release_version));
src =
···
stripLen = 1;
}
)
-
++
-
lib.optional (lib.versions.major release_version == "17")
-
# Fixes a crash with -fzero-call-used-regs=used-gpr
-
# See also https://github.com/llvm/llvm-project/issues/75168
-
(
-
fetchpatch {
-
name = "fix-fzero-call-used-regs.patch";
-
url = "https://github.com/llvm/llvm-project/commit/f800c1f3b207e7bcdc8b4c7192928d9a078242a0.patch";
-
stripLen = 1;
-
hash = "sha256-e8YKrMy2rGcSJGC6er2V66cOnAnI+u1/yImkvsRsmg8=";
-
}
-
)
++ lib.optionals (lib.versions.major release_version == "18") [
# Reorgs one test so the next patch applies
(fetchpatch {
···
# Note: we intentionally use `python3Packages` instead of `python3.pkgs`;
# splicing does *not* work with the latter. (TODO: fix)
python3Packages.sphinx
-
]
-
++ optionals (lib.versionOlder version "18" && enableManpages) [
-
python3Packages.recommonmark
-
]
-
++ optionals (lib.versionAtLeast version "18" && enableManpages) [
python3Packages.myst-parser
];
···
''
+
# fails when run in sandbox
-
optionalString (!stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "18") ''
+
optionalString (!stdenv.hostPlatform.isx86) ''
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
''
···
optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) (
# fails when run in sandbox
(
-
(optionalString (lib.versionAtLeast release_version "18") ''
+
''
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
-
'')
+
''
+
# This test fails on darwin x86_64 because `sw_vers` reports a different
# macOS version than what LLVM finds by reading
···
--replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")'
''
+ optionalString (stdenv.hostPlatform.isDarwin && enableSharedLibraries) ''
-
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${
-
if lib.versionOlder release_version "18" then "$shortVersion" else release_version
-
}.dylib
+
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) (
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
-3
pkgs/development/compilers/llvm/common/openmp/default.nix
···
patches =
lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch")
-
++ lib.optional (lib.versionOlder release_version "18") (
-
getVersionFile "openmp/gnu-install-dirs.patch"
-
)
++ [
(getVersionFile "openmp/run-lit-directly.patch")
];
+8 -42
pkgs/development/compilers/llvm/common/patches.nix
···
];
"clang/purity.patch" = [
{
-
after = "18";
path = ../18;
}
];
-
"clang/aarch64-tblgen.patch" = [
-
{
-
before = "18";
-
path = ../17;
-
}
-
];
-
"lld/add-table-base.patch" = [
-
{
-
path = ../17;
-
}
-
];
"lld/gnu-install-dirs.patch" = [
{
-
after = "18";
path = ../18;
}
];
···
path = ../20;
}
{
-
after = "18";
before = "20";
path = ../18;
}
···
}
{
before = "20";
-
after = "18";
path = ../18;
-
}
-
{
-
before = "18";
-
path = ../17;
}
];
"llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [
{
-
path = ../17;
+
path = ../18;
}
];
"llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [
{
-
after = "18";
path = ../18;
}
-
{
-
before = "18";
-
path = ../17;
-
}
];
"llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [
{
-
path = ../17;
+
path = ../18;
}
];
"compiler-rt/X86-support-extension.patch" = [
{
-
path = ../17;
+
path = ../18;
}
];
"compiler-rt/armv6-scudo-libatomic.patch" = [
···
}
{
before = "19";
-
path = ../17;
-
}
-
];
-
"compiler-rt/gnu-install-dirs.patch" = [
-
{
-
path = ../17;
-
}
-
];
-
"compiler-rt/darwin-targetconditionals.patch" = [
-
{
-
path = ../17;
+
path = ../18;
}
];
"compiler-rt/normalize-var.patch" = [
{
-
path = ../17;
+
path = ../18;
}
];
"openmp/fix-find-tool.patch" = [
{
before = "19";
-
path = ../17;
+
path = ../18;
}
];
"openmp/run-lit-directly.patch" = [
{
-
path = ../17;
+
path = ../18;
}
];
"libclc/use-default-paths.patch" = [
···
"libclc/gnu-install-dirs.patch" = [
{
before = "21";
-
path = ../17;
+
path = ../18;
}
{
after = "21";
-1
pkgs/development/compilers/llvm/default.nix
···
}@packageSetArgs:
let
versions = {
-
"17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=";
"18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE=";
"19.1.7".officialRelease.sha256 = "sha256-cZAB5vZjeTsXt9QHbP5xluWNQnAHByHtHnAhVDV0E6I=";
"20.1.8".officialRelease.sha256 = "sha256-ysyB/EYxi2qE9fD5x/F2zI4vjn8UDoo1Z9ukiIrjFGw=";
+1
pkgs/test/default.nix
···
(filter (n: n != "llvmPackages_14"))
(filter (n: n != "llvmPackages_15"))
(filter (n: n != "llvmPackages_16"))
+
(filter (n: n != "llvmPackages_17"))
];
tests = lib.genAttrs pkgSets (
name:
+9 -2
pkgs/top-level/aliases.nix
···
cyber = throw "cyber has been removed, as it does not build with supported Zig versions"; # Added 2025-08-09
# these are for convenience, not for backward compat., and shouldn't expire until the package is deprecated.
-
clang17Stdenv = lowPrio llvmPackages_17.stdenv; # preserve, reason: see above
clang18Stdenv = lowPrio llvmPackages_18.stdenv; # preserve, reason: see above
clang19Stdenv = lowPrio llvmPackages_19.stdenv; # preserve, reason: see above
-
clang-tools_17 = llvmPackages_17.clang-tools; # Added 2024-04-22
clang-tools_18 = llvmPackages_18.clang-tools; # Added 2024-04-22
clang-tools_19 = llvmPackages_19.clang-tools; # Added 2024-08-21
···
clang_16 = throw "clang_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
clang16Stdenv = throw "clang16Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
clang-tools_16 = throw "clang-tools_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
+
llvmPackages_17 = throw "llvmPackages_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
llvm_17 = throw "llvm_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lld_17 = throw "lld_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lldb_17 = throw "lldb_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
mlir_17 = throw "mlir_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang_17 = throw "clang_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang17Stdenv = throw "clang17Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang-tools_17 = throw "clang-tools_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
lobster-two = throw "'lobster-two' has been renamed to/replaced by 'google-fonts'"; # Converted to throw 2024-10-17
loc = throw "'loc' has been removed due to lack of upstream maintenance. Consider 'tokei' as an alternative."; # Added 2025-01-25
-9
pkgs/top-level/all-packages.nix
···
clang-manpages = llvmPackages.clang-manpages;
clang = llvmPackages.clang;
-
clang_17 = llvmPackages_17.clang;
clang-tools = llvmPackages.clang-tools;
···
};
lld = llvmPackages.lld;
-
lld_17 = llvmPackages_17.lld;
lldb = llvmPackages.lldb;
-
lldb_17 = llvmPackages_17.lldb;
llvm = llvmPackages.llvm;
-
llvm_17 = llvmPackages_17.llvm;
-
-
mlir_17 = llvmPackages_17.mlir;
flang = llvmPackages_20.flang;
libclc = llvmPackages.libclc;
···
inherit
(rec {
llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { });
-
-
llvmPackages_17 = llvmPackagesSet."17";
llvmPackages_18 = llvmPackagesSet."18";
clang_18 = llvmPackages_18.clang;
···
mkLLVMPackages = llvmPackagesSet.mkPackage;
})
-
llvmPackages_17
llvmPackages_18
clang_18
lld_18