Skip to content

Commit 1bc2767

Browse files
committed
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
2 parents b8dcdab + d503ac5 commit 1bc2767

File tree

52 files changed

+188
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+188
-209
lines changed

Documentation/early-userspace/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ early userspace image can be built by an unprivileged user.
6666

6767
As a technical note, when directories and files are specified, the
6868
entire CONFIG_INITRAMFS_SOURCE is passed to
69-
scripts/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE
69+
usr/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE
7070
can really be interpreted as any legal argument to
7171
gen_initramfs_list.sh. If a directory is specified as an argument then
7272
the contents are scanned, uid/gid translation is performed, and
7373
usr/gen_init_cpio file directives are output. If a directory is
74-
specified as an argument to scripts/gen_initramfs_list.sh then the
74+
specified as an argument to usr/gen_initramfs_list.sh then the
7575
contents of the file are simply copied to the output. All of the output
7676
directives from directory scanning and file contents copying are
7777
processed by usr/gen_init_cpio.
7878

79-
See also 'scripts/gen_initramfs_list.sh -h'.
79+
See also 'usr/gen_initramfs_list.sh -h'.
8080

8181
Where's this all leading?
8282
=========================

Documentation/filesystems/ramfs-rootfs-initramfs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Documentation/early-userspace/README for more details.)
164164
The kernel does not depend on external cpio tools. If you specify a
165165
directory instead of a configuration file, the kernel's build infrastructure
166166
creates a configuration file from that directory (usr/Makefile calls
167-
scripts/gen_initramfs_list.sh), and proceeds to package up that directory
167+
usr/gen_initramfs_list.sh), and proceeds to package up that directory
168168
using the config file (by feeding it to usr/gen_init_cpio, which is created
169169
from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is
170170
entirely self-contained, and the kernel's boot-time extractor is also

Documentation/kbuild/kconfig-language.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,15 +545,14 @@ make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
545545
Practical solutions to kconfig recursive issue
546546
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
547547

548-
Developers who run into the recursive Kconfig issue have three options
548+
Developers who run into the recursive Kconfig issue have two options
549549
at their disposal. We document them below and also provide a list of
550550
historical issues resolved through these different solutions.
551551

552552
a) Remove any superfluous "select FOO" or "depends on FOO"
553553
b) Match dependency semantics:
554554
b1) Swap all "select FOO" to "depends on FOO" or,
555555
b2) Swap all "depends on FOO" to "select FOO"
556-
c) Consider the use of "imply" instead of "select"
557556

558557
The resolution to a) can be tested with the sample Kconfig file
559558
Documentation/kbuild/Kconfig.recursion-issue-01 through the removal

Documentation/kbuild/makefiles.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ Both possibilities are described in the following.
680680

681681
Example:
682682
#scripts/kconfig/Makefile
683-
HOSTLOADLIBES_qconf := -L$(QTDIR)/lib
683+
HOSTLDLIBS_qconf := -L$(QTDIR)/lib
684684

685685
When linking qconf, it will be passed the extra option
686686
"-L$(QTDIR)/lib".

Makefile

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,15 @@ KBUILD_CFLAGS_KERNEL :=
440440
KBUILD_AFLAGS_MODULE := -DMODULE
441441
KBUILD_CFLAGS_MODULE := -DMODULE
442442
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
443-
LDFLAGS :=
443+
KBUILD_LDFLAGS :=
444444
GCC_PLUGINS_CFLAGS :=
445445

446446
export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
447447
export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
448448
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
449449
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
450450

451-
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
451+
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
452452
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
453453
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
454454
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -790,8 +790,8 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
790790
endif
791791

792792
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
793-
KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,)
794-
KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,)
793+
KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
794+
LDFLAGS_vmlinux += --gc-sections
795795
endif
796796

797797
# 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)
857857
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
858858
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
859859

860-
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
861-
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
862-
endif
863-
864860
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
865861
LDFLAGS_vmlinux += $(call ld-option, -X,)
866862
endif
@@ -1024,7 +1020,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
10241020

10251021
# Final link of vmlinux with optional arch pass after final link
10261022
cmd_link-vmlinux = \
1027-
$(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
1023+
$(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
10281024
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
10291025

10301026
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
@@ -1354,16 +1350,12 @@ distclean: mrproper
13541350

13551351
# Packaging of the kernel to various formats
13561352
# ---------------------------------------------------------------------------
1357-
# rpm target kept for backward compatibility
13581353
package-dir := scripts/package
13591354

13601355
%src-pkg: FORCE
13611356
$(Q)$(MAKE) $(build)=$(package-dir) $@
13621357
%pkg: include/config/kernel.release FORCE
13631358
$(Q)$(MAKE) $(build)=$(package-dir) $@
1364-
rpm: rpm-pkg
1365-
@echo " WARNING: \"rpm\" target will be removed after Linux 4.18"
1366-
@echo " Please use \"rpm-pkg\" instead."
13671359

13681360

13691361
# Brief documentation of the typical targets used

arch/arc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
9595
# Finally dump eveything into kernel build system
9696
KBUILD_CFLAGS += $(cflags-y)
9797
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
98-
LDFLAGS += $(ldflags-y)
98+
KBUILD_LDFLAGS += $(ldflags-y)
9999

100100
head-y := arch/arc/kernel/head.o
101101

arch/arm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
4343
KBUILD_CPPFLAGS += -mbig-endian
4444
CHECKFLAGS += -D__ARMEB__
4545
AS += -EB
46-
LDFLAGS += -EB
46+
KBUILD_LDFLAGS += -EB
4747
else
4848
KBUILD_CPPFLAGS += -mlittle-endian
4949
CHECKFLAGS += -D__ARMEL__
5050
AS += -EL
51-
LDFLAGS += -EL
51+
KBUILD_LDFLAGS += -EL
5252
endif
5353

5454
#

arch/arm64/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ CHECKFLAGS += -D__AARCH64EB__
6262
AS += -EB
6363
# Prefer the baremetal ELF build target, but not all toolchains include
6464
# it so fall back to the standard linux version if needed.
65-
LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
65+
KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
6666
UTS_MACHINE := aarch64_be
6767
else
6868
KBUILD_CPPFLAGS += -mlittle-endian
6969
CHECKFLAGS += -D__AARCH64EL__
7070
AS += -EL
7171
# Same as above, prefer ELF but fall back to linux target if needed.
72-
LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
72+
KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
7373
UTS_MACHINE := aarch64
7474
endif
7575

arch/c6x/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
2323
KBUILD_CFLAGS += -mbig-endian
2424
KBUILD_AFLAGS += -mbig-endian
2525
LINKFLAGS += -mbig-endian
26-
KBUILD_LDFLAGS += -mbig-endian
27-
LDFLAGS += -EB
26+
KBUILD_LDFLAGS += -mbig-endian -EB
2827
CHECKFLAGS += -D_BIG_ENDIAN
2928
endif
3029

arch/h8300/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
2222
KBUILD_CFLAGS += -D__linux__
2323
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
2424
KBUILD_AFLAGS += $(aflags-y)
25-
LDFLAGS += $(ldflags-y)
25+
KBUILD_LDFLAGS += $(ldflags-y)
2626

2727
CHECKFLAGS += -msize-long
2828

arch/hexagon/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
2222

2323
KBUILD_CFLAGS += $(cflags-y)
2424
KBUILD_AFLAGS += $(aflags-y)
25-
26-
# no KBUILD_LDFLAGS?
27-
LDFLAGS += $(ldflags-y)
25+
KBUILD_LDFLAGS += $(ldflags-y)
2826

2927
# Thread-info register will be r19. This value is not configureable;
3028
# it is hard-coded in several files.

arch/m68k/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
6969
KBUILD_AFLAGS += -D__uClinux__
7070
endif
7171

72-
LDFLAGS := -m m68kelf
72+
KBUILD_LDFLAGS := -m m68kelf
7373
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
7474

7575
ifdef CONFIG_SUN3

arch/microblaze/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
4040
ifdef CONFIG_CPU_BIG_ENDIAN
4141
KBUILD_CFLAGS += -mbig-endian
4242
KBUILD_AFLAGS += -mbig-endian
43-
LDFLAGS += -EB
43+
KBUILD_LDFLAGS += -EB
4444
else
4545
KBUILD_CFLAGS += -mlittle-endian
4646
KBUILD_AFLAGS += -mlittle-endian
47-
LDFLAGS += -EL
47+
KBUILD_LDFLAGS += -EL
4848
endif
4949

5050
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))

arch/mips/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ endif
309309
# instead of .eh_frame so we don't discard them.
310310
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
311311

312-
LDFLAGS += -m $(ld-emul)
312+
KBUILD_LDFLAGS += -m $(ld-emul)
313313

314314
ifdef CONFIG_MIPS
315315
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \

arch/mips/boot/compressed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
9292
vmlinuzobjs-y += $(obj)/piggy.o
9393

9494
quiet_cmd_zld = LD $@
95-
cmd_zld = $(LD) $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T $< $(vmlinuzobjs-y) -o $@
95+
cmd_zld = $(LD) $(KBUILD_LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T $< $(vmlinuzobjs-y) -o $@
9696
quiet_cmd_strip = STRIP $@
9797
cmd_strip = $(STRIP) -s $@
9898
vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr

arch/mips/lasat/image/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
3838

3939
# Rule to make the bootloader
4040
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
41-
$(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
41+
$(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
4242

4343
$(obj)/%.o: $(obj)/%.gz
4444
$(LD) -r -o $@ -b binary $<

arch/nds32/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ endif
3333
ifdef CONFIG_CPU_LITTLE_ENDIAN
3434
KBUILD_CFLAGS += $(call cc-option, -EL)
3535
KBUILD_AFLAGS += $(call cc-option, -EL)
36-
LDFLAGS += $(call cc-option, -EL)
36+
KBUILD_LDFLAGS += $(call cc-option, -EL)
3737
CHECKFLAGS += -D__NDS32_EL__
3838
else
3939
KBUILD_CFLAGS += $(call cc-option, -EB)
4040
KBUILD_AFLAGS += $(call cc-option, -EB)
41-
LDFLAGS += $(call cc-option, -EB)
41+
KBUILD_LDFLAGS += $(call cc-option, -EB)
4242
CHECKFLAGS += -D__NDS32_EB__
4343
endif
4444

arch/powerpc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ endif
7676

7777
ifdef CONFIG_CPU_LITTLE_ENDIAN
7878
KBUILD_CFLAGS += -mlittle-endian
79-
LDFLAGS += -EL
79+
KBUILD_LDFLAGS += -EL
8080
LDEMULATION := lppc
8181
GNUTARGET := powerpcle
8282
MULTIPLEWORD := -mno-multiple
8383
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
8484
else
8585
KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
86-
LDFLAGS += -EB
86+
KBUILD_LDFLAGS += -EB
8787
LDEMULATION := ppc
8888
GNUTARGET := powerpc
8989
MULTIPLEWORD := -mmultiple
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
108108
ifeq ($(HAS_BIARCH),y)
109109
KBUILD_CFLAGS += -m$(BITS)
110110
KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS)
111-
LDFLAGS += -m elf$(BITS)$(LDEMULATION)
111+
KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION)
112112
KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
113113
endif
114114

arch/riscv/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
2929
KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128)
3030

3131
KBUILD_MARCH = rv64im
32-
LDFLAGS += -melf64lriscv
32+
KBUILD_LDFLAGS += -melf64lriscv
3333
else
3434
BITS := 32
3535
UTS_MACHINE := riscv32
3636

3737
KBUILD_CFLAGS += -mabi=ilp32
3838
KBUILD_AFLAGS += -mabi=ilp32
3939
KBUILD_MARCH = rv32im
40-
LDFLAGS += -melf32lriscv
40+
KBUILD_LDFLAGS += -melf32lriscv
4141
endif
4242

4343
KBUILD_CFLAGS += -Wall

arch/s390/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212

1313
LD_BFD := elf64-s390
14-
LDFLAGS := -m elf64_s390
14+
KBUILD_LDFLAGS := -m elf64_s390
1515
KBUILD_AFLAGS_MODULE += -fPIC
1616
KBUILD_CFLAGS_MODULE += -fPIC
1717
KBUILD_AFLAGS += -m64

arch/sh/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ endif
122122
ifdef CONFIG_CPU_LITTLE_ENDIAN
123123
ld-bfd := elf32-$(UTS_MACHINE)-linux
124124
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
125-
LDFLAGS += -EL
125+
KBUILD_LDFLAGS += -EL
126126
else
127127
ld-bfd := elf32-$(UTS_MACHINE)big-linux
128128
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
129-
LDFLAGS += -EB
129+
KBUILD_LDFLAGS += -EB
130130
endif
131131

132132
export ld-bfd BITS

arch/sparc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y)
2121
#
2222

2323
CHECKFLAGS += -D__sparc__
24-
LDFLAGS := -m elf32_sparc
24+
KBUILD_LDFLAGS := -m elf32_sparc
2525
export BITS := 32
2626
UTS_MACHINE := sparc
2727

@@ -40,7 +40,7 @@ else
4040
#
4141

4242
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
43-
LDFLAGS := -m elf64_sparc
43+
KBUILD_LDFLAGS := -m elf64_sparc
4444
export BITS := 64
4545
UTS_MACHINE := sparc64
4646

arch/um/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
133133
# The wrappers will select whether using "malloc" or the kernel allocator.
134134
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
135135

136-
LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
136+
LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
137137

138138
# Used by link-vmlinux.sh which has special support for um link
139139
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)

arch/x86/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2
219219
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
220220
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
221221

222-
LDFLAGS := -m elf_$(UTS_MACHINE)
222+
KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
223223

224224
#
225225
# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
226226
# the linker to force 2MB page size regardless of the default page size used
227227
# by the linker.
228228
#
229229
ifdef CONFIG_X86_64
230-
LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
230+
KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
231231
endif
232232

233233
# Speed up the build

arch/x86/Makefile.um

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/
44
ifeq ($(CONFIG_X86_32),y)
55
START := 0x8048000
66

7-
LDFLAGS += -m elf_i386
7+
KBUILD_LDFLAGS += -m elf_i386
88
ELF_ARCH := i386
99
ELF_FORMAT := elf32-i386
1010
CHECKFLAGS += -D__i386__
@@ -43,7 +43,7 @@ KBUILD_CFLAGS += -fno-builtin -m64
4343

4444
CHECKFLAGS += -m64 -D__x86_64__
4545
KBUILD_AFLAGS += -m64
46-
LDFLAGS += -m elf_x86_64
46+
KBUILD_LDFLAGS += -m elf_x86_64
4747
KBUILD_CPPFLAGS += -m64
4848

4949
ELF_ARCH := i386:x86-64

0 commit comments

Comments
 (0)