# Copyright 2021-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # this is for now highly experimental -dilfridge # use clang as the primary compiler CC="clang" CXX="clang++" # libtool needs this LD="ld.lld" # linker flags # We don't set LDFLAGS here for linker, rtlib, etc because clang-common enforces # the needed bits for us and it confuses clang->gcc for stuff like Fortran, # see bug #908798. LDFLAGS="${LDFLAGS} -Wl,--as-needed" # use LLVM-provided binutils AR="llvm-ar" AS="clang -c" CPP="clang-cpp" NM="llvm-nm" STRIP="llvm-strip" RANLIB="llvm-ranlib" OBJCOPY="llvm-objcopy" STRINGS="llvm-strings" OBJDUMP="llvm-objdump" READELF="llvm-readelf" ADDR2LINE="llvm-addr2line" # Rust needs this to build some crates (like uutils) # https://github.com/rust-lang/rust/blob/master/compiler/rustc_llvm/build.rs LLVM_USE_LIBCXX="1" # https://github.com/rust-lang/cc-rs#c-support # https://github.com/rust-lang/cc-rs/blob/main/src/lib.rs CXXSTDLIB="c++" # bootstrap USE for stage1 # curl needed by cmake BOOTSTRAP_USE="${BOOTSTRAP_USE} ssl curl_ssl_openssl" # llvm-core/llvm BOOTSTRAP_USE="${BOOTSTRAP_USE} -binutils-plugin" # llvm-core/clang, llvm-core/clang-runtime, llvm-runtimes/libunwind, llvm-runtimes/libcxx, llvm-runtimes/libcxxabi BOOTSTRAP_USE="${BOOTSTRAP_USE} compiler-rt clang libunwind" # llvm-core/clang BOOTSTRAP_USE="${BOOTSTRAP_USE} default-compiler-rt default-lld default-libcxx llvm-libunwind" # llvm-core/clang-runtime BOOTSTRAP_USE="${BOOTSTRAP_USE} libcxx -sanitize" # llvm-runtimes/libcxxabi BOOTSTRAP_USE="${BOOTSTRAP_USE} libcxxabi" # llvm & clang: explicitly disable all extra targets, otherwise linking stage2 fails BOOTSTRAP_USE="${BOOTSTRAP_USE} -llvm_targets_BPF -llvm_targets_AMDGPU -llvm_targets_NVPTX -llvm_targets_BPF"