diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-08-23 19:20:39 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-08-23 19:22:08 -0400 |
commit | d503ac531a5246e4d910f971b213807fea925956 (patch) | |
tree | 25e07f13512496598b959eefc238f169aaba9e59 | |
parent | 87a32e624037e8b6e8538ed864dc9994853acc4d (diff) |
kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Commit a0f97e06a43c ("kbuild: enable 'make CFLAGS=...' to add
additional options to CC") renamed CFLAGS to KBUILD_CFLAGS.
Commit 222d394d30e7 ("kbuild: enable 'make AFLAGS=...' to add
additional options to AS") renamed AFLAGS to KBUILD_AFLAGS.
Commit 06c5040cdb13 ("kbuild: enable 'make CPPFLAGS=...' to add
additional options to CPP") renamed CPPFLAGS to KBUILD_CPPFLAGS.
For some reason, LDFLAGS was not renamed.
Using a well-known variable like LDFLAGS may result in accidental
override of the variable.
Kbuild generally uses KBUILD_ prefixed variables for the internally
appended options, so here is one more conversion to sanitize the
naming convention.
I did not touch Makefiles under tools/ since the tools build system
is a different world.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | arch/arc/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/Makefile | 4 | ||||
-rw-r--r-- | arch/arm64/Makefile | 4 | ||||
-rw-r--r-- | arch/c6x/Makefile | 3 | ||||
-rw-r--r-- | arch/h8300/Makefile | 2 | ||||
-rw-r--r-- | arch/hexagon/Makefile | 4 | ||||
-rw-r--r-- | arch/m68k/Makefile | 2 | ||||
-rw-r--r-- | arch/microblaze/Makefile | 4 | ||||
-rw-r--r-- | arch/mips/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/boot/compressed/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/lasat/image/Makefile | 2 | ||||
-rw-r--r-- | arch/nds32/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 6 | ||||
-rw-r--r-- | arch/riscv/Makefile | 4 | ||||
-rw-r--r-- | arch/s390/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/Makefile | 4 | ||||
-rw-r--r-- | arch/sparc/Makefile | 4 | ||||
-rw-r--r-- | arch/um/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/Makefile.um | 4 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 6 | ||||
-rw-r--r-- | arch/xtensa/Makefile | 2 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-elf/Makefile | 2 | ||||
-rw-r--r-- | scripts/Kbuild.include | 4 | ||||
-rw-r--r-- | scripts/Makefile.build | 6 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rwxr-xr-x | scripts/link-vmlinux.sh | 4 |
29 files changed, 48 insertions, 51 deletions
@@ -440,7 +440,7 @@ KBUILD_CFLAGS_KERNEL := | |||
440 | KBUILD_AFLAGS_MODULE := -DMODULE | 440 | KBUILD_AFLAGS_MODULE := -DMODULE |
441 | KBUILD_CFLAGS_MODULE := -DMODULE | 441 | KBUILD_CFLAGS_MODULE := -DMODULE |
442 | KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | 442 | KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds |
443 | LDFLAGS := | 443 | KBUILD_LDFLAGS := |
444 | GCC_PLUGINS_CFLAGS := | 444 | GCC_PLUGINS_CFLAGS := |
445 | 445 | ||
446 | export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC | 446 | 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 | export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE | 448 | export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE |
449 | export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | 449 | export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS |
450 | 450 | ||
451 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 451 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS |
452 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE | 452 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE |
453 | export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN | 453 | export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN |
454 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 454 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
@@ -1020,7 +1020,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) | |||
1020 | 1020 | ||
1021 | # Final link of vmlinux with optional arch pass after final link | 1021 | # Final link of vmlinux with optional arch pass after final link |
1022 | cmd_link-vmlinux = \ | 1022 | cmd_link-vmlinux = \ |
1023 | $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \ | 1023 | $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \ |
1024 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) | 1024 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) |
1025 | 1025 | ||
1026 | vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE | 1026 | vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE |
diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 6c1b20dd76ad..fb026196aaab 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile | |||
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode | |||
95 | # Finally dump eveything into kernel build system | 95 | # Finally dump eveything into kernel build system |
96 | KBUILD_CFLAGS += $(cflags-y) | 96 | KBUILD_CFLAGS += $(cflags-y) |
97 | KBUILD_AFLAGS += $(KBUILD_CFLAGS) | 97 | KBUILD_AFLAGS += $(KBUILD_CFLAGS) |
98 | LDFLAGS += $(ldflags-y) | 98 | KBUILD_LDFLAGS += $(ldflags-y) |
99 | 99 | ||
100 | head-y := arch/arc/kernel/head.o | 100 | head-y := arch/arc/kernel/head.o |
101 | 101 | ||
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index e7d703d8fac3..360f80aeb9ff 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) | |||
43 | KBUILD_CPPFLAGS += -mbig-endian | 43 | KBUILD_CPPFLAGS += -mbig-endian |
44 | CHECKFLAGS += -D__ARMEB__ | 44 | CHECKFLAGS += -D__ARMEB__ |
45 | AS += -EB | 45 | AS += -EB |
46 | LDFLAGS += -EB | 46 | KBUILD_LDFLAGS += -EB |
47 | else | 47 | else |
48 | KBUILD_CPPFLAGS += -mlittle-endian | 48 | KBUILD_CPPFLAGS += -mlittle-endian |
49 | CHECKFLAGS += -D__ARMEL__ | 49 | CHECKFLAGS += -D__ARMEL__ |
50 | AS += -EL | 50 | AS += -EL |
51 | LDFLAGS += -EL | 51 | KBUILD_LDFLAGS += -EL |
52 | endif | 52 | endif |
53 | 53 | ||
54 | # | 54 | # |
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index efe61a2e4b5e..106039d25e2f 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
@@ -62,14 +62,14 @@ CHECKFLAGS += -D__AARCH64EB__ | |||
62 | AS += -EB | 62 | AS += -EB |
63 | # Prefer the baremetal ELF build target, but not all toolchains include | 63 | # Prefer the baremetal ELF build target, but not all toolchains include |
64 | # it so fall back to the standard linux version if needed. | 64 | # 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) |
66 | UTS_MACHINE := aarch64_be | 66 | UTS_MACHINE := aarch64_be |
67 | else | 67 | else |
68 | KBUILD_CPPFLAGS += -mlittle-endian | 68 | KBUILD_CPPFLAGS += -mlittle-endian |
69 | CHECKFLAGS += -D__AARCH64EL__ | 69 | CHECKFLAGS += -D__AARCH64EL__ |
70 | AS += -EL | 70 | AS += -EL |
71 | # Same as above, prefer ELF but fall back to linux target if needed. | 71 | # 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) |
73 | UTS_MACHINE := aarch64 | 73 | UTS_MACHINE := aarch64 |
74 | endif | 74 | endif |
75 | 75 | ||
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile index 6ab942e6c534..3fe8a948e94c 100644 --- a/arch/c6x/Makefile +++ b/arch/c6x/Makefile | |||
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN | |||
23 | KBUILD_CFLAGS += -mbig-endian | 23 | KBUILD_CFLAGS += -mbig-endian |
24 | KBUILD_AFLAGS += -mbig-endian | 24 | KBUILD_AFLAGS += -mbig-endian |
25 | LINKFLAGS += -mbig-endian | 25 | LINKFLAGS += -mbig-endian |
26 | KBUILD_LDFLAGS += -mbig-endian | 26 | KBUILD_LDFLAGS += -mbig-endian -EB |
27 | LDFLAGS += -EB | ||
28 | CHECKFLAGS += -D_BIG_ENDIAN | 27 | CHECKFLAGS += -D_BIG_ENDIAN |
29 | endif | 28 | endif |
30 | 29 | ||
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile index e1c02ca230cb..f9cbbb13853f 100644 --- a/arch/h8300/Makefile +++ b/arch/h8300/Makefile | |||
@@ -20,7 +20,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin | |||
20 | KBUILD_CFLAGS += -D__linux__ | 20 | KBUILD_CFLAGS += -D__linux__ |
21 | KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\" | 21 | KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\" |
22 | KBUILD_AFLAGS += $(aflags-y) | 22 | KBUILD_AFLAGS += $(aflags-y) |
23 | LDFLAGS += $(ldflags-y) | 23 | KBUILD_LDFLAGS += $(ldflags-y) |
24 | 24 | ||
25 | ifeq ($(CROSS_COMPILE),) | 25 | ifeq ($(CROSS_COMPILE),) |
26 | CROSS_COMPILE := h8300-unknown-linux- | 26 | CROSS_COMPILE := h8300-unknown-linux- |
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile index 2efaa18e995a..4c5858b80f0e 100644 --- a/arch/hexagon/Makefile +++ b/arch/hexagon/Makefile | |||
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) | |||
22 | 22 | ||
23 | KBUILD_CFLAGS += $(cflags-y) | 23 | KBUILD_CFLAGS += $(cflags-y) |
24 | KBUILD_AFLAGS += $(aflags-y) | 24 | KBUILD_AFLAGS += $(aflags-y) |
25 | 25 | KBUILD_LDFLAGS += $(ldflags-y) | |
26 | # no KBUILD_LDFLAGS? | ||
27 | LDFLAGS += $(ldflags-y) | ||
28 | 26 | ||
29 | # Thread-info register will be r19. This value is not configureable; | 27 | # Thread-info register will be r19. This value is not configureable; |
30 | # it is hard-coded in several files. | 28 | # it is hard-coded in several files. |
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index f0dd9fc84002..997c9f20ea0f 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile | |||
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__ | |||
69 | KBUILD_AFLAGS += -D__uClinux__ | 69 | KBUILD_AFLAGS += -D__uClinux__ |
70 | endif | 70 | endif |
71 | 71 | ||
72 | LDFLAGS := -m m68kelf | 72 | KBUILD_LDFLAGS := -m m68kelf |
73 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds | 73 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds |
74 | 74 | ||
75 | ifdef CONFIG_SUN3 | 75 | ifdef CONFIG_SUN3 |
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 73330360a8e6..4f3ab5707265 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile | |||
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare | |||
40 | ifdef CONFIG_CPU_BIG_ENDIAN | 40 | ifdef CONFIG_CPU_BIG_ENDIAN |
41 | KBUILD_CFLAGS += -mbig-endian | 41 | KBUILD_CFLAGS += -mbig-endian |
42 | KBUILD_AFLAGS += -mbig-endian | 42 | KBUILD_AFLAGS += -mbig-endian |
43 | LDFLAGS += -EB | 43 | KBUILD_LDFLAGS += -EB |
44 | else | 44 | else |
45 | KBUILD_CFLAGS += -mlittle-endian | 45 | KBUILD_CFLAGS += -mlittle-endian |
46 | KBUILD_AFLAGS += -mlittle-endian | 46 | KBUILD_AFLAGS += -mlittle-endian |
47 | LDFLAGS += -EL | 47 | KBUILD_LDFLAGS += -EL |
48 | endif | 48 | endif |
49 | 49 | ||
50 | CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) | 50 | CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 5425df002a6b..d74b3742fa5d 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -309,7 +309,7 @@ endif | |||
309 | # instead of .eh_frame so we don't discard them. | 309 | # instead of .eh_frame so we don't discard them. |
310 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | 310 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables |
311 | 311 | ||
312 | LDFLAGS += -m $(ld-emul) | 312 | KBUILD_LDFLAGS += -m $(ld-emul) |
313 | 313 | ||
314 | ifdef CONFIG_MIPS | 314 | ifdef CONFIG_MIPS |
315 | CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ | 315 | CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ |
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index abe77add8789..3c453a1f1ff1 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile | |||
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS) | |||
92 | vmlinuzobjs-y += $(obj)/piggy.o | 92 | vmlinuzobjs-y += $(obj)/piggy.o |
93 | 93 | ||
94 | quiet_cmd_zld = LD $@ | 94 | 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 $@ |
96 | quiet_cmd_strip = STRIP $@ | 96 | quiet_cmd_strip = STRIP $@ |
97 | cmd_strip = $(STRIP) -s $@ | 97 | cmd_strip = $(STRIP) -s $@ |
98 | vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr | 98 | vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr |
diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile index 9ab1326f57c9..78ce4cff1012 100644 --- a/arch/mips/lasat/image/Makefile +++ b/arch/mips/lasat/image/Makefile | |||
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom | |||
38 | 38 | ||
39 | # Rule to make the bootloader | 39 | # Rule to make the bootloader |
40 | $(obj)/rom: $(addprefix $(obj)/,$(OBJECTS)) | 40 | $(obj)/rom: $(addprefix $(obj)/,$(OBJECTS)) |
41 | $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^ | 41 | $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^ |
42 | 42 | ||
43 | $(obj)/%.o: $(obj)/%.gz | 43 | $(obj)/%.o: $(obj)/%.gz |
44 | $(LD) -r -o $@ -b binary $< | 44 | $(LD) -r -o $@ -b binary $< |
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile index 031c676821ff..63f4f173e5f4 100644 --- a/arch/nds32/Makefile +++ b/arch/nds32/Makefile | |||
@@ -33,12 +33,12 @@ endif | |||
33 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 33 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
34 | KBUILD_CFLAGS += $(call cc-option, -EL) | 34 | KBUILD_CFLAGS += $(call cc-option, -EL) |
35 | KBUILD_AFLAGS += $(call cc-option, -EL) | 35 | KBUILD_AFLAGS += $(call cc-option, -EL) |
36 | LDFLAGS += $(call cc-option, -EL) | 36 | KBUILD_LDFLAGS += $(call cc-option, -EL) |
37 | CHECKFLAGS += -D__NDS32_EL__ | 37 | CHECKFLAGS += -D__NDS32_EL__ |
38 | else | 38 | else |
39 | KBUILD_CFLAGS += $(call cc-option, -EB) | 39 | KBUILD_CFLAGS += $(call cc-option, -EB) |
40 | KBUILD_AFLAGS += $(call cc-option, -EB) | 40 | KBUILD_AFLAGS += $(call cc-option, -EB) |
41 | LDFLAGS += $(call cc-option, -EB) | 41 | KBUILD_LDFLAGS += $(call cc-option, -EB) |
42 | CHECKFLAGS += -D__NDS32_EB__ | 42 | CHECKFLAGS += -D__NDS32_EB__ |
43 | endif | 43 | endif |
44 | 44 | ||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 8397c7bd5880..11a1acba164a 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -76,14 +76,14 @@ endif | |||
76 | 76 | ||
77 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 77 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
78 | KBUILD_CFLAGS += -mlittle-endian | 78 | KBUILD_CFLAGS += -mlittle-endian |
79 | LDFLAGS += -EL | 79 | KBUILD_LDFLAGS += -EL |
80 | LDEMULATION := lppc | 80 | LDEMULATION := lppc |
81 | GNUTARGET := powerpcle | 81 | GNUTARGET := powerpcle |
82 | MULTIPLEWORD := -mno-multiple | 82 | MULTIPLEWORD := -mno-multiple |
83 | KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) | 83 | KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) |
84 | else | 84 | else |
85 | KBUILD_CFLAGS += $(call cc-option,-mbig-endian) | 85 | KBUILD_CFLAGS += $(call cc-option,-mbig-endian) |
86 | LDFLAGS += -EB | 86 | KBUILD_LDFLAGS += -EB |
87 | LDEMULATION := ppc | 87 | LDEMULATION := ppc |
88 | GNUTARGET := powerpc | 88 | GNUTARGET := powerpc |
89 | MULTIPLEWORD := -mmultiple | 89 | MULTIPLEWORD := -mmultiple |
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian | |||
108 | ifeq ($(HAS_BIARCH),y) | 108 | ifeq ($(HAS_BIARCH),y) |
109 | KBUILD_CFLAGS += -m$(BITS) | 109 | KBUILD_CFLAGS += -m$(BITS) |
110 | KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) | 110 | KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) |
111 | LDFLAGS += -m elf$(BITS)$(LDEMULATION) | 111 | KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) |
112 | KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET) | 112 | KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET) |
113 | endif | 113 | endif |
114 | 114 | ||
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 9ddd88bb30b7..61ec42405ec9 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile | |||
@@ -29,7 +29,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y) | |||
29 | KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128) | 29 | KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128) |
30 | 30 | ||
31 | KBUILD_MARCH = rv64im | 31 | KBUILD_MARCH = rv64im |
32 | LDFLAGS += -melf64lriscv | 32 | KBUILD_LDFLAGS += -melf64lriscv |
33 | else | 33 | else |
34 | BITS := 32 | 34 | BITS := 32 |
35 | UTS_MACHINE := riscv32 | 35 | UTS_MACHINE := riscv32 |
@@ -37,7 +37,7 @@ else | |||
37 | KBUILD_CFLAGS += -mabi=ilp32 | 37 | KBUILD_CFLAGS += -mabi=ilp32 |
38 | KBUILD_AFLAGS += -mabi=ilp32 | 38 | KBUILD_AFLAGS += -mabi=ilp32 |
39 | KBUILD_MARCH = rv32im | 39 | KBUILD_MARCH = rv32im |
40 | LDFLAGS += -melf32lriscv | 40 | KBUILD_LDFLAGS += -melf32lriscv |
41 | endif | 41 | endif |
42 | 42 | ||
43 | KBUILD_CFLAGS += -Wall | 43 | KBUILD_CFLAGS += -Wall |
diff --git a/arch/s390/Makefile b/arch/s390/Makefile index ba6d122526fb..ee65185bbc80 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile | |||
@@ -11,7 +11,7 @@ | |||
11 | # | 11 | # |
12 | 12 | ||
13 | LD_BFD := elf64-s390 | 13 | LD_BFD := elf64-s390 |
14 | LDFLAGS := -m elf64_s390 | 14 | KBUILD_LDFLAGS := -m elf64_s390 |
15 | KBUILD_AFLAGS_MODULE += -fPIC | 15 | KBUILD_AFLAGS_MODULE += -fPIC |
16 | KBUILD_CFLAGS_MODULE += -fPIC | 16 | KBUILD_CFLAGS_MODULE += -fPIC |
17 | KBUILD_AFLAGS += -m64 | 17 | KBUILD_AFLAGS += -m64 |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 65300193b99f..c521ade2557c 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -122,11 +122,11 @@ endif | |||
122 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 122 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
123 | ld-bfd := elf32-$(UTS_MACHINE)-linux | 123 | ld-bfd := elf32-$(UTS_MACHINE)-linux |
124 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) | 124 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) |
125 | LDFLAGS += -EL | 125 | KBUILD_LDFLAGS += -EL |
126 | else | 126 | else |
127 | ld-bfd := elf32-$(UTS_MACHINE)big-linux | 127 | ld-bfd := elf32-$(UTS_MACHINE)big-linux |
128 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) | 128 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) |
129 | LDFLAGS += -EB | 129 | KBUILD_LDFLAGS += -EB |
130 | endif | 130 | endif |
131 | 131 | ||
132 | export ld-bfd BITS | 132 | export ld-bfd BITS |
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index 966a13d2b127..8ece494ea0f9 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile | |||
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y) | |||
21 | # | 21 | # |
22 | 22 | ||
23 | CHECKFLAGS += -D__sparc__ | 23 | CHECKFLAGS += -D__sparc__ |
24 | LDFLAGS := -m elf32_sparc | 24 | KBUILD_LDFLAGS := -m elf32_sparc |
25 | export BITS := 32 | 25 | export BITS := 32 |
26 | UTS_MACHINE := sparc | 26 | UTS_MACHINE := sparc |
27 | 27 | ||
@@ -40,7 +40,7 @@ else | |||
40 | # | 40 | # |
41 | 41 | ||
42 | CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ | 42 | CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ |
43 | LDFLAGS := -m elf64_sparc | 43 | KBUILD_LDFLAGS := -m elf64_sparc |
44 | export BITS := 64 | 44 | export BITS := 64 |
45 | UTS_MACHINE := sparc64 | 45 | UTS_MACHINE := sparc64 |
46 | 46 | ||
diff --git a/arch/um/Makefile b/arch/um/Makefile index 44ddc3e8fa66..ab1066c38944 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -133,7 +133,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT) | |||
133 | # The wrappers will select whether using "malloc" or the kernel allocator. | 133 | # The wrappers will select whether using "malloc" or the kernel allocator. |
134 | LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc | 134 | LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc |
135 | 135 | ||
136 | LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) | 136 | LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt)) |
137 | 137 | ||
138 | # Used by link-vmlinux.sh which has special support for um link | 138 | # Used by link-vmlinux.sh which has special support for um link |
139 | export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) | 139 | export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 7e3c07d6ad42..94859241bc3e 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -219,7 +219,7 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2 | |||
219 | KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) | 219 | KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) |
220 | KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) | 220 | KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) |
221 | 221 | ||
222 | LDFLAGS := -m elf_$(UTS_MACHINE) | 222 | KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) |
223 | 223 | ||
224 | # | 224 | # |
225 | # The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to | 225 | # The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to |
@@ -227,7 +227,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE) | |||
227 | # by the linker. | 227 | # by the linker. |
228 | # | 228 | # |
229 | ifdef CONFIG_X86_64 | 229 | 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) |
231 | endif | 231 | endif |
232 | 232 | ||
233 | # Speed up the build | 233 | # Speed up the build |
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index 5296f8c9e7f0..91085a08de6c 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um | |||
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/ | |||
4 | ifeq ($(CONFIG_X86_32),y) | 4 | ifeq ($(CONFIG_X86_32),y) |
5 | START := 0x8048000 | 5 | START := 0x8048000 |
6 | 6 | ||
7 | LDFLAGS += -m elf_i386 | 7 | KBUILD_LDFLAGS += -m elf_i386 |
8 | ELF_ARCH := i386 | 8 | ELF_ARCH := i386 |
9 | ELF_FORMAT := elf32-i386 | 9 | ELF_FORMAT := elf32-i386 |
10 | CHECKFLAGS += -D__i386__ | 10 | CHECKFLAGS += -D__i386__ |
@@ -43,7 +43,7 @@ KBUILD_CFLAGS += -fno-builtin -m64 | |||
43 | 43 | ||
44 | CHECKFLAGS += -m64 -D__x86_64__ | 44 | CHECKFLAGS += -m64 -D__x86_64__ |
45 | KBUILD_AFLAGS += -m64 | 45 | KBUILD_AFLAGS += -m64 |
46 | LDFLAGS += -m elf_x86_64 | 46 | KBUILD_LDFLAGS += -m elf_x86_64 |
47 | KBUILD_CPPFLAGS += -m64 | 47 | KBUILD_CPPFLAGS += -m64 |
48 | 48 | ||
49 | ELF_ARCH := i386:x86-64 | 49 | ELF_ARCH := i386:x86-64 |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 169c2feda14a..28764dacf018 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -42,16 +42,16 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | |||
42 | GCOV_PROFILE := n | 42 | GCOV_PROFILE := n |
43 | UBSAN_SANITIZE :=n | 43 | UBSAN_SANITIZE :=n |
44 | 44 | ||
45 | LDFLAGS := -m elf_$(UTS_MACHINE) | 45 | KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) |
46 | # Compressed kernel should be built as PIE since it may be loaded at any | 46 | # Compressed kernel should be built as PIE since it may be loaded at any |
47 | # address by the bootloader. | 47 | # address by the bootloader. |
48 | ifeq ($(CONFIG_X86_32),y) | 48 | ifeq ($(CONFIG_X86_32),y) |
49 | LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker) | 49 | KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker) |
50 | else | 50 | else |
51 | # To build 64-bit compressed kernel as PIE, we disable relocation | 51 | # To build 64-bit compressed kernel as PIE, we disable relocation |
52 | # overflow check to avoid relocation overflow error with a new linker | 52 | # overflow check to avoid relocation overflow error with a new linker |
53 | # command-line option, -z noreloc-overflow. | 53 | # command-line option, -z noreloc-overflow. |
54 | LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ | 54 | KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ |
55 | && echo "-z noreloc-overflow -pie --no-dynamic-linker") | 55 | && echo "-z noreloc-overflow -pie --no-dynamic-linker") |
56 | endif | 56 | endif |
57 | LDFLAGS_vmlinux := -T | 57 | LDFLAGS_vmlinux := -T |
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 3a934b72a272..295c120ed099 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,) | |||
49 | KBUILD_AFLAGS += -mlongcalls -mtext-section-literals | 49 | KBUILD_AFLAGS += -mlongcalls -mtext-section-literals |
50 | 50 | ||
51 | ifneq ($(CONFIG_LD_NO_RELAX),) | 51 | ifneq ($(CONFIG_LD_NO_RELAX),) |
52 | LDFLAGS := --no-relax | 52 | KBUILD_LDFLAGS := --no-relax |
53 | endif | 53 | endif |
54 | 54 | ||
55 | ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1) | 55 | ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1) |
diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile index 521471981356..12ae1e91cb75 100644 --- a/arch/xtensa/boot/boot-elf/Makefile +++ b/arch/xtensa/boot/boot-elf/Makefile | |||
@@ -25,7 +25,7 @@ $(obj)/Image.o: vmlinux.bin $(OBJS) | |||
25 | $(OBJS) $@ | 25 | $(OBJS) $@ |
26 | 26 | ||
27 | $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds | 27 | $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds |
28 | $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ | 28 | $(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \ |
29 | -T $(obj)/boot.lds \ | 29 | -T $(obj)/boot.lds \ |
30 | --build-id=none \ | 30 | --build-id=none \ |
31 | -o $@ $(obj)/Image.o | 31 | -o $@ $(obj)/Image.o |
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 7c98f60e2266..c75413d05a63 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\ | |||
163 | $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) | 163 | $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
164 | 164 | ||
165 | # ld-option | 165 | # ld-option |
166 | # Usage: LDFLAGS += $(call ld-option, -X, -Y) | 166 | # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) |
167 | ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2),$(3)) | 167 | ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) |
168 | 168 | ||
169 | # ar-option | 169 | # ar-option |
170 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) | 170 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f5d7612696d0..1c48572223d1 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -190,7 +190,7 @@ cmd_modversions_c = \ | |||
190 | $(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ | 190 | $(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ |
191 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 191 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
192 | \ | 192 | \ |
193 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 193 | $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
194 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 194 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
195 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 195 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
196 | else \ | 196 | else \ |
@@ -220,7 +220,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH | |||
220 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ | 220 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
221 | "$(if $(CONFIG_64BIT),64,32)" \ | 221 | "$(if $(CONFIG_64BIT),64,32)" \ |
222 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ | 222 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ |
223 | "$(LD) $(LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ | 223 | "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ |
224 | "$(if $(part-of-module),1,0)" "$(@)"; | 224 | "$(if $(part-of-module),1,0)" "$(@)"; |
225 | recordmcount_source := $(srctree)/scripts/recordmcount.pl | 225 | recordmcount_source := $(srctree)/scripts/recordmcount.pl |
226 | endif # BUILD_C_RECORDMCOUNT | 226 | endif # BUILD_C_RECORDMCOUNT |
@@ -394,7 +394,7 @@ cmd_modversions_S = \ | |||
394 | $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ | 394 | $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ |
395 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 395 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
396 | \ | 396 | \ |
397 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 397 | $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
398 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 398 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
399 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 399 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
400 | else \ | 400 | else \ |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index df0fff252619..61e596650ed3 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | |||
162 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | 162 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ |
163 | $(__cpp_flags) | 163 | $(__cpp_flags) |
164 | 164 | ||
165 | ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) | 165 | ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) |
166 | 166 | ||
167 | DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes | 167 | DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes |
168 | 168 | ||
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index dd92dbbbaa68..7d4af0d0accb 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) | |||
120 | # Step 6), final link of the modules with optional arch pass after final link | 120 | # Step 6), final link of the modules with optional arch pass after final link |
121 | quiet_cmd_ld_ko_o = LD [M] $@ | 121 | quiet_cmd_ld_ko_o = LD [M] $@ |
122 | cmd_ld_ko_o = \ | 122 | cmd_ld_ko_o = \ |
123 | $(LD) -r $(LDFLAGS) \ | 123 | $(LD) -r $(KBUILD_LDFLAGS) \ |
124 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ | 124 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ |
125 | -o $@ $(filter-out FORCE,$^) ; \ | 125 | -o $@ $(filter-out FORCE,$^) ; \ |
126 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) | 126 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 4bf811c09f59..c8cf45362bd6 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -75,7 +75,7 @@ modpost_link() | |||
75 | ${KBUILD_VMLINUX_LIBS} \ | 75 | ${KBUILD_VMLINUX_LIBS} \ |
76 | --end-group" | 76 | --end-group" |
77 | 77 | ||
78 | ${LD} ${LDFLAGS} -r -o ${1} ${objects} | 78 | ${LD} ${KBUILD_LDFLAGS} -r -o ${1} ${objects} |
79 | } | 79 | } |
80 | 80 | ||
81 | # Link of vmlinux | 81 | # Link of vmlinux |
@@ -95,7 +95,7 @@ vmlinux_link() | |||
95 | --end-group \ | 95 | --end-group \ |
96 | ${1}" | 96 | ${1}" |
97 | 97 | ||
98 | ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ | 98 | ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ |
99 | -T ${lds} ${objects} | 99 | -T ${lds} ${objects} |
100 | else | 100 | else |
101 | objects="-Wl,--whole-archive \ | 101 | objects="-Wl,--whole-archive \ |