Commit 1bc27677 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull more Kbuild updates from Masahiro Yamada:

 - add build_{menu,n,g,x}config targets for compile-testing Kconfig

 - fix and improve recursive dependency detection in Kconfig

 - fix parallel building of menuconfig/nconfig

 - fix syntax error in clang-version.sh

 - suppress distracting log from syncconfig

 - remove obsolete "rpm" target

 - remove VMLINUX_SYMBOL(_STR) macro entirely

 - fix microblaze build with CONFIG_DYNAMIC_FTRACE

 - move compiler test for dead code/data elimination to Kconfig

 - rename well-known LDFLAGS variable to KBUILD_LDFLAGS

 - misc fixes and cleanups

* tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: rename LDFLAGS to KBUILD_LDFLAGS
  kbuild: pass LDFLAGS to recordmcount.pl
  kbuild: test dead code/data elimination support in Kconfig
  initramfs: move gen_initramfs_list.sh from scripts/ to usr/
  vmlinux.lds.h: remove stale <linux/export.h> include
  export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
  Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci
  kbuild: make sorting initramfs contents independent of locale
  kbuild: remove "rpm" target, which is alias of "rpm-pkg"
  kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt
  kconfig: suppress "configuration written to .config" for syncconfig
  kconfig: fix "Can't open ..." in parallel build
  kbuild: Add a space after `!` to prevent parsing as file pattern
  scripts: modpost: check memory allocation results
  kconfig: improve the recursive dependency report
  kconfig: report recursive dependency involving 'imply'
  kconfig: error out when seeing recursive dependency
  kconfig: add build-only configurator targets
  scripts/dtc: consolidate include path options in Makefile
parents b8dcdab3 d503ac53
...@@ -66,17 +66,17 @@ early userspace image can be built by an unprivileged user. ...@@ -66,17 +66,17 @@ early userspace image can be built by an unprivileged user.
As a technical note, when directories and files are specified, the As a technical note, when directories and files are specified, the
entire CONFIG_INITRAMFS_SOURCE is passed to entire CONFIG_INITRAMFS_SOURCE is passed to
scripts/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE usr/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE
can really be interpreted as any legal argument to can really be interpreted as any legal argument to
gen_initramfs_list.sh. If a directory is specified as an argument then gen_initramfs_list.sh. If a directory is specified as an argument then
the contents are scanned, uid/gid translation is performed, and the contents are scanned, uid/gid translation is performed, and
usr/gen_init_cpio file directives are output. If a directory is usr/gen_init_cpio file directives are output. If a directory is
specified as an argument to scripts/gen_initramfs_list.sh then the specified as an argument to usr/gen_initramfs_list.sh then the
contents of the file are simply copied to the output. All of the output contents of the file are simply copied to the output. All of the output
directives from directory scanning and file contents copying are directives from directory scanning and file contents copying are
processed by usr/gen_init_cpio. processed by usr/gen_init_cpio.
See also 'scripts/gen_initramfs_list.sh -h'. See also 'usr/gen_initramfs_list.sh -h'.
Where's this all leading? Where's this all leading?
========================= =========================
......
...@@ -164,7 +164,7 @@ Documentation/early-userspace/README for more details.) ...@@ -164,7 +164,7 @@ Documentation/early-userspace/README for more details.)
The kernel does not depend on external cpio tools. If you specify a The kernel does not depend on external cpio tools. If you specify a
directory instead of a configuration file, the kernel's build infrastructure directory instead of a configuration file, the kernel's build infrastructure
creates a configuration file from that directory (usr/Makefile calls creates a configuration file from that directory (usr/Makefile calls
scripts/gen_initramfs_list.sh), and proceeds to package up that directory usr/gen_initramfs_list.sh), and proceeds to package up that directory
using the config file (by feeding it to usr/gen_init_cpio, which is created using the config file (by feeding it to usr/gen_init_cpio, which is created
from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is
entirely self-contained, and the kernel's boot-time extractor is also entirely self-contained, and the kernel's boot-time extractor is also
......
...@@ -545,7 +545,7 @@ make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig ...@@ -545,7 +545,7 @@ make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
Practical solutions to kconfig recursive issue Practical solutions to kconfig recursive issue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Developers who run into the recursive Kconfig issue have three options Developers who run into the recursive Kconfig issue have two options
at their disposal. We document them below and also provide a list of at their disposal. We document them below and also provide a list of
historical issues resolved through these different solutions. historical issues resolved through these different solutions.
...@@ -553,7 +553,6 @@ historical issues resolved through these different solutions. ...@@ -553,7 +553,6 @@ historical issues resolved through these different solutions.
b) Match dependency semantics: b) Match dependency semantics:
b1) Swap all "select FOO" to "depends on FOO" or, b1) Swap all "select FOO" to "depends on FOO" or,
b2) Swap all "depends on FOO" to "select FOO" b2) Swap all "depends on FOO" to "select FOO"
c) Consider the use of "imply" instead of "select"
The resolution to a) can be tested with the sample Kconfig file The resolution to a) can be tested with the sample Kconfig file
Documentation/kbuild/Kconfig.recursion-issue-01 through the removal Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
......
...@@ -680,7 +680,7 @@ Both possibilities are described in the following. ...@@ -680,7 +680,7 @@ Both possibilities are described in the following.
Example: Example:
#scripts/kconfig/Makefile #scripts/kconfig/Makefile
HOSTLOADLIBES_qconf := -L$(QTDIR)/lib HOSTLDLIBS_qconf := -L$(QTDIR)/lib
When linking qconf, it will be passed the extra option When linking qconf, it will be passed the extra option
"-L$(QTDIR)/lib". "-L$(QTDIR)/lib".
......
...@@ -440,7 +440,7 @@ KBUILD_CFLAGS_KERNEL := ...@@ -440,7 +440,7 @@ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
LDFLAGS := KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS := GCC_PLUGINS_CFLAGS :=
export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
...@@ -448,7 +448,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS ...@@ -448,7 +448,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
...@@ -790,8 +790,8 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) ...@@ -790,8 +790,8 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif endif
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,) LDFLAGS_vmlinux += --gc-sections
endif endif
# arch Makefile may override CC so keep this after arch Makefile is included # arch Makefile may override CC so keep this after arch Makefile is included
...@@ -857,10 +857,6 @@ LDFLAGS_BUILD_ID := $(call ld-option, --build-id) ...@@ -857,10 +857,6 @@ LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
endif
ifeq ($(CONFIG_STRIP_ASM_SYMS),y) ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,) LDFLAGS_vmlinux += $(call ld-option, -X,)
endif endif
...@@ -1024,7 +1020,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) ...@@ -1024,7 +1020,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link # Final link of vmlinux with optional arch pass after final link
cmd_link-vmlinux = \ cmd_link-vmlinux = \
$(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \ $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
...@@ -1354,16 +1350,12 @@ distclean: mrproper ...@@ -1354,16 +1350,12 @@ distclean: mrproper
# Packaging of the kernel to various formats # Packaging of the kernel to various formats
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# rpm target kept for backward compatibility
package-dir := scripts/package package-dir := scripts/package
%src-pkg: FORCE %src-pkg: FORCE
$(Q)$(MAKE) $(build)=$(package-dir) $@ $(Q)$(MAKE) $(build)=$(package-dir) $@
%pkg: include/config/kernel.release FORCE %pkg: include/config/kernel.release FORCE
$(Q)$(MAKE) $(build)=$(package-dir) $@ $(Q)$(MAKE) $(build)=$(package-dir) $@
rpm: rpm-pkg
@echo " WARNING: \"rpm\" target will be removed after Linux 4.18"
@echo " Please use \"rpm-pkg\" instead."
# Brief documentation of the typical targets used # Brief documentation of the typical targets used
......
...@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode ...@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
# Finally dump eveything into kernel build system # Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(KBUILD_CFLAGS) KBUILD_AFLAGS += $(KBUILD_CFLAGS)
LDFLAGS += $(ldflags-y) KBUILD_LDFLAGS += $(ldflags-y)
head-y := arch/arc/kernel/head.o head-y := arch/arc/kernel/head.o
......
...@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) ...@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__ARMEB__ CHECKFLAGS += -D__ARMEB__
AS += -EB AS += -EB
LDFLAGS += -EB KBUILD_LDFLAGS += -EB
else else
KBUILD_CPPFLAGS += -mlittle-endian KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__ARMEL__ CHECKFLAGS += -D__ARMEL__
AS += -EL AS += -EL
LDFLAGS += -EL KBUILD_LDFLAGS += -EL
endif endif
# #
......
...@@ -62,14 +62,14 @@ CHECKFLAGS += -D__AARCH64EB__ ...@@ -62,14 +62,14 @@ CHECKFLAGS += -D__AARCH64EB__
AS += -EB AS += -EB
# Prefer the baremetal ELF build target, but not all toolchains include # Prefer the baremetal ELF build target, but not all toolchains include
# it so fall back to the standard linux version if needed. # it so fall back to the standard linux version if needed.
LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb) KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
UTS_MACHINE := aarch64_be UTS_MACHINE := aarch64_be
else else
KBUILD_CPPFLAGS += -mlittle-endian KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__AARCH64EL__ CHECKFLAGS += -D__AARCH64EL__
AS += -EL AS += -EL
# Same as above, prefer ELF but fall back to linux target if needed. # Same as above, prefer ELF but fall back to linux target if needed.
LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux) KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
UTS_MACHINE := aarch64 UTS_MACHINE := aarch64
endif endif
......
...@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN ...@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian LINKFLAGS += -mbig-endian
KBUILD_LDFLAGS += -mbig-endian KBUILD_LDFLAGS += -mbig-endian -EB
LDFLAGS += -EB
CHECKFLAGS += -D_BIG_ENDIAN CHECKFLAGS += -D_BIG_ENDIAN
endif endif
......
...@@ -22,7 +22,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin ...@@ -22,7 +22,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
KBUILD_CFLAGS += -D__linux__ KBUILD_CFLAGS += -D__linux__
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\" KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
KBUILD_AFLAGS += $(aflags-y) KBUILD_AFLAGS += $(aflags-y)
LDFLAGS += $(ldflags-y) KBUILD_LDFLAGS += $(ldflags-y)
CHECKFLAGS += -msize-long CHECKFLAGS += -msize-long
......
...@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) ...@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y) KBUILD_AFLAGS += $(aflags-y)
KBUILD_LDFLAGS += $(ldflags-y)
# no KBUILD_LDFLAGS?
LDFLAGS += $(ldflags-y)
# Thread-info register will be r19. This value is not configureable; # Thread-info register will be r19. This value is not configureable;
# it is hard-coded in several files. # it is hard-coded in several files.
......
...@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__ ...@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
KBUILD_AFLAGS += -D__uClinux__ KBUILD_AFLAGS += -D__uClinux__
endif endif
LDFLAGS := -m m68kelf KBUILD_LDFLAGS := -m m68kelf
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifdef CONFIG_SUN3 ifdef CONFIG_SUN3
......
...@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare ...@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian KBUILD_AFLAGS += -mbig-endian
LDFLAGS += -EB KBUILD_LDFLAGS += -EB
else else
KBUILD_CFLAGS += -mlittle-endian KBUILD_CFLAGS += -mlittle-endian
KBUILD_AFLAGS += -mlittle-endian KBUILD_AFLAGS += -mlittle-endian
LDFLAGS += -EL KBUILD_LDFLAGS += -EL
endif endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
......
...@@ -309,7 +309,7 @@ endif ...@@ -309,7 +309,7 @@ endif
# instead of .eh_frame so we don't discard them. # instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
LDFLAGS += -m $(ld-emul) KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_MIPS ifdef CONFIG_MIPS
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
......
...@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS) ...@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
vmlinuzobjs-y += $(obj)/piggy.o vmlinuzobjs-y += $(obj)/piggy.o
quiet_cmd_zld = LD $@ quiet_cmd_zld = LD $@
cmd_zld = $(LD) $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T $< $(vmlinuzobjs-y) -o $@ cmd_zld = $(LD) $(KBUILD_LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T $< $(vmlinuzobjs-y) -o $@
quiet_cmd_strip = STRIP $@ quiet_cmd_strip = STRIP $@
cmd_strip = $(STRIP) -s $@ cmd_strip = $(STRIP) -s $@
vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr
......
...@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom ...@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
# Rule to make the bootloader # Rule to make the bootloader
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS)) $(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
$(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^ $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
$(obj)/%.o: $(obj)/%.gz $(obj)/%.o: $(obj)/%.gz
$(LD) -r -o $@ -b binary $< $(LD) -r -o $@ -b binary $<
......
...@@ -33,12 +33,12 @@ endif ...@@ -33,12 +33,12 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += $(call cc-option, -EL) KBUILD_CFLAGS += $(call cc-option, -EL)
KBUILD_AFLAGS += $(call cc-option, -EL) KBUILD_AFLAGS += $(call cc-option, -EL)
LDFLAGS += $(call cc-option, -EL) KBUILD_LDFLAGS += $(call cc-option, -EL)
CHECKFLAGS += -D__NDS32_EL__ CHECKFLAGS += -D__NDS32_EL__
else else
KBUILD_CFLAGS += $(call cc-option, -EB) KBUILD_CFLAGS += $(call cc-option, -EB)
KBUILD_AFLAGS += $(call cc-option, -EB) KBUILD_AFLAGS += $(call cc-option, -EB)
LDFLAGS += $(call cc-option, -EB) KBUILD_LDFLAGS += $(call cc-option, -EB)
CHECKFLAGS += -D__NDS32_EB__ CHECKFLAGS += -D__NDS32_EB__
endif endif
......
...@@ -76,14 +76,14 @@ endif ...@@ -76,14 +76,14 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += -mlittle-endian KBUILD_CFLAGS += -mlittle-endian
LDFLAGS += -EL KBUILD_LDFLAGS += -EL
LDEMULATION := lppc LDEMULATION := lppc
GNUTARGET := powerpcle GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple MULTIPLEWORD := -mno-multiple
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
else else
KBUILD_CFLAGS += $(call cc-option,-mbig-endian) KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
LDFLAGS += -EB KBUILD_LDFLAGS += -EB
LDEMULATION := ppc LDEMULATION := ppc
GNUTARGET := powerpc GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple MULTIPLEWORD := -mmultiple
...@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian ...@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
ifeq ($(HAS_BIARCH),y) ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(BITS) KBUILD_CFLAGS += -m$(BITS)
KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS)
LDFLAGS += -m elf$(BITS)$(LDEMULATION) KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION)
KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET) KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
endif endif
......
...@@ -29,7 +29,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y) ...@@ -29,7 +29,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128) KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128)
KBUILD_MARCH = rv64im KBUILD_MARCH = rv64im
LDFLAGS += -melf64lriscv KBUILD_LDFLAGS += -melf64lriscv
else else
BITS := 32 BITS := 32
UTS_MACHINE := riscv32 UTS_MACHINE := riscv32
...@@ -37,7 +37,7 @@ else ...@@ -37,7 +37,7 @@ else
KBUILD_CFLAGS += -mabi=ilp32 KBUILD_CFLAGS += -mabi=ilp32
KBUILD_AFLAGS += -mabi=ilp32 KBUILD_AFLAGS += -mabi=ilp32
KBUILD_MARCH = rv32im KBUILD_MARCH = rv32im
LDFLAGS += -melf32lriscv KBUILD_LDFLAGS += -melf32lriscv
endif endif
KBUILD_CFLAGS += -Wall KBUILD_CFLAGS += -Wall
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
LD_BFD := elf64-s390 LD_BFD := elf64-s390
LDFLAGS := -m elf64_s390 KBUILD_LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_AFLAGS += -m64 KBUILD_AFLAGS += -m64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment