-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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: Fix compiler-rt missing sanitizers when using useLLVM #297144
Conversation
eb2870d
to
a1f0bce
Compare
"-DCOMPILER_RT_BUILD_SANITIZERS=ON" | ||
"-DCOMPILER_RT_BUILD_PROFILE=ON" | ||
] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal || isMusl || isDarwinStatic) [ | ||
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF" | ||
"-DCOMPILER_RT_BUILD_PROFILE=OFF" |
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.
For stuff like this, we're probably best of transitioning to
(lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" condition-for-sanitizers)
(lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" condition-for-profile)
i.e. instead of conditionally passing flags, we should always pass flags, and conditionally set the values the flags specify.
I like the fix and general approach. I note that nixpkgs LLVM has changed a fair amount, so this will need reimplementing. Thankfully, you should only need to implement it once for all LLVM versions, since they were made to share 'common' nixpkgs sources. |
I plan on re-implementing this now. |
a1f0bce
to
f114796
Compare
d9e0296
to
dd857ca
Compare
dd857ca
to
a398ed2
Compare
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.
Result of nixpkgs-review
run on aarch64-linux 1
21 packages marked as broken and skipped:
- bintoolsDualAs
- darwin.autoSignDarwinBinariesHook
- darwin.binutils
- darwin.binutils-unwrapped
- darwin.binutils-unwrapped.man
- darwin.binutils.man
- darwin.binutilsDualAs
- darwin.binutilsDualAs-unwrapped
- darwin.binutilsNoLibc
- darwin.binutilsNoLibc.man
- darwin.cctools
- darwin.cctools-llvm
- darwin.cctools-llvm.dev
- darwin.cctools-llvm.man
- darwin.cctools.dev
- darwin.cctools.gas
- darwin.cctools.man
- darwin.postLinkSignHook
- darwin.signingUtils
- macdylibbundler
- ns-3
72 packages failed to build:
- aapt
- adoptopenjdk-icedtea-web
- apktool
- betterbird
- betterbird-unwrapped
- betterbird-unwrapped.debug
- diffoscope
- diffoscope.dist
- diffoscope.man
- eyewitness
- feishu
- firefox
- firefox-beta
- firefox-beta-unwrapped
- firefox-beta-unwrapped.debug
- firefox-beta-unwrapped.symbols
- firefox-devedition
- firefox-devedition-unwrapped
- firefox-devedition-unwrapped.debug
- firefox-devedition-unwrapped.symbols
- firefox-esr
- firefox-esr-115-unwrapped
- firefox-esr-115-unwrapped.debug
- firefox-esr-115-unwrapped.symbols
- firefox-esr-128
- firefox-esr-128-unwrapped
- firefox-esr-128-unwrapped.debug
- firefox-esr-128-unwrapped.symbols
- firefox-mobile
- firefox-unwrapped
- firefox-unwrapped.debug
- firefox-unwrapped.symbols
- firefoxpwa
- floorp
- floorp-unwrapped
- floorp-unwrapped.debug
- gnss-sdr
- gnuradio
- gnuradioPackages.osmosdr
- gnuradioPackages.osmosdr.dev
- irods
- irods-icommands
- libcxx
- libcxx.dev
- libcxxStdenv
- librewolf
- librewolf-unwrapped
- librewolf-unwrapped.debug
- llvmPackages_12.clangNoLibc
- llvmPackages_12.clangNoLibcxx
- llvmPackages_12.clangUseLLVM
- llvmPackages_12.clangWithLibcAndBasicRtAndLibcxx
- llvmPackages_12.compiler-rt-no-libc
- llvmPackages_12.compiler-rt-no-libc.dev
- llvmPackages_12.libcxx
- llvmPackages_12.libcxx.dev
- llvmPackages_12.libcxxClang
- llvmPackages_12.libcxxStdenv
- llvmPackages_12.libunwind
- llvmPackages_12.libunwind.dev
- pocl
- python311Packages.pygccxml
- python311Packages.pygccxml.dist
- python312Packages.pygccxml
- python312Packages.pygccxml.dist
- sbt-with-scala-native
- sitespeed-io
- slimerjs
- thunderbird
- thunderbird-unwrapped
- thunderbird-unwrapped.debug
- thunderbird-unwrapped.symbols
|
a398ed2
to
6ac7971
Compare
Thanks @RossComputerGuy. That made me look harder at the compiler-rt file again, and I found some things to fix. Looking forward to mass rebuild cleanups sometime later! :) |
Sweet, that's working great so far. 13 building, 33 built, 69 to go. |
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.
Result of nixpkgs-review
run on aarch64-linux 1
21 packages marked as broken and skipped:
- bintoolsDualAs
- darwin.autoSignDarwinBinariesHook
- darwin.binutils
- darwin.binutils-unwrapped
- darwin.binutils-unwrapped.man
- darwin.binutils.man
- darwin.binutilsDualAs
- darwin.binutilsDualAs-unwrapped
- darwin.binutilsNoLibc
- darwin.binutilsNoLibc.man
- darwin.cctools
- darwin.cctools-llvm
- darwin.cctools-llvm.dev
- darwin.cctools-llvm.man
- darwin.cctools.dev
- darwin.cctools.gas
- darwin.cctools.man
- darwin.postLinkSignHook
- darwin.signingUtils
- macdylibbundler
- ns-3
42 packages failed to build:
- adoptopenjdk-icedtea-web
- betterbird
- betterbird-unwrapped
- betterbird-unwrapped.debug
- eyewitness
- firefox
- firefox-beta
- firefox-beta-unwrapped
- firefox-beta-unwrapped.debug
- firefox-beta-unwrapped.symbols
- firefox-devedition
- firefox-devedition-unwrapped
- firefox-devedition-unwrapped.debug
- firefox-devedition-unwrapped.symbols
- firefox-esr
- firefox-esr-115-unwrapped
- firefox-esr-115-unwrapped.debug
- firefox-esr-115-unwrapped.symbols
- firefox-esr-128
- firefox-esr-128-unwrapped
- firefox-esr-128-unwrapped.debug
- firefox-esr-128-unwrapped.symbols
- firefox-mobile
- firefox-unwrapped
- firefox-unwrapped.debug
- firefox-unwrapped.symbols
- firefoxpwa
- floorp
- floorp-unwrapped
- floorp-unwrapped.debug
- irods
- irods-icommands
- librewolf
- librewolf-unwrapped
- librewolf-unwrapped.debug
- pocl
- sitespeed-io
- slimerjs
- thunderbird
- thunderbird-unwrapped
- thunderbird-unwrapped.debug
- thunderbird-unwrapped.symbols
30 packages built:
- aapt
- apktool
- diffoscope
- diffoscope.dist
- diffoscope.man
- feishu
- gnss-sdr
- gnuradio
- gnuradioPackages.osmosdr
- gnuradioPackages.osmosdr.dev
- libcxx
- libcxx.dev
- libcxxStdenv
- llvmPackages_12.clangNoLibc
- llvmPackages_12.clangNoLibcxx
- llvmPackages_12.clangUseLLVM
- llvmPackages_12.clangWithLibcAndBasicRtAndLibcxx
- llvmPackages_12.compiler-rt-no-libc
- llvmPackages_12.compiler-rt-no-libc.dev
- llvmPackages_12.libcxx
- llvmPackages_12.libcxx.dev
- llvmPackages_12.libcxxClang
- llvmPackages_12.libcxxStdenv
- llvmPackages_12.libunwind
- llvmPackages_12.libunwind.dev
- python311Packages.pygccxml
- python311Packages.pygccxml.dist
- python312Packages.pygccxml
- python312Packages.pygccxml.dist
- sbt-with-scala-native
ac2c768
to
7bea7b5
Compare
@RossComputerGuy The remaining changes are due to If you want to run another |
Can't now but will do after work. |
(After #329706, this should be an easy backport, and I believe it is safe too --- worse that happens is you get a more featureful compiler-rt than before, yay.) |
7bea7b5
to
344902e
Compare
I am not sure I did |
Successfully created backport PR for |
This partially broke the PR #329995 since valgrind does a static binary and sanitizers rely on getauxval which isn't in |
Attempts to address #97688 by refactoring the llvm/16 toolchain build to make more sense.
The build order is now:
{compiler-rt-no-libc}
{compiler-rt-no-libc, libc}
{compiler-rt-no-libc, libc, libc++}
{compiler-rt-no-libc, libc, libc++, compiler-rt-libc}
The names of the stages have been updated to reflect this.
This is a follow up for #267814 where I screwed up the rebase and managed to ping too many people. Apologies!
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.