-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm: factor out compiler-rt, fix libstdcxxStdenv sanitizer headers #39743
Changes from all commits
e5175fb
16da44b
46eeef1
205fc55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure LLVM is just a build tool here? So it is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reallllyyy??? No wonder you were asking about using a stand-in for llvm-config, wonder what the details here are. |
||
|
||
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; | ||
} |
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a
-B
flag in libcxxstdenv instead? That is good for parallelismThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow. Use
-B
where to do what?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, I'll just not worry about it for now.