Created attachment 757116 [details, diff] clang.patch media-gfx/sam2p-0.49.4_p20190718-r1 fails to configure when built with clang and hardened flags are set. Steps to reproduce: 1. Set LDFLAGS to "-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -pie" 2. Set CFLAGS to "-march=native -O2 -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2" 3. Set CXXFLAGS to "-march=native -O2 -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2" 4. Attempt to emerge media-gfx/sam2p-0.49.4_p20190718-r1 5. Observe build failure Excepted results: sam2p-0.49.4_p20190718-r1 configures successfully Actual results: build fails with error: checking whether we are cross compiling... configure: error: in `/var/tmp/portage/media-gfx/sam2p-0.49.4_p20190718-r1/work/sam2p-b953f63307c4a83fa4615a4863e3fb250205cd98' config.log error: configure:2736: checking whether we are cross compiling configure:2744: clang++ -o conftest -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -pie conftest.cpp >&5 ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
Created attachment 757117 [details, diff] clang.patch clang patch to fix configure errors.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23139790af0807c7a92d0861e4601f02dd2ee808 commit 23139790af0807c7a92d0861e4601f02dd2ee808 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-01 15:59:12 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-01 16:25:43 +0000 media-gfx/sam2p: fix configure with clang Closes: https://bugs.gentoo.org/827925 Thanks-to: <nvinson234@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> .../sam2p-0.49.4_p20190718-fix-configure-clang.patch | 15 +++++++++++++++ media-gfx/sam2p/sam2p-0.49.4_p20190718-r1.ebuild | 7 +++++-- 2 files changed, 20 insertions(+), 2 deletions(-)