OrangePi_CM5/arch/x86/boot
Nathan Chancellor aea5302d9d x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS
[ Upstream commit 5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 10:54:00 +01:00
..
compressed x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS 2022-01-27 10:54:00 +01:00
tools x86/build: Declutter the build output 2020-08-20 08:17:40 +02:00
.gitignore
…
Makefile
…
a20.c
…
apm.c
…
bioscall.S
…
bitops.h
…
boot.h
…
cmdline.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
code16gcc.h
…
copy.S
…
cpu.c
…
cpucheck.c
…
cpuflags.c
…
cpuflags.h
…
ctype.h
…
early_serial_console.c
…
edd.c
…
genimage.sh
…
header.S x86: Bump ZO_z_extra_bytes margin for zstd 2020-07-31 11:49:08 +02:00
install.sh
…
main.c
…
memory.c
…
mkcpustr.c
…
mtools.conf.in
…
pm.c
…
pmjump.S
…
printf.c
…
regs.c
…
setup.ld x86/boot: Add .text.* to setup.ld 2020-08-14 12:52:35 +02:00
string.c
…
string.h x86/boot/compressed: Use builtin mem functions for decompressor 2020-08-19 11:23:45 -07:00
tty.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
version.c
…
vesa.h
…
video-bios.c
…
video-mode.c
…
video-vesa.c
…
video-vga.c
…
video.c
…
video.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00