Skip to content
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

Merged
merged 6 commits into from
Jun 15, 2023
Merged

Support compiling with LLVM #510

merged 6 commits into from
Jun 15, 2023

Commits on May 25, 2023

  1. Configuration menu
    Copy the full SHA
    922b647 View commit details
    Browse the repository at this point in the history
  2. Move #include to top level and exclude Clang from compiler version

    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.
    imwints committed May 25, 2023
    Configuration menu
    Copy the full SHA
    34ae6d9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7dac850 View commit details
    Browse the repository at this point in the history
  4. Replace statvfs64 with statvfs and define _FILE_OFFSET_BITS=64.

    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.
    imwints committed May 25, 2023
    Configuration menu
    Copy the full SHA
    a2fa9da View commit details
    Browse the repository at this point in the history
  5. Remove pthread_exit().

    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.
    imwints committed May 25, 2023
    Configuration menu
    Copy the full SHA
    a5e4969 View commit details
    Browse the repository at this point in the history
  6. Enable Clang as a compiler.

    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.
    imwints committed May 25, 2023
    Configuration menu
    Copy the full SHA
    dec9fa1 View commit details
    Browse the repository at this point in the history