mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
arch/lkl: use a common helper to determine OUTPUT_FORMAT
The existing scripts work for GCC but restrict LLVM builds to elf64-x86-64 only. The new cc-objdump-file-format.sh helper script works with both gcc/clang and objdump/llvm-objdump for CC and OBJDUMP respectively. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -38,8 +38,7 @@ config LKL_LINE_COV
|
||||
|
||||
config OUTPUT_FORMAT
|
||||
string "Output format"
|
||||
default $(shell,$(LD) -r -print-output-format) if LD_IS_BFD
|
||||
default $(shell,test "$(CROSS_COMPILE)" = "x86_64-linux-gnu" && echo "elf64-x86-64" || echo "unsupported-llvm") if LD_IS_LLD
|
||||
default $(shell,$(srctree)/arch/lkl/scripts/cc-objdump-file-format.sh)
|
||||
|
||||
config ARCH_DMA_ADDR_T_64BIT
|
||||
def_bool 64BIT
|
||||
@@ -49,8 +48,8 @@ config PHYS_ADDR_T_64BIT
|
||||
|
||||
config 64BIT
|
||||
bool "64bit kernel"
|
||||
default y if OUTPUT_FORMAT = "pe-x86-64" || OUTPUT_FORMAT = "elf64-x86-64"
|
||||
default $(success,$(LD) -r -print-output-format|grep -q '^elf64-') if LD_IS_BFD && OUTPUT_FORMAT != "pe-x86-64" && OUTPUT_FORMAT != "elf64-x86-64"
|
||||
default y if OUTPUT_FORMAT = "pe-x86-64"
|
||||
default $(success,$(srctree)/arch/lkl/scripts/cc-objdump-file-format.sh|grep -q '^elf64-') if OUTPUT_FORMAT != "pe-x86-64"
|
||||
|
||||
config MMU
|
||||
bool "LKL MMU implementation"
|
||||
|
||||
8
arch/lkl/scripts/cc-objdump-file-format.sh
Executable file
8
arch/lkl/scripts/cc-objdump-file-format.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Print the C compiler output file format, as determined by objdump.
|
||||
t=`mktemp` || exit 1
|
||||
echo 'void foo(void) {}' | $CC -x c - -c -o "$t" \
|
||||
&& $OBJDUMP -p "$t" | awk '/file format/ {print $4}'
|
||||
rm "$t"
|
||||
Reference in New Issue
Block a user