On ARM64 with clang-15.0.7-r1, running 'clang -target aarch64-windows -o test test.c' fails with: clang-15: error: unsupported option '-fPIE' for target 'aarch64-unknown-windows-msvc' '-fPIE' is being added by /etc/clang/gentoo-hardened.cfg. Creating an empty '/etc/clang/aarch64-unknown-windows-msvc-clang.cfg' fixes the problem. On ARM64, Wine requires clang and uses 'clang -target aarch64-windows'. Reproducible: Always
Please add the output of emerge --info.
This is kind of an interesting-annoying one. We could just install the config file only for the native CHOST and let cross people be. I feel like that's probably the best course of action.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43a24d68531ab4ca9ad83d686a620cd2937dbf4f commit 43a24d68531ab4ca9ad83d686a620cd2937dbf4f Author: Sam James <sam@gentoo.org> AuthorDate: 2023-08-18 02:06:05 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-08-18 09:22:32 +0000 sys-devel/clang-common: only add default configs (e.g. -fPIE) for native tools We don't want to add our configs to 'clang', 'clang++', etc because that might be used for crosscompilation. Use the prefixed CHOST versions instead. [I suspect I didn't do this before because the old config logic, before we improved it upstream, didn't have the fallback behaviour for clang->${CHOST}-clang or similar.] Closes: https://bugs.gentoo.org/901247 Closes: https://bugs.gentoo.org/912237 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/clang-common/clang-common-17.0.0.9999.ebuild | 5 ++++- sys-devel/clang-common/clang-common-17.0.0_rc2-r1.ebuild | 5 ++++- sys-devel/clang-common/clang-common-18.0.0.9999.ebuild | 5 ++++- sys-devel/clang-common/clang-common-18.0.0_pre20230803.ebuild | 5 ++++- ..._pre20230810.ebuild => clang-common-18.0.0_pre20230810-r1.ebuild} | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-)