diff options
author | Nathan Chancellor <nathan@kernel.org> | 2021-12-22 09:30:41 -0700 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-12-23 11:03:28 +0100 |
commit | 5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb (patch) | |
tree | 3a01bfac5852ea9a39447a4012e47bb9099f1b68 /arch/mips/cobalt/setup.c | |
parent | a7904a538933c525096ca2ccde1e60d0ee62c08e (diff) | |
download | linux-5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb.tar.gz linux-5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb.tar.bz2 linux-5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb.zip |
x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS
When cross compiling i386_defconfig on an arm64 host with clang, there
are a few instances of '-Waddress-of-packed-member' and
'-Wgnu-variable-sized-type-not-at-end' in arch/x86/boot/compressed/,
which should both be disabled with the cc-disable-warning calls in that
directory's Makefile, which indicates that cc-disable-warning is failing
at the point of testing these flags.
The cc-disable-warning calls fail because at the point that the flags
are tested, KBUILD_CFLAGS has '-march=i386' without $(CLANG_FLAGS),
which has the '--target=' flag to tell clang what architecture it is
targeting. Without the '--target=' flag, the host architecture (arm64)
is used and i386 is not a valid value for '-march=' in that case. This
error can be seen by adding some logging to try-run:
clang-14: error: the clang compiler does not support '-march=i386'
Invoking the compiler has to succeed prior to calling cc-option or
cc-disable-warning in order to accurately test whether or not the flag
is supported; if it doesn't, the requested flag can never be added to
the compiler flags. Move $(CLANG_FLAGS) to the beginning of KBUILD_FLAGS
so that any new flags that might be added in the future can be
accurately tested.
Fixes: d5cbd80e302d ("x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211222163040.1961481-1-nathan@kernel.org
Diffstat (limited to 'arch/mips/cobalt/setup.c')
0 files changed, 0 insertions, 0 deletions