Summary: | sys-devel/gcc-14.1.1_p20240518 - [icu-75.1] [llvm] cc1: error: -fcf-protection is not compatible with this target | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | lockalsash, sam, zachariah.cabelly |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=928460 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
emerge-info.txt
emerge-history.txt environment etc.clang.tar.xz etc.portage.tar.xz gcc-build-logs.tar.xz logs.tar.xz qlist-info.txt sys-devel:gcc-14.1.1_p20240518:20240607-185945.log.xz temp.tar.xz |
Description
Toralf Förster
![]() Created attachment 895335 [details]
emerge-info.txt
Created attachment 895336 [details]
emerge-history.txt
Created attachment 895337 [details]
environment
Created attachment 895338 [details]
etc.clang.tar.xz
Created attachment 895339 [details]
etc.portage.tar.xz
Created attachment 895340 [details]
gcc-build-logs.tar.xz
Created attachment 895341 [details]
logs.tar.xz
Created attachment 895342 [details]
qlist-info.txt
Created attachment 895343 [details]
sys-devel:gcc-14.1.1_p20240518:20240607-185945.log.xz
Created attachment 895344 [details]
temp.tar.xz
*** Bug 934790 has been marked as a duplicate of this bug. *** Happens when building with Clang. Wasn't bug 928460 supposed to fix this? Well apparently, it didn't (In reply to zachariah.cabelly from comment #14) > Well apparently, it didn't It wasn't really a question to you, more a note to whoever is going to work on it... (In reply to Sam James from comment #15) > (In reply to zachariah.cabelly from comment #14) > > Well apparently, it didn't > > It wasn't really a question to you, more a note to whoever is going to work > on it... Ok, I was making a joke, but to each their own Forcing GCC on sys-devel/gcc in the meantime. That's the workaround I have. Root cause: xgcc (bootstrapper) in 14.1.1 does not resolve `-march=native`, then in cc1 invocation there is no -march=..., due to `-m32` cc1 fallbacks to some ancient i386, which does not support stack-protection. This problem applies only to xgcc; final gcc-14 resolves `-march=native` fine. The issue occurs only with `sys-devel/gcc[hardened]`. Workaround in make.conf: replace `-march=native` with `-march=<whatever arch you use>`. Or remove `-march=native` (in that case xgcc adds `-march=x86-64` to cc1 which prevents fallback to i386). Minimal reproducer: /var/tmp/portage/sys-devel/gcc-14.1.1_p20240622/work/build/gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-14.1.1_p20240622/work/build/gcc/ -march=native -m32 -fcf-protection test.c -### 2>&1 | grep cc1 >>> .../cc1 ... test.c ... -m32 "-fcf-protection=full" ... It worked fine in gcc-13.2.1: /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/build/gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/build/gcc/ -march=native -m32 -fcf-protection test.c -### 2>&1 | grep cc1 >>> .../cc1 ... test.c "-march=znver4" -mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -msse4a -mno-fma4 -mno-xop -mfma -mavx512f -mbmi -mbmi2 -maes -mpclmul -mavx512vl -mavx512bw -mavx512dq -mavx512cd -mno-avx512er -mno-avx512pf -mavx512vbmi -mavx512ifma -mno-avx5124vnniw -mno-avx5124fmaps -mavx512vpopcntdq -mavx512vbmi2 ... -m32 "-fcf-protection=full" ... (In reply to Sv. Lockal from comment #18) > Root cause: xgcc (bootstrapper) in 14.1.1 does not resolve `-march=native`, > then in cc1 invocation there is no -march=..., due to `-m32` cc1 fallbacks > to some ancient i386, which does not support stack-protection. This problem > applies only to xgcc; final gcc-14 resolves `-march=native` fine. > Note that depending on the point in the process you're at, `xgcc` is sometimes just a wrapper around the original CC (e.g. clang). But if it worked with GCC 13, that's obviously far more curious... |