Merge pull request #57981 from dtzWill/fix/llvm8-musl

llvmPackages_8: fix w/musl
This commit is contained in:
Will Dietz 2019-03-20 14:49:11 -05:00 committed by GitHub
commit 7a1e8300fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DCMAKE_C_FLAGS=-nodefaultlibs"
"-DCMAKE_CXX_COMPILER_WORKS=ON"
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
@ -20,13 +20,18 @@ stdenv.mkDerivation rec {
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
"-DCOMPILER_RT_BAREMETAL_BUILD=ON"
"-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
];
outputs = [ "out" "dev" ];
patches = [
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin ./compiler-rt-clock_gettime.patch;

View file

@ -71,6 +71,8 @@ in stdenv.mkDerivation (rec {
substituteInPlace unittests/Support/CMakeLists.txt \
--replace "add_subdirectory(DynamicLibrary)" ""
rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
# valgrind unhappy with musl or glibc, but fails w/musl only
rm test/CodeGen/AArch64/wineh4.mir
'' + ''
patchShebangs test/BugPoint/compile-custom.ll.py
'';