llvmPackages_{12,13,14,15,16,17,18,19,20,git}.compiler-rt: optional string cflags link
This commit is contained in:
committed by
Alyssa Ross
parent
c9ba38546b
commit
a413234974
@@ -147,26 +147,24 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders
|
||||
++ lib.optional (stdenv.hostPlatform.isFreeBSD) freebsd.include;
|
||||
|
||||
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"
|
||||
]
|
||||
);
|
||||
}
|
||||
// lib.optionalAttrs (stdenv.hostPlatform.isDarwin) {
|
||||
# Work around clang’s trying to invoke unprefixed-ld on Darwin when `-target` is passed.
|
||||
NIX_CFLAGS_LINK = "--ld-path=${stdenv.cc.bintools}/bin/${stdenv.cc.targetPrefix}ld";
|
||||
};
|
||||
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"
|
||||
]
|
||||
);
|
||||
|
||||
# Work around clang’s 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 =
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user