-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
Support compiling with LLVM #510
Conversation
I don't know why the CI for FreeBSD is failing. |
@nobounce It stops because of wrong A solution would be to instead increment a error counter variable and if the version checks for both |
3ae6d65
to
37bc27e
Compare
@nobounce Installed packages: Am I missing something? |
Seems like
|
@nobounce Not sure why, but the binary compiled by clang is 2.0MiB compared to 1.5MiB by gcc, with the same optimization flags? Will take a closer look at the changes this week, but since it's passing compile for all platforms now it's looking good. Nice work! 👍🏼 |
For what I know, Clang does more aggressive loop unrolling with |
That seems reasonable to me. |
check. Clang cannot handle <semaphore> being included in a namespace, which is also unadvised see: https://softwareengineering.stackexchange.com/a/335261. Using the fallback <semaphore.h> is only meant for GCC 10, but Clang defines `__GNUC__ = 4` so exclude Clang.
On my musl system statvfs64 is not exposed by default. The musl FAQ recommends against using type64_t types, see: https://wiki.musl-libc.org/faq.html#Q:-Do-I-need-to-define-%3Ccode%3E_LARGEFILE64_SOURCE%3C/code%3E-to-get-64bit-%3Ccode%3Eoff_t%3C/code%3E?. Defining `_FILE_OFFSET_BITS=64` and using type_t lets type_t use the 64 bit interface, see: https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fFILE_005fOFFSET_005fBITS.
Returning from the thread this way prevents local variables to be destructed correctly since pthread_exit is marked noreturn. This fixes a segmentation fault with glibc and llvm-libunwind on exit.
Clang 16.0.0 or later can now be used to compile btop. Simply call `CXX=clang++` make. If the CXX variable contains an incompatible Clang version try to fallback to GCC.
@aristocratos |
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.
Maybe coupled with a new release so (source-based-)distros can take advantage of this and remove gcc as a dependency :)
I can't imagine that many distros have clang16 included by default yet?
Gpu support should be done in a little while, and are planning to do a release with a minor version bump then.
Yeah, probably not many :) |
FYI, Gentoo has clang 16, but only on the testing branch. LLVM 16 is not yet stabilized because of those various issues. |
Support LLVM as toolchain. Set
CXX=clang++
to compile with LLVM instead of GCC.Only works with Clang/LLVM 16.0.0 and higher.
This may not work on all supported variants, feedback appreciated.
Closes: #490
Closes: #508