# default/linux/amd64/23.0/llvm # emerge -Ov1e llvm-core/clang-runtime These are the packages that would be merged, in order: [ebuild R ] llvm-core/clang-runtime-19.1.4:19::gentoo USE="compiler-rt libcxx openmp -sanitize" ABI_X86="(32) (64) (-x32)" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB >>> Verifying ebuild manifests >>> Running pre-merge checks for llvm-core/clang-runtime-19.1.4 clang-cpp: warning: argument unused during compilation: '-E' [-Wunused-command-line-argument] * You seem to be using clang as a system compiler. As of clang-16, ... The warning message: > clang-cpp: warning: argument unused during compilation: '-E' [-Wunused-command-line-argument] is unexpected, shoule be hidden or silented? Reproducible: Always
The profile sets CPP=clang-cpp, which apparently does not accept a -E flag. Should probably change tc-get-compiler-type from this: local res=$($(tc-getCPP "$@") -E -P - <<<"${code}") to this: local res=$($(tc-getCC "$@") -E -P - <<<"${code}")
(In reply to Mike Gilbert from comment #1) > The profile sets CPP=clang-cpp, which apparently does not accept a -E flag. > > Should probably change tc-get-compiler-type from this: > > local res=$($(tc-getCPP "$@") -E -P - <<<"${code}") > > to this: > > local res=$($(tc-getCC "$@") -E -P - <<<"${code}") And normally an unset CPP would be gcc -E either way? So its double wrong with gcc -E -E. So another valid solution is to remove -E from this. local res=$($(tc-getCPP "$@") -E -P - <<<"${code}")
Sent a patch for review. https://archives.gentoo.org/gentoo-dev/20250205181010.1968506-1-floppym@gentoo.org/T/#u
(In reply to Alfred Wingate from comment #2) The function is meant to test the compiler, not the preprocessor, so I think tc-getCC makes more sense.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1e7d1e7a213a08d6acc94d6b10628259ba49517 commit a1e7d1e7a213a08d6acc94d6b10628259ba49517 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2025-02-05 17:09:11 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2025-02-16 18:37:15 +0000 toolchain-funcs.eclass: avoid using tc-getCPP in compiler checks We usually want to invoke cc -E rather than cpp directly. We should not rely on the quirk of tc-getCPP defaulting to "cc -E" when CPP is unset. Resolves a warning when CPP is set to llvm-cpp, which does not accept the -E option. Closes: https://bugs.gentoo.org/949340 Signed-off-by: Mike Gilbert <floppym@gentoo.org> eclass/toolchain-funcs.eclass | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)