From 9bc8b5f9c617c15ed16ea2c73af283d8926241c2 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 16 Mar 2022 10:59:13 +0100 Subject: group-base: Add clang environment In the future we might want to build certain packages with clang instead of gcc. For now this is only possible with a portage environment, which this commit adds. See also [1]. [1] https://wiki.gentoo.org/wiki/Clang#Clang_environments --- group-base/env/compiler-clang | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 group-base/env/compiler-clang diff --git a/group-base/env/compiler-clang b/group-base/env/compiler-clang new file mode 100644 index 0000000..8a10729 --- /dev/null +++ b/group-base/env/compiler-clang @@ -0,0 +1,9 @@ +LDFLAGS="${LDFLAGS} -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed" + +_HARDENING_FLAGS="-fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2" +CFLAGS="${CFLAGS} ${_HARDENING_FLAGS}" +CXXFLAGS="${CXXFLAGS} ${_HARDENING_FLAGS}" +LDFLAGS="${LDFLAGS} -Wl,-z,relro,-z,now -pie" + +CC="clang" +CXX="clang++" -- cgit v1.2.3-2-gb3c3