Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intel_adsp: xt-clang: unknown warning group -Wunknown-warning-option. #84138

Open
gbarkadiusz opened this issue Jan 17, 2025 · 2 comments · May be fixed by #84065 or #84176
Open

intel_adsp: xt-clang: unknown warning group -Wunknown-warning-option. #84138

gbarkadiusz opened this issue Jan 17, 2025 · 2 comments · May be fixed by #84065 or #84176
Assignees
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug

Comments

@gbarkadiusz
Copy link
Collaborator

Describe the bug
intel_adsp/ace15_mtpm/sim

INFO    - 1) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc on intel_adsp/ace15_mtpm/sim error (Build failure)
INFO    - 2) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc_negative_testing on intel_adsp/ace15_mtpm/sim error (Build failure)
INFO    - 3) tests/lib/mem_alloc/libraries.libc.picolibc.mem_alloc on intel_adsp/ace15_mtpm/sim error (Build failure)
INFO    - 4) tests/kernel/mem_protect/stack_random/kernel.memory_protection.stack_random on intel_adsp/ace15_mtpm/sim error (Build failure)

intel_adsp/ace30/ptl/sim

INFO    - 1) tests/kernel/mem_protect/stack_random/kernel.memory_protection.stack_random on intel_adsp/ace30/ptl/sim error (Build failure)
INFO    - 2) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc on intel_adsp/ace30/ptl/sim error (Build failure)
INFO    - 3) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc_negative_testing on intel_adsp/ace30/ptl/sim error (Build failure)
INFO    - 4) tests/lib/mem_alloc/libraries.libc.picolibc.mem_alloc on intel_adsp/ace30/ptl/sim error (Build failure)

intel_adsp/ace20_lnl/sim

INFO    - 1) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc on intel_adsp/ace20_lnl/sim error (Build failure)
INFO    - 2) tests/lib/mem_alloc/libraries.libc.minimal.mem_alloc_negative_testing on intel_adsp/ace20_lnl/sim error (Build failure)
INFO    - 3) tests/lib/mem_alloc/libraries.libc.picolibc.mem_alloc on intel_adsp/ace20_lnl/sim error (Build failure)
INFO    - 4) tests/kernel/mem_protect/stack_random/kernel.memory_protection.stack_random on intel_adsp/ace20_lnl/sim error (Build failure)

To Reproduce
twister -p intel_adsp/ace20_lnl/sim -T tests/lib/mem_alloc/

Logs and console output
/tests/lib/mem_alloc/src/main.c:24:32: error: unknown warning group '-Walloc-size-larger-than=', ignored [-Werror,-Wunknown-warning-option] #pragma GCC diagnostic ignored "-Walloc-size-larger-than="

Environment:

  • OS: Linux
  • Toolchain: xt-clang
  • Commit SHA or Version used: v4.0.0-3486-g4cc76e8a9ae3

Additional context
b9d7b1b is the first bad commit

commit b9d7b1bdae9b41d3a73070536821c481f77633f1
Author: Tom Hughes <[email protected]>
Date:   Mon Jan 13 12:16:12 2025 -0800

    cmake clang/compiler_flags.cmake: Re-enable -Wunknown-warning-option

    All warnings in the code base have been resolved.

    Signed-off-by: Tom Hughes <[email protected]>
@gbarkadiusz gbarkadiusz added bug The issue is a bug, or the PR is fixing a bug area: Xtensa Xtensa Architecture labels Jan 17, 2025
@gbarkadiusz
Copy link
Collaborator Author

@thughes FYI.

@thughes
Copy link
Contributor

thughes commented Jan 17, 2025

From the error, it looks like the issue is that the xt-clang compiler doesn't recognize the -Walloc-size-larger-than warning here.

I see that the warning is listed in the GCC warning options, but not clang diagnostic flags.

I have a PR that makes it easier to disable warnings only for clang or only for gcc: #84063. With that change we can make this a gcc-specific warning, which should resolve this issue. (I don't have access to the xt-clang compiler, so I can't test myself.)

@thughes thughes linked a pull request Jan 17, 2025 that will close this issue
thughes added a commit to thughes/zephyr that referenced this issue Jan 17, 2025
Many warnings were disabled for all compilers, even though they are
gcc-specific warnings. Now that clang has -Wunknown-warning-option
enabled, this can cause compilation failures when building with clang
toolchains.

Use TOOLCHAIN_DISABLE_GCC_WARNING for all gcc-specific macros.

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
https://clang.llvm.org/docs/DiagnosticsReference.html

Fixes: zephyrproject-rtos#84138

Signed-off-by: Tom Hughes <[email protected]>
dcpleung added a commit to dcpleung/zephyr that referenced this issue Jan 17, 2025
xt-clang is usually based on older version of clang, and
Zephyr main targets more recent versions. Because of this,
some newer compiler flags may cause warnings where twister
would mark as test being failed. To workaround that,
add -Wno-unknown-warning-option to suppress those warnings.

Fixes zephyrproject-rtos#84138

Signed-off-by: Daniel Leung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
3 participants