diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-12-22 14:08:05 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-12-22 14:08:05 +0000 |
commit | 93a93e9a3b53c1a73142a305ea1f8136846942ee (patch) | |
tree | b9791a06ab3284e27b568412c59316c66240c682 /profiles/features/clang/make.defaults | |
parent | 2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff) |
gentoo resync : 22.12.2021
Diffstat (limited to 'profiles/features/clang/make.defaults')
-rw-r--r-- | profiles/features/clang/make.defaults | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/profiles/features/clang/make.defaults b/profiles/features/clang/make.defaults new file mode 100644 index 000000000000..7674593179f7 --- /dev/null +++ b/profiles/features/clang/make.defaults @@ -0,0 +1,67 @@ +# Copyright 2021 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 +LDFLAGS="${LDFLAGS} -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed" + +## hardening flags +#SOME_HARDENING_CFLAGS="-fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2" +#SOME_HARDENING_LDFLAGS="-Wl,-z,relro,-z,now -pie" +# +# we need to eventually do this the same way as in gcc, for now let's +# keep it to a minimum +SOME_HARDENING_CFLAGS="-D_FORTIFY_SOURCE=2" +SOME_HARDENING_LDFLAGS="" + +# enable hardening by default, cf. gcc[pie,ssp] +CFLAGS="${CFLAGS} ${SOME_HARDENING_FLAGS}" +CXXFLAGS="${CXXFLAGS} ${SOME_HARDENING_FLAGS}" +LDFLAGS="${LDFLAGS} ${SOME_HARDENING_LDFLAGS}" + +# use LLVM-provided binutils +AR="llvm-ar" +AS="llvm-as" +NM="llvm-nm" +STRIP="llvm-strip" +RANLIB="llvm-ranlib" +OBJCOPY="llvm-objcopy" +STRINGS="llvm-strings" +OBJDUMP="llvm-objdump" +READELF="llvm-readelf" +ADDR2LINE="llvm-addr2line" + + +# bootstrap USE for stage1 + +# curl needed by cmake +BOOTSTRAP_USE="${BOOTSTRAP_USE} ssl curl_ssl_openssl" + +# Clang needs this +BOOTSTRAP_USE="${BOOTSTRAP_USE} python_single_target_python3_9" + +# sys-devel/llvm +BOOTSTRAP_USE="${BOOTSTRAP_USE} -gold" + +# sys-devel/clang, sys-devel/clang-runtime, sys-libs/llvm-libunwind, sys-libs/libcxx, sys-libs/libcxxabi +BOOTSTRAP_USE="${BOOTSTRAP_USE} compiler-rt clang libunwind" + +# sys-devel/clang +BOOTSTRAP_USE="${BOOTSTRAP_USE} default-compiler-rt default-lld default-libcxx llvm-libunwind" + +# sys-devel/clang-runtime +BOOTSTRAP_USE="${BOOTSTRAP_USE} libcxx -sanitize" + +# sys-libs/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" |