View previous topic :: View next topic |
Author |
Message |
xo ip n00b
Joined: 06 Nov 2024 Posts: 2
|
Posted: Wed Nov 06, 2024 3:17 pm Post subject: [SOLVED] elfutils error thread support required (hardened) |
|
|
hello gentoo community,
i'm using stage3-amd64-musl-llvm-20241027T164832Z.tar.xz for installation and update it today, add manual the following to make.conf (enable hardening flags):
Code: | WARNING_FLAGS="-Werror=odr -Werror=strict-aliasing"
HARDENING_CFLAGS="-fPIC -fPIE -fstack-clash-protection -fstack-protector-strong -fcf-protection=full -D_FORTIFY_SOURCE=2"
HARDENING_LDFLAGS="-Wl,-z,relro,-z,now -pie"
COMMON_FLAGS="-march=native -O2 -pipe -flto=thin ${WARNING_FLAGS}"
CFLAGS="${COMMON_FLAGS} ${HARDENING_CFLAGS}"
CXXFLAGS="${COMMON_FLAGS} ${HARDENING_CFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed ${HARDENING_LDFLAGS}" |
Then i recompile the whole system with: Code: | emerge -e --ask --update --newuse --with-bdeps=y --quiet --deep @world |
One program failed: dev-libs/elfutils with the following error:
Code: | configure: error: __thread support required |
I then try nopie and nossp to /etc/portage/package.env from here: https://wiki.gentoo.org/wiki/Hardened_Gentoo for just elfutils.
But it's still failed but when i remove all the ${WARNING_FLAGS} ${HARDENING_CFLAGS} ${HARDENING_LDFLAGS} from make.conf like just use:
Code: | CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed" | it works.
So what i have to add to another /etc/portage/env/unknown to make it just work for dev-libs/elfutils ?
Last edited by xo ip on Wed Nov 06, 2024 5:43 pm; edited 2 times in total |
|
Back to top |
|
|
xo ip n00b
Joined: 06 Nov 2024 Posts: 2
|
Posted: Wed Nov 06, 2024 3:54 pm Post subject: |
|
|
-no-pie don't work via /etc/portage/env but removing -fPIE from HARDENING_CFLAGS works. weird.
The wiki entry is wrong ! it should be -fno-PIE and not -no-pie https://wiki.gentoo.org/wiki/Hardened_Gentoo |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 1947
|
Posted: Wed Nov 06, 2024 6:28 pm Post subject: |
|
|
Your answer doesn't seem to explain what happened here, because the default is PIE anyway - as are the other hardening flags (so no need for you to be setting it), and the only error you pointed out was something you tried to work around it? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|