push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,162 @@
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

View File

@@ -0,0 +1,25 @@
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)

View File

@@ -0,0 +1,292 @@
{
lib,
stdenv,
llvm_meta,
release_version,
version,
src ? null,
monorepoSrc ? null,
runCommand,
cmake,
ninja,
python3,
libllvm,
jq,
libcxx,
linuxHeaders,
freebsd,
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 still expect this, however, so we symlink one into place.
forceLinkCompilerRt ? stdenv.hostPlatform.isOpenBSD,
devExtraCmakeFlags ? [ ],
getVersionFile,
fetchpatch,
}:
let
useLLVM = stdenv.hostPlatform.useLLVM or false;
bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none";
haveLibc = stdenv.cc.libc != null;
# TODO: Make this account for GCC having libstdcxx, which will help
# use clean up the `cmakeFlags` rats nest below.
haveLibcxx = stdenv.cc.libcxx != null;
isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic;
inherit (stdenv.hostPlatform) isMusl isAarch64 isWindows;
noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic || isWindows;
in
stdenv.mkDerivation (finalAttrs: {
pname = "compiler-rt${lib.optionalString haveLibc "-libc"}";
inherit version;
src =
if monorepoSrc != null then
runCommand "compiler-rt-src-${version}" { inherit (monorepoSrc) passthru; } (
''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
''
+ lib.optionalString (lib.versionAtLeast release_version "21") ''
cp -r ${monorepoSrc}/third-party "$out"
''
+ ''
cp -r ${monorepoSrc}/compiler-rt "$out"
''
)
else
src;
sourceRoot = "${finalAttrs.src.name}/compiler-rt";
patches = [
(getVersionFile "compiler-rt/X86-support-extension.patch") # Add support for i486 i586 i686 by reusing i386 config
# ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
# extra `/`.
(getVersionFile "compiler-rt/normalize-var.patch")
# Fix build on armv6l
./armv6-no-ldrexd-strexd.patch
# See: https://github.com/NixOS/nixpkgs/pull/186575
./darwin-plistbuddy-workaround.patch
]
++ [
(getVersionFile "compiler-rt/armv6-scudo-libatomic.patch")
]
++ lib.optional (lib.versions.major release_version == "19") (fetchpatch {
url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch";
hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no=";
relative = "compiler-rt";
});
nativeBuildInputs = [
cmake
python3
libllvm.dev
ninja
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ jq ];
buildInputs =
lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders
++ lib.optional (stdenv.hostPlatform.isFreeBSD) freebsd.include;
env = {
NIX_CFLAGS_COMPILE = toString (
[
"-DSCUDO_DEFAULT_OPTIONS=delete_size_mismatch=false:dealloc_type_mismatch=false"
]
++ 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"
]
);
# Work around clangs trying to invoke unprefixed-ld on Darwin when `-target` is passed.
NIX_CFLAGS_LINK = lib.optionalString (stdenv.hostPlatform.isDarwin) "--ld-path=${stdenv.cc.bintools}/bin/${stdenv.cc.targetPrefix}ld";
};
cmakeFlags = [
(lib.cmakeBool "COMPILER_RT_DEFAULT_TARGET_ONLY" true)
(lib.cmakeFeature "CMAKE_C_COMPILER_TARGET" stdenv.hostPlatform.config)
(lib.cmakeFeature "CMAKE_ASM_COMPILER_TARGET" stdenv.hostPlatform.config)
]
++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [
(lib.cmakeFeature "SANITIZER_COMMON_CFLAGS" "-I${libxcrypt}/include")
]
++ lib.optionals (useLLVM && haveLibc && stdenv.cc.libcxx == libcxx) [
(lib.cmakeFeature "SANITIZER_CXX_ABI" "libcxxabi")
(lib.cmakeFeature "SANITIZER_CXX_ABI_LIBNAME" "libcxxabi")
(lib.cmakeBool "COMPILER_RT_USE_BUILTINS_LIBRARY" true)
]
++ lib.optionals (useLLVM && haveLibc) [
(lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true)
(lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true)
]
++ lib.optionals noSanitizers [
(lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" false)
]
++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [
(lib.cmakeBool "COMPILER_RT_BUILD_XRAY" false)
(lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false)
(lib.cmakeBool "COMPILER_RT_BUILD_MEMPROF" false)
(lib.cmakeBool "COMPILER_RT_BUILD_ORC" false) # may be possible to build with musl if necessary
]
++ lib.optionals (!haveLibc || bareMetal) [
(lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" false)
(lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true)
(lib.cmakeBool "COMPILER_RT_BAREMETAL_BUILD" true)
(lib.cmakeFeature "CMAKE_SIZEOF_VOID_P" (toString (stdenv.hostPlatform.parsed.cpu.bits / 8)))
]
++ lib.optionals (!haveLibc || bareMetal || isDarwinStatic) [
(lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true)
]
++ lib.optionals (!haveLibc) [
(lib.cmakeFeature "CMAKE_C_FLAGS" "-nodefaultlibs")
]
++ lib.optionals useLLVM [
(lib.cmakeBool "COMPILER_RT_BUILD_BUILTINS" true)
#https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
(lib.cmakeFeature "CMAKE_TRY_COMPILE_TARGET_TYPE" "STATIC_LIBRARY")
]
++ lib.optionals bareMetal [
(lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal")
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) (
[
(lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo")
]
++ lib.optionals (!haveLibcxx) [
# Darwin fails to detect that the compiler supports the `-g` flag when there is no libc++ during the
# compiler-rt bootstrap, which prevents compiler-rt from building. The `-g` flag is required by the
# Darwin support, so force it to be enabled during the first stage of the compiler-rt bootstrap.
(lib.cmakeBool "COMPILER_RT_HAS_G_FLAG" true)
]
++ [
(lib.cmakeFeature "DARWIN_osx_ARCHS" stdenv.hostPlatform.darwinArch)
(lib.cmakeFeature "DARWIN_osx_BUILTIN_ARCHS" stdenv.hostPlatform.darwinArch)
(lib.cmakeFeature "SANITIZER_MIN_OSX_VERSION" stdenv.hostPlatform.darwinMinVersion)
# `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
(lib.cmakeBool "COMPILER_RT_ENABLE_IOS" false)
]
)
++ lib.optionals (noSanitizers && lib.versionAtLeast release_version "19") [
(lib.cmakeBool "COMPILER_RT_BUILD_CTX_PROFILE" false)
]
++
lib.optional (stdenv.hostPlatform.isAarch64 && !haveLibc)
# Fixes https://github.com/NixOS/nixpkgs/issues/393603
(lib.cmakeBool "COMPILER_RT_DISABLE_AARCH64_FMV" true)
++ devExtraCmakeFlags;
outputs = [
"out"
"dev"
];
postPatch =
lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace-fail 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
''
+ lib.optionalString (!haveLibc) (
(lib.optionalString (lib.versions.major release_version == "18") ''
substituteInPlace lib/builtins/aarch64/sme-libc-routines.c \
--replace-fail "<stdlib.h>" "<stddef.h>"
'')
+ ''
substituteInPlace lib/builtins/int_util.c \
--replace-fail "#include <stdlib.h>" ""
''
+ (lib.optionalString (!stdenv.hostPlatform.isFreeBSD)
# On FreeBSD, assert/static_assert are macros and allowing them to be implicitly declared causes link errors.
# see description above for why we're nuking assert.h normally but that doesn't work here.
# instead, we add the freebsd.include dependency explicitly
''
substituteInPlace lib/builtins/clear_cache.c \
--replace-fail "#include <assert.h>" ""
substituteInPlace lib/builtins/cpu_model/x86.c \
--replace-fail "#include <assert.h>" ""
''
)
)
+
lib.optionalString (lib.versionAtLeast release_version "19")
# codesign in sigtool doesn't support the various options used by the build
# and is present in the bootstrap-tools. Removing find_program prevents the
# build from trying to use it and failing.
''
substituteInPlace cmake/Modules/AddCompilerRT.cmake \
--replace-fail 'find_program(CODESIGN codesign)' ""
'';
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
cmakeFlagsArray+=(
"-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT"
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")"
)
'';
# Hack around weird upstream 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
];
broken =
# compiler-rt requires a Clang stdenv on 32-bit RISC-V:
# https://reviews.llvm.org/D43106#1019077
(stdenv.hostPlatform.isRiscV32 && !stdenv.cc.isClang)
# emutls wants `<pthread.h>` which isn't available (without experimental WASM threads proposal).
# `enable_execute_stack.c` Also doesn't sound like something WASM would support.
|| (stdenv.hostPlatform.isWasm && haveLibc);
};
})