-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41081 from obsidiansystems/compiler-rt-master
llvm 6: Master version of #39743
- Loading branch information
Showing
7 changed files
with
70 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ stdenv, version, fetch, cmake, python, llvm }: | ||
with stdenv.lib; | ||
stdenv.mkDerivation rec { | ||
name = "compiler-rt-${version}"; | ||
inherit version; | ||
src = fetch "compiler-rt" "16m7rvh3w6vq10iwkjrr1nn293djld3xm62l5zasisaprx117k6h"; | ||
|
||
nativeBuildInputs = [ cmake python llvm ]; | ||
|
||
configureFlags = [ | ||
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" | ||
]; | ||
|
||
outputs = [ "dev" "out" ]; | ||
|
||
patches = [ | ||
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory | ||
] ++ optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch; | ||
|
||
# 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 = stdenv.lib.optionalString stdenv.isDarwin '' | ||
substituteInPlace cmake/config-ix.cmake \ | ||
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' | ||
''; | ||
|
||
enableParallelBuilding = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <sanitizer/asan_interface.h> | ||
#include <stdio.h> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
fprintf(stderr, "ok\n"); | ||
return 0; | ||
} |