summaryrefslogtreecommitdiffstats
path: root/group-base
diff options
context:
space:
mode:
authorWolfgang Müller2022-03-16 10:59:13 +0100
committerWolfgang Müller2022-03-16 11:00:22 +0100
commit9bc8b5f9c617c15ed16ea2c73af283d8926241c2 (patch)
tree095944dd486576ba7a08a78116a3c5796a2d53b0 /group-base
parent5a0caabf8d7de2621633433fa78606b9e1b3022f (diff)
downloadportage-roles-9bc8b5f9c617c15ed16ea2c73af283d8926241c2.tar.gz
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
Diffstat (limited to 'group-base')
-rw-r--r--group-base/env/compiler-clang9
1 files changed, 9 insertions, 0 deletions
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++"