diff options
Diffstat (limited to 'pkgs/development/compilers/llvm/common/compiler-rt')
11 files changed, 0 insertions, 798 deletions
diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/7-12-codesign.patch b/pkgs/development/compilers/llvm/common/compiler-rt/7-12-codesign.patch deleted file mode 100644 index 3cc12b94b200..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/7-12-codesign.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001 -From: Will Dietz <w@wdtz.org> -Date: Tue, 19 Sep 2017 13:13:06 -0500 -Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that - needs it - ---- - cmake/Modules/AddCompilerRT.cmake | 8 ------ - test/asan/CMakeLists.txt | 52 --------------------------------------- - test/tsan/CMakeLists.txt | 47 ----------------------------------- - 3 files changed, 107 deletions(-) - -diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake -index bc5fb9ff7..b64eb4246 100644 ---- a/cmake/Modules/AddCompilerRT.cmake -+++ b/cmake/Modules/AddCompilerRT.cmake -@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type) - set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") - set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") - endif() -- if(APPLE) -- # Ad-hoc sign the dylibs -- add_custom_command(TARGET ${libname} -- POST_BUILD -- COMMAND codesign --sign - $<TARGET_FILE:${libname}> -- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} -- ) -- endif() - endif() - install(TARGETS ${libname} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} -2.14.1 - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch deleted file mode 100644 index acdcc9e983b8..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch +++ /dev/null @@ -1,75 +0,0 @@ -From a11d1cc41c725ec6dee58f75e4a852a658dd7543 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 10 Mar 2022 19:30:00 -0800 -Subject: [PATCH] [builtins] Use mcr for dmb instruction on armv6 - -At present compiler-rt cross compiles for armv6 ( -march=armv6 ) but includes -dmb instructions which are only available in armv7+ this causes SIGILL on -clang+compiler-rt compiled components on rpi0w platforms. - -Reviewed By: MaskRay - -Differential Revision: https://reviews.llvm.org/D99282 ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- - compiler-rt/lib/builtins/assembly.h | 8 ++++++++ - 2 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h -index c9623249e5d20..7a26170741ad2 100644 ---- a/lib/builtins/arm/sync-ops.h -+++ b/lib/builtins/arm/sync-ops.h -@@ -19,14 +19,14 @@ - .thumb; \ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ - op(r2, r0, r1); \ - strex r3, r2, [r12]; \ - cmp r3, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - bx lr - - #define SYNC_OP_8(op) \ -@@ -35,14 +35,14 @@ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ - op(r4, r5, r0, r1, r2, r3); \ - strexd r6, r4, r5, [r12]; \ - cmp r6, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - pop { r4, r5, r6, pc } - - #define MINMAX_4(rD, rN, rM, cmp_kind) \ -diff --git a/lib/builtins/assembly.h b/lib/builtins/assembly.h -index 69a3d8620f924..06aa18162e3b4 100644 ---- a/lib/builtins/assembly.h -+++ b/lib/builtins/assembly.h -@@ -189,6 +189,14 @@ - JMP(ip) - #endif - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error only supported on ARMv6+ -+#endif -+ - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-no-ldrexd-strexd.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-no-ldrexd-strexd.patch deleted file mode 100644 index 2537ae1fae12..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-no-ldrexd-strexd.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 4fe3f21bf8b20c766877d2251d61118d0ff36688 Mon Sep 17 00:00:00 2001 -From: Ben Wolsieffer <benwolsieffer@gmail.com> -Date: Wed, 7 Dec 2022 14:56:51 -0500 -Subject: [PATCH] [compiler-rt][builtins] Do not use ldrexd or strexd on ARMv6 - -The ldrexd and strexd instructions are not available on base ARMv6, and were -only added in ARMv6K (see [1]). This patch solves this problem once and for all -using the __ARM_FEATURE_LDREX macro (see [2]) defined in the ARM C Language -Extensions (ACLE). Although this macro is technically deprecated in the ACLE, -it allows compiler-rt to reliably detect whether ldrexd and strexd are supported -without complicated conditionals to detect different ARM architecture variants. - -[1] https://developer.arm.com/documentation/dht0008/a/ch01s02s01 -[2] https://arm-software.github.io/acle/main/acle.html#ldrexstrex - -Differential Revision: https://reviews.llvm.org/D139585 ---- - compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S | 2 +- - compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S | 2 +- - 10 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/lib/builtins/arm/sync_fetch_and_add_8.S b/lib/builtins/arm/sync_fetch_and_add_8.S -index 18bdd875b8b7..bee6f7ba0f34 100644 ---- a/lib/builtins/arm/sync_fetch_and_add_8.S -+++ b/lib/builtins/arm/sync_fetch_and_add_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define add_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - adds rD_LO, rN_LO, rM_LO ; \ - adc rD_HI, rN_HI, rM_HI -diff --git a/lib/builtins/arm/sync_fetch_and_and_8.S b/lib/builtins/arm/sync_fetch_and_and_8.S -index 3716eff809d5..b4e77a54edf6 100644 ---- a/lib/builtins/arm/sync_fetch_and_and_8.S -+++ b/lib/builtins/arm/sync_fetch_and_and_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define and_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - and rD_LO, rN_LO, rM_LO ; \ - and rD_HI, rN_HI, rM_HI -diff --git a/lib/builtins/arm/sync_fetch_and_max_8.S b/lib/builtins/arm/sync_fetch_and_max_8.S -index 06115ab55246..1813274cc649 100644 ---- a/lib/builtins/arm/sync_fetch_and_max_8.S -+++ b/lib/builtins/arm/sync_fetch_and_max_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define max_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, gt) - - SYNC_OP_8(max_8) -diff --git a/lib/builtins/arm/sync_fetch_and_min_8.S b/lib/builtins/arm/sync_fetch_and_min_8.S -index 4f3e299d95cc..fa8f3477757b 100644 ---- a/lib/builtins/arm/sync_fetch_and_min_8.S -+++ b/lib/builtins/arm/sync_fetch_and_min_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define min_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, lt) - - SYNC_OP_8(min_8) -diff --git a/lib/builtins/arm/sync_fetch_and_nand_8.S b/lib/builtins/arm/sync_fetch_and_nand_8.S -index 425c94474af7..fb27219ee200 100644 ---- a/lib/builtins/arm/sync_fetch_and_nand_8.S -+++ b/lib/builtins/arm/sync_fetch_and_nand_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define nand_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - bic rD_LO, rN_LO, rM_LO ; \ - bic rD_HI, rN_HI, rM_HI -diff --git a/lib/builtins/arm/sync_fetch_and_or_8.S b/lib/builtins/arm/sync_fetch_and_or_8.S -index 4f18dcf84df9..3b077c8737b1 100644 ---- a/lib/builtins/arm/sync_fetch_and_or_8.S -+++ b/lib/builtins/arm/sync_fetch_and_or_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define or_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - orr rD_LO, rN_LO, rM_LO ; \ - orr rD_HI, rN_HI, rM_HI -diff --git a/lib/builtins/arm/sync_fetch_and_sub_8.S b/lib/builtins/arm/sync_fetch_and_sub_8.S -index 25a4a1076555..c171607eabd8 100644 ---- a/lib/builtins/arm/sync_fetch_and_sub_8.S -+++ b/lib/builtins/arm/sync_fetch_and_sub_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define sub_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - subs rD_LO, rN_LO, rM_LO ; \ - sbc rD_HI, rN_HI, rM_HI -diff --git a/lib/builtins/arm/sync_fetch_and_umax_8.S b/lib/builtins/arm/sync_fetch_and_umax_8.S -index aa5213ff1def..d1224f758049 100644 ---- a/lib/builtins/arm/sync_fetch_and_umax_8.S -+++ b/lib/builtins/arm/sync_fetch_and_umax_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define umax_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, hi) - - SYNC_OP_8(umax_8) -diff --git a/lib/builtins/arm/sync_fetch_and_umin_8.S b/lib/builtins/arm/sync_fetch_and_umin_8.S -index 8b40541ab47d..595444e6d053 100644 ---- a/lib/builtins/arm/sync_fetch_and_umin_8.S -+++ b/lib/builtins/arm/sync_fetch_and_umin_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define umin_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, lo) - - SYNC_OP_8(umin_8) -diff --git a/lib/builtins/arm/sync_fetch_and_xor_8.S b/lib/builtins/arm/sync_fetch_and_xor_8.S -index 7436eb1d4cae..9fc3d85cef75 100644 ---- a/lib/builtins/arm/sync_fetch_and_xor_8.S -+++ b/lib/builtins/arm/sync_fetch_and_xor_8.S -@@ -13,7 +13,7 @@ - - #include "sync-ops.h" - --#if __ARM_ARCH_PROFILE != 'M' -+#if __ARM_FEATURE_LDREX & 8 - #define xor_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ - eor rD_LO, rN_LO, rM_LO ; \ - eor rD_HI, rN_HI, rM_HI --- -2.38.1 - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-libatomic.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-libatomic.patch deleted file mode 100644 index 13b67eb2a41c..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-libatomic.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a56bb19a9dc303a50ef12d83cd24c2395bf81076 Mon Sep 17 00:00:00 2001 -From: Ben Wolsieffer <benwolsieffer@gmail.com> -Date: Wed, 7 Dec 2022 21:25:46 -0500 -Subject: [PATCH] [scudo][standalone] Use CheckAtomic to decide to link to - libatomic - -Standalone scudo uses the atomic operation builtin functions, which require -linking to libatomic on some platforms. Currently, this is done in an ad-hoc -manner. MIPS platforms always link to libatomic, and the tests are always linked -to it as well. libatomic is required on base ARMv6 (but not ARMv6K), but it is -currently not linked, causing the build to fail. - -This patch replaces this ad-hoc logic with the CheckAtomic CMake module already -used in other parts of LLVM. The CheckAtomic module checks whether std::atomic -requires libatomic, which is not strictly the same as checking the atomic -builtins, but should have the same results as far as I know. If this is -problematic, a custom version of CheckAtomic could be used to specifically test -the builtins. ---- - compiler-rt/lib/scudo/standalone/CMakeLists.txt | 7 +++++++ - compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt | 4 +--- - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/lib/scudo/standalone/CMakeLists.txt b/lib/scudo/standalone/CMakeLists.txt -index ae5c354768c8..eb27374ca520 100644 ---- a/lib/scudo/standalone/CMakeLists.txt -+++ b/lib/scudo/standalone/CMakeLists.txt -@@ -1,5 +1,8 @@ - add_compiler_rt_component(scudo_standalone) - -+include(DetermineGCCCompatible) -+include(CheckAtomic) -+ - include_directories(../.. include) - - set(SCUDO_CFLAGS) -@@ -34,6 +37,10 @@ list(APPEND SCUDO_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro) - - list(APPEND SCUDO_LINK_FLAGS -ffunction-sections -fdata-sections -Wl,--gc-sections) - -+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) -+ list(APPEND SCUDO_LINK_FLAGS -latomic) -+endif() -+ - # We don't use the C++ standard library, so avoid including it by mistake. - append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SCUDO_LINK_FLAGS) - -diff --git a/lib/scudo/standalone/tests/CMakeLists.txt b/lib/scudo/standalone/tests/CMakeLists.txt -index 6d0936cbb5c1..70a5a7e959c1 100644 ---- a/lib/scudo/standalone/tests/CMakeLists.txt -+++ b/lib/scudo/standalone/tests/CMakeLists.txt -@@ -38,9 +38,7 @@ set(LINK_FLAGS - ${SANITIZER_TEST_CXX_LIBRARIES} - ) - list(APPEND LINK_FLAGS -pthread) --# Linking against libatomic is required with some compilers --check_library_exists(atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC) --if (COMPILER_RT_HAS_LIBATOMIC) -+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) - list(APPEND LINK_FLAGS -latomic) - endif() - --- -2.38.1 - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch deleted file mode 100644 index 2fd48eda6518..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch +++ /dev/null @@ -1,34 +0,0 @@ -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 - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch deleted file mode 100644 index 098a155d448c..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 5017de8ba4b1fe985169cf54590e858a9019a91f Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 11 Mar 2022 16:25:49 -0800 -Subject: [PATCH] [builtins] Do not force thumb mode directive in - arm/sync-ops.h - -.thumb_func was not switching mode until [1] -so it did not show up but now that .thumb_func (without argument) is -switching mode, its causing build failures on armv6 ( rpi0 ) even when -build is explicitly asking for this file to be built with -marm (ARM -mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function -header which considers arch and mode from compiler cmdline to decide if -the function is built using thumb mode or arm mode. - -[1] https://reviews.llvm.org/D101975 - -Note that it also needs https://reviews.llvm.org/D99282 - -Reviewed By: peter.smith, MaskRay - -Differential Revision: https://reviews.llvm.org/D104183 ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h -index 7a26170741ad2..d914f9d3a1093 100644 ---- a/lib/builtins/arm/sync-ops.h -+++ b/lib/builtins/arm/sync-ops.h -@@ -16,9 +16,8 @@ - - #define SYNC_OP_4(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ -@@ -31,9 +30,8 @@ - - #define SYNC_OP_8(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ - DMB; \ - mov r12, r0; \ - diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch b/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch deleted file mode 100644 index ca1c2332abd9..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -ur a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake ---- a/cmake/builtin-config-ix.cmake @llvm 15.0.6 -+++ b/cmake/builtin-config-ix.cmake -@@ -46,7 +46,7 @@ - - set(ARM64 aarch64) --set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main) -+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main) - set(AVR avr) - set(HEXAGON hexagon) - set(X86 i386) - set(X86_64 x86_64) -diff -ur a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt ---- a/lib/builtins/CMakeLists.txt @llvm 15.0.6 -+++ b/lib/builtins/CMakeLists.txt -@@ -565,6 +565,7 @@ - set(armv7_SOURCES ${arm_SOURCES}) - set(armv7s_SOURCES ${arm_SOURCES}) - set(armv7k_SOURCES ${arm_SOURCES}) -+set(armv7l_SOURCES ${arm_SOURCES}) - set(arm64_SOURCES ${aarch64_SOURCES}) - - # macho_embedded archs -@@ -734,7 +735,7 @@ - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) - if (CAN_TARGET_${arch}) - # For ARM archs, exclude any VFP builtins if VFP is not supported -- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$") -+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$") - string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") - check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) - if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/darwin-plistbuddy-workaround.patch b/pkgs/development/compilers/llvm/common/compiler-rt/darwin-plistbuddy-workaround.patch deleted file mode 100644 index dae8b3a690ac..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/darwin-plistbuddy-workaround.patch +++ /dev/null @@ -1,25 +0,0 @@ -CMake tries to read a list field from SDKSettings.plist, but the output of -xcbuild PlistBuddy is incompatible with Apple's. (Plus we don't want it in our -dependencies.) - -Simply assume ARM64 is supported by the SDK. We already limit the actual archs -we build for by setting DARWIN_osx_BUILTIN_ARCHS explicitely. - ---- a/cmake/builtin-config-ix.cmake -+++ b/cmake/builtin-config-ix.cmake -@@ -97,14 +97,7 @@ if(APPLE) - set(DARWIN_osx_BUILTIN_MIN_VER 10.5) - set(DARWIN_osx_BUILTIN_MIN_VER_FLAG - -mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER}) -- set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64}) -- # Add support for arm64 macOS if available in SDK. -- foreach(arch ${ARM64}) -- sdk_has_arch_support(${DARWIN_osx_SYSROOT} macosx ${arch} MACOS_ARM_SUPPORT) -- if (MACOS_ARM_SUPPORT) -- list(APPEND DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${arch}) -- endif() -- endforeach(arch) -+ set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64} ${ARM64}) - - if(COMPILER_RT_ENABLE_IOS) - list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix deleted file mode 100644 index 23a966ce238f..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix +++ /dev/null @@ -1,192 +0,0 @@ -{ lib -, stdenv -, llvm_meta -, release_version -, version -, patches ? [] -, src ? null -, monorepoSrc ? null -, runCommand -, cmake -, ninja -, python3 -, xcbuild -, libllvm -, linuxHeaders -, libxcrypt - -# Some platforms have switched to using compiler-rt, but still want a -# libgcc.a for ABI compat purposes. The use case would be old code that -# expects to link `-lgcc` but doesn't care exactly what its contents -# are, so long as it provides some builtins. -, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD - -# In recent releases, the compiler-rt build seems to produce -# many `libclang_rt*` libraries, but not a single unified -# `libcompiler_rt` library, at least under certain configurations. Some -# platforms stil expect this, however, so we symlink one into place. -, forceLinkCompilerRt ? stdenv.hostPlatform.isOpenBSD -}: - -let - - useLLVM = stdenv.hostPlatform.useLLVM or false; - bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; - haveLibc = stdenv.cc.libc != null; - isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic && lib.versionAtLeast release_version "16"; - inherit (stdenv.hostPlatform) isMusl isAarch64; - - baseName = "compiler-rt"; - pname = baseName + lib.optionalString (haveLibc) "-libc"; - - src' = if monorepoSrc != null then - runCommand "${baseName}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${baseName} "$out" - '' else src; - - preConfigure = lib.optionalString (useLLVM && !haveLibc) '' - cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding") - ''; -in - -stdenv.mkDerivation ({ - inherit pname version patches; - - src = src'; - sourceRoot = if lib.versionOlder release_version "13" then null - else "${src'.name}/${baseName}"; - - nativeBuildInputs = [ cmake ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ [ python3 libllvm.dev ] - ++ lib.optional stdenv.isDarwin xcbuild.xcrun; - buildInputs = - lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders; - - env.NIX_CFLAGS_COMPILE = toString ([ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ] ++ lib.optionals (!haveLibc) [ - # The compiler got stricter about this, and there is a usellvm patch below - # which patches out the assert include causing an implicit definition of - # assert. It would be nicer to understand why compiler-rt thinks it should - # be able to #include <assert.h> in the first place; perhaps it's in the - # wrong, or perhaps there is a way to provide an assert.h. - "-Wno-error=implicit-function-declaration" - ]); - - cmakeFlags = [ - "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" - "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" - "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" - ] ++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [ - "-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include" - ] ++ lib.optionals ((useLLVM || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13")) [ - "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" - ] ++ lib.optionals (useLLVM || bareMetal || isMusl || isDarwinStatic) [ - "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" - "-DCOMPILER_RT_BUILD_XRAY=OFF" - "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" - "-DCOMPILER_RT_BUILD_MEMPROF=OFF" - "-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary - ] ++ lib.optionals (useLLVM || bareMetal) [ - "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal || isDarwinStatic) [ - "-DCMAKE_CXX_COMPILER_WORKS=ON" - ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [ - "-DCMAKE_C_COMPILER_WORKS=ON" - "-DCOMPILER_RT_BAREMETAL_BUILD=ON" - "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" - ] ++ lib.optionals (useLLVM && !haveLibc) [ - "-DCMAKE_C_FLAGS=-nodefaultlibs" - ] ++ lib.optionals (useLLVM) [ - "-DCOMPILER_RT_BUILD_BUILTINS=ON" - #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program - "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" - ] ++ lib.optionals (bareMetal) [ - "-DCOMPILER_RT_OS_DIR=baremetal" - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) (lib.optionals (lib.versionAtLeast release_version "16") [ - "-DCMAKE_LIPO=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo" - ] ++ [ - "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" - "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" - "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" - ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # `COMPILER_RT_DEFAULT_TARGET_ONLY` does not apply to Darwin: - # https://github.com/llvm/llvm-project/blob/27ef42bec80b6c010b7b3729ed0528619521a690/compiler-rt/cmake/base-config-ix.cmake#L153 - "-DCOMPILER_RT_ENABLE_IOS=OFF" - ]) ++ lib.optionals (lib.versionAtLeast version "19" && stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [ - "-DSANITIZER_MIN_OSX_VERSION=10.10" - ]; - - outputs = [ "out" "dev" ]; - - # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks - # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra - # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd - # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by - # a flag and turn the flag off during the stdenv build. - postPatch = lib.optionalString (!stdenv.isDarwin) '' - substituteInPlace cmake/builtin-config-ix.cmake \ - --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' - '' + lib.optionalString stdenv.isDarwin '' - substituteInPlace cmake/config-ix.cmake \ - --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' - '' + lib.optionalString (useLLVM && !haveLibc) ((lib.optionalString (lib.versionAtLeast release_version "18") '' - substituteInPlace lib/builtins/aarch64/sme-libc-routines.c \ - --replace "<stdlib.h>" "<stddef.h>" - '') + '' - substituteInPlace lib/builtins/int_util.c \ - --replace "#include <stdlib.h>" "" - '' + (if stdenv.hostPlatform.isFreeBSD then - # As per above, but in FreeBSD assert is a macro and simply allowing it to be implicitly declared causes Issues!!!!! - '' - substituteInPlace lib/builtins/clear_cache.c lib/builtins/cpu_model.c \ - --replace "#include <assert.h>" "#define assert(e) ((e)?(void)0:__assert(__FUNCTION__,__FILE__,__LINE__,#e))" - '' else '' - substituteInPlace lib/builtins/clear_cache.c \ - --replace "#include <assert.h>" "" - substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast version "18") "/x86"}.c \ - --replace "#include <assert.h>" "" - '')); - - # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM && stdenv.hostPlatform.isLinux) '' - ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o - ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o - # Note the history of crt{begin,end}S in previous versions of llvm in nixpkg: - # The presence of crtbegin_shared has been added and removed; it's possible - # people have added/removed it to get it working on their platforms. - # Try each in turn for now. - ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o - ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o - ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o - ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o - '' + lib.optionalString doFakeLibgcc '' - ln -s $out/lib/*/libclang_rt.builtins-*.a $out/lib/libgcc.a - '' + lib.optionalString forceLinkCompilerRt '' - ln -s $out/lib/*/libclang_rt.builtins-*.a $out/lib/libcompiler_rt.a - ''; - - meta = llvm_meta // { - homepage = "https://compiler-rt.llvm.org/"; - description = "Compiler runtime libraries"; - longDescription = '' - The compiler-rt project provides highly tuned implementations of the - low-level code generator support routines like "__fixunsdfdi" and other - calls generated when a target doesn't have a short sequence of native - instructions to implement a core IR operation. It also provides - implementations of run-time libraries for dynamic testing tools such as - AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. - ''; - # "All of the code in the compiler-rt project is dual licensed under the MIT - # license and the UIUC License (a BSD-like license)": - license = with lib.licenses; [ mit ncsa ]; - # compiler-rt requires a Clang stdenv on 32-bit RISC-V: - # https://reviews.llvm.org/D43106#1019077 - broken = stdenv.hostPlatform.isRiscV32 && !stdenv.cc.isClang; - }; -} // (if lib.versionOlder release_version "16" then { inherit preConfigure; } else {})) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch b/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch deleted file mode 100644 index 2d211795fc80..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -index 54da635..c5dc1cd 100644 ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -@@ -1158,8 +1158,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); - CHECK_SIZE_AND_OFFSET(ipc_perm, gid); - CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); - CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); --#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) --/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ -+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) -+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit -+ on many architectures. */ - CHECK_SIZE_AND_OFFSET(ipc_perm, mode); - #endif - -diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -index f89a113..f6f986f 100644 ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -213,26 +213,13 @@ namespace __sanitizer { - u64 __unused1; - u64 __unused2; - #elif defined(__sparc__) --#if defined(__arch64__) - unsigned mode; -- unsigned short __pad1; --#else -- unsigned short __pad1; -- unsigned short mode; - unsigned short __pad2; --#endif - unsigned short __seq; - unsigned long long __unused1; - unsigned long long __unused2; --#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) -- unsigned int mode; -- unsigned short __seq; -- unsigned short __pad1; -- unsigned long __unused1; -- unsigned long __unused2; - #else -- unsigned short mode; -- unsigned short __pad1; -+ unsigned int mode; - unsigned short __seq; - unsigned short __pad2; - #if defined(__x86_64__) && !defined(_LP64) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch b/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch deleted file mode 100644 index 7ef02a169269..000000000000 --- a/pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch +++ /dev/null @@ -1,80 +0,0 @@ -https://github.com/llvm/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab.patch -https://reviews.llvm.org/D102059 ---- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -@@ -370,15 +370,6 @@ static void ioctl_table_fill() { - - #if SANITIZER_GLIBC - // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE -- _(CYGETDEFTHRESH, WRITE, sizeof(int)); -- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); -- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); -- _(CYGETTHRESH, WRITE, sizeof(int)); -- _(CYGETTIMEOUT, WRITE, sizeof(int)); -- _(CYSETDEFTHRESH, NONE, 0); -- _(CYSETDEFTIMEOUT, NONE, 0); -- _(CYSETTHRESH, NONE, 0); -- _(CYSETTIMEOUT, NONE, 0); - _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); - _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); - _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t; - # include <sys/procfs.h> - #endif - #include <sys/user.h> --#include <linux/cyclades.h> - #include <linux/if_eql.h> - #include <linux/if_plip.h> - #include <linux/lp.h> -@@ -460,7 +459,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - - #if SANITIZER_GLIBC - unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); -- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); - #if EV_VERSION > (0x010000) - unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); - #else -@@ -824,15 +822,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; -- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; -- unsigned IOCTL_CYGETMON = CYGETMON; -- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; -- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; -- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; -- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; -- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; -- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; - unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; - unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; - unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz; - - #if SANITIZER_LINUX && !SANITIZER_ANDROID - extern unsigned struct_ax25_parms_struct_sz; -- extern unsigned struct_cyclades_monitor_sz; - extern unsigned struct_input_keymap_entry_sz; - extern unsigned struct_ipx_config_data_sz; - extern unsigned struct_kbdiacrs_sz; -@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE; - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- extern unsigned IOCTL_CYGETDEFTHRESH; -- extern unsigned IOCTL_CYGETDEFTIMEOUT; -- extern unsigned IOCTL_CYGETMON; -- extern unsigned IOCTL_CYGETTHRESH; -- extern unsigned IOCTL_CYGETTIMEOUT; -- extern unsigned IOCTL_CYSETDEFTHRESH; -- extern unsigned IOCTL_CYSETDEFTIMEOUT; -- extern unsigned IOCTL_CYSETTHRESH; -- extern unsigned IOCTL_CYSETTIMEOUT; - extern unsigned IOCTL_EQL_EMANCIPATE; - extern unsigned IOCTL_EQL_ENSLAVE; - extern unsigned IOCTL_EQL_GETMASTRCFG; |