* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
This series renames LDFLAGS to KBUILD_LDFLAGS
after some Makefile cleanups.
Currently, the last patch does not apply to Linus' tree
due to missing pre-requisite patches.
I will resolve conflicts as needed.
Masahiro Yamada (6):
um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
ARM: vfp: clean-up arch/arm/vfp/Makefile
kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
kbuild: change ld_flags to contain LDFLAGS_$(@F)
kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 7 ++-----
arch/arm/vfp/Makefile | 5 +----
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/openrisc/Makefile | 1 -
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 5 ++---
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/um/drivers/Makefile | 4 ++--
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 4 +---
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 5 ++---
scripts/Makefile.modpost | 2 +-
31 files changed, 48 insertions(+), 62 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
This series renames LDFLAGS to KBUILD_LDFLAGS
after some Makefile cleanups.
Currently, the last patch does not apply to Linus' tree
due to missing pre-requisite patches.
I will resolve conflicts as needed.
Masahiro Yamada (6):
um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
ARM: vfp: clean-up arch/arm/vfp/Makefile
kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
kbuild: change ld_flags to contain LDFLAGS_$(@F)
kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 7 ++-----
arch/arm/vfp/Makefile | 5 +----
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/openrisc/Makefile | 1 -
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 5 ++---
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/um/drivers/Makefile | 4 ++--
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 4 +---
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 5 ++---
scripts/Makefile.modpost | 2 +-
31 files changed, 48 insertions(+), 62 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
This series renames LDFLAGS to KBUILD_LDFLAGS
after some Makefile cleanups.
Currently, the last patch does not apply to Linus' tree
due to missing pre-requisite patches.
I will resolve conflicts as needed.
Masahiro Yamada (6):
um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
ARM: vfp: clean-up arch/arm/vfp/Makefile
kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
kbuild: change ld_flags to contain LDFLAGS_$(@F)
kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 7 ++-----
arch/arm/vfp/Makefile | 5 +----
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/openrisc/Makefile | 1 -
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 5 ++---
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/um/drivers/Makefile | 4 ++--
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 4 +---
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 5 ++---
scripts/Makefile.modpost | 2 +-
31 files changed, 48 insertions(+), 62 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
This series renames LDFLAGS to KBUILD_LDFLAGS
after some Makefile cleanups.
Currently, the last patch does not apply to Linus' tree
due to missing pre-requisite patches.
I will resolve conflicts as needed.
Masahiro Yamada (6):
um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
ARM: vfp: clean-up arch/arm/vfp/Makefile
kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
kbuild: change ld_flags to contain LDFLAGS_$(@F)
kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 7 ++-----
arch/arm/vfp/Makefile | 5 +----
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/openrisc/Makefile | 1 -
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 5 ++---
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/um/drivers/Makefile | 4 ++--
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 4 +---
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 5 ++---
scripts/Makefile.modpost | 2 +-
31 files changed, 48 insertions(+), 62 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
2018-07-12 8:01 ` Masahiro Yamada
` (2 preceding siblings ...)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
This is already exported by the top-level Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/Makefile.um | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 45af199..5296f8c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -13,8 +13,6 @@ KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS += $(call cc-option,-m32)
LINK-y += $(call cc-option,-m32)
-export LDFLAGS
-
LDS_EXTRA := -Ui386
export LDS_EXTRA
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
This is already exported by the top-level Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/Makefile.um | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 45af199..5296f8c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -13,8 +13,6 @@ KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS += $(call cc-option,-m32)
LINK-y += $(call cc-option,-m32)
-export LDFLAGS
-
LDS_EXTRA := -Ui386
export LDS_EXTRA
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
This is already exported by the top-level Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/Makefile.um | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 45af199..5296f8c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -13,8 +13,6 @@ KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS += $(call cc-option,-m32)
LINK-y += $(call cc-option,-m32)
-export LDFLAGS
-
LDS_EXTRA := -Ui386
export LDS_EXTRA
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
This is already exported by the top-level Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/Makefile.um | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 45af199..5296f8c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -13,8 +13,6 @@ KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS += $(call cc-option,-m32)
LINK-y += $(call cc-option,-m32)
-export LDFLAGS
-
LDS_EXTRA := -Ui386
export LDS_EXTRA
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, Jeff Dike, x86, linux-um, linux-kernel,
Masahiro Yamada, Russell King, openrisc, Kirill A . Shutemov,
linux-riscv, linux-arm-kernel
This is already exported by the top-level Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/Makefile.um | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 45af199..5296f8c 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -13,8 +13,6 @@ KBUILD_CFLAGS += $(call cc-option,-m32)
KBUILD_AFLAGS += $(call cc-option,-m32)
LINK-y += $(call cc-option,-m32)
-export LDFLAGS
-
LDS_EXTRA := -Ui386
export LDS_EXTRA
--
2.7.4
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile
2018-07-12 8:01 ` Masahiro Yamada
` (2 preceding siblings ...)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
Since commit 799c43415442 ("kbuild: thin archives make default for
all archs"), $(AR) is used instead of $(LD) to combine object files.
LDFLAGS +=--no-warn-mismatch
... is unused code now.
arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol,
CONFIG_VFP, like this:
core-$(CONFIG_VFP) += arch/arm/vfp/
..., so $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
Also, there is no point to use pseudo object, vfp.o, which never becomes
a module. Add all objects directly to obj-y.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/vfp/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index a81404c..94516c4 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -8,8 +8,5 @@
# asflags-y := -DDEBUG
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
-LDFLAGS +=--no-warn-mismatch
-obj-y += vfp.o
-
-vfp-$(CONFIG_VFP) += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
+obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
Since commit 799c43415442 ("kbuild: thin archives make default for
all archs"), $(AR) is used instead of $(LD) to combine object files.
LDFLAGS +=--no-warn-mismatch
... is unused code now.
arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol,
CONFIG_VFP, like this:
core-$(CONFIG_VFP) += arch/arm/vfp/
..., so $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
Also, there is no point to use pseudo object, vfp.o, which never becomes
a module. Add all objects directly to obj-y.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/vfp/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index a81404c..94516c4 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -8,8 +8,5 @@
# asflags-y := -DDEBUG
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
-LDFLAGS +=--no-warn-mismatch
-obj-y += vfp.o
-
-vfp-$(CONFIG_VFP) += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
+obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
Since commit 799c43415442 ("kbuild: thin archives make default for
all archs"), $(AR) is used instead of $(LD) to combine object files.
LDFLAGS +=--no-warn-mismatch
... is unused code now.
arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol,
CONFIG_VFP, like this:
core-$(CONFIG_VFP) += arch/arm/vfp/
..., so $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
Also, there is no point to use pseudo object, vfp.o, which never becomes
a module. Add all objects directly to obj-y.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/vfp/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index a81404c..94516c4 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -8,8 +8,5 @@
# asflags-y := -DDEBUG
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
-LDFLAGS +=--no-warn-mismatch
-obj-y += vfp.o
-
-vfp-$(CONFIG_VFP) += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
+obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
Since commit 799c43415442 ("kbuild: thin archives make default for
all archs"), $(AR) is used instead of $(LD) to combine object files.
LDFLAGS +=--no-warn-mismatch
... is unused code now.
arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol,
CONFIG_VFP, like this:
core-$(CONFIG_VFP) += arch/arm/vfp/
..., so $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
Also, there is no point to use pseudo object, vfp.o, which never becomes
a module. Add all objects directly to obj-y.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/vfp/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index a81404c..94516c4 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -8,8 +8,5 @@
# asflags-y := -DDEBUG
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
-LDFLAGS +=--no-warn-mismatch
-obj-y += vfp.o
-
-vfp-$(CONFIG_VFP) += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
+obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, Jeff Dike, x86, linux-um, linux-kernel,
Masahiro Yamada, Russell King, openrisc, Kirill A . Shutemov,
linux-riscv, linux-arm-kernel
Since commit 799c43415442 ("kbuild: thin archives make default for
all archs"), $(AR) is used instead of $(LD) to combine object files.
LDFLAGS +=--no-warn-mismatch
... is unused code now.
arch/arm/Makefile already guards arch/arm/vfp/ by a boolean symbol,
CONFIG_VFP, like this:
core-$(CONFIG_VFP) += arch/arm/vfp/
..., so $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
Also, there is no point to use pseudo object, vfp.o, which never becomes
a module. Add all objects directly to obj-y.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/vfp/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index a81404c..94516c4 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -8,8 +8,5 @@
# asflags-y := -DDEBUG
KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
-LDFLAGS +=--no-warn-mismatch
-obj-y += vfp.o
-
-vfp-$(CONFIG_VFP) += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
+obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
--
2.7.4
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 3/6] kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
2018-07-12 8:01 ` Masahiro Yamada
(?)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
Since commit ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile"),
the top-level Makefile caters to this.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/Makefile | 3 ---
arch/openrisc/Makefile | 1 -
arch/riscv/Makefile | 1 -
3 files changed, 5 deletions(-)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 62ebeae..e7d703d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -10,9 +10,6 @@
#
# Copyright (C) 1995-2001 by Russell King
-# Ensure linker flags are correct
-LDFLAGS :=
-
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
LDFLAGS_vmlinux += --be8
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 89076a6..70e06d3 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -19,7 +19,6 @@
KBUILD_DEFCONFIG := or1ksim_defconfig
-LDFLAGS :=
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux :=
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6d4a5f6c..2627e48 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -8,7 +8,6 @@
# for more details.
#
-LDFLAGS :=
OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux :=
ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 3/6] kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
Since commit ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile"),
the top-level Makefile caters to this.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/Makefile | 3 ---
arch/openrisc/Makefile | 1 -
arch/riscv/Makefile | 1 -
3 files changed, 5 deletions(-)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 62ebeae..e7d703d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -10,9 +10,6 @@
#
# Copyright (C) 1995-2001 by Russell King
-# Ensure linker flags are correct
-LDFLAGS :=
-
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
LDFLAGS_vmlinux += --be8
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 89076a6..70e06d3 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -19,7 +19,6 @@
KBUILD_DEFCONFIG := or1ksim_defconfig
-LDFLAGS :=
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux :=
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6d4a5f6c..2627e48 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -8,7 +8,6 @@
# for more details.
#
-LDFLAGS :=
OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux :=
ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 3/6] kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
Since commit ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile"),
the top-level Makefile caters to this.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/Makefile | 3 ---
arch/openrisc/Makefile | 1 -
arch/riscv/Makefile | 1 -
3 files changed, 5 deletions(-)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 62ebeae..e7d703d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -10,9 +10,6 @@
#
# Copyright (C) 1995-2001 by Russell King
-# Ensure linker flags are correct
-LDFLAGS :=
-
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
LDFLAGS_vmlinux += --be8
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 89076a6..70e06d3 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -19,7 +19,6 @@
KBUILD_DEFCONFIG := or1ksim_defconfig
-LDFLAGS :=
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux :=
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6d4a5f6c..2627e48 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -8,7 +8,6 @@
# for more details.
#
-LDFLAGS :=
OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux :=
ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 3/6] kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
Since commit ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile"),
the top-level Makefile caters to this.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/Makefile | 3 ---
arch/openrisc/Makefile | 1 -
arch/riscv/Makefile | 1 -
3 files changed, 5 deletions(-)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 62ebeae..e7d703d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -10,9 +10,6 @@
#
# Copyright (C) 1995-2001 by Russell King
-# Ensure linker flags are correct
-LDFLAGS :=
-
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
LDFLAGS_vmlinux += --be8
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 89076a6..70e06d3 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -19,7 +19,6 @@
KBUILD_DEFCONFIG := or1ksim_defconfig
-LDFLAGS :=
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux :=
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6d4a5f6c..2627e48 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -8,7 +8,6 @@
# for more details.
#
-LDFLAGS :=
OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux :=
ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 4/6] kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
2018-07-12 8:01 ` Masahiro Yamada
(?)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
$(LDFLAGS) $(ldflags-y) is equivalent to $(ld_flags).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/Makefile.lib | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..1915574 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -225,8 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
- $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 4/6] kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
$(LDFLAGS) $(ldflags-y) is equivalent to $(ld_flags).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/Makefile.lib | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..1915574 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -225,8 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
- $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 4/6] kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
$(LDFLAGS) $(ldflags-y) is equivalent to $(ld_flags).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/Makefile.lib | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..1915574 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -225,8 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
- $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 4/6] kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
$(LDFLAGS) $(ldflags-y) is equivalent to $(ld_flags).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/Makefile.lib | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1bb594f..1915574 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -225,8 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
- $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F)
2018-07-12 8:01 ` Masahiro Yamada
` (2 preceding siblings ...)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/drivers/Makefile | 4 ++--
scripts/Makefile.lib | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 16b3ceb..69331983 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1915574..f56bb4b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
@@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/drivers/Makefile | 4 ++--
scripts/Makefile.lib | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 16b3ceb..69331983 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1915574..f56bb4b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
@@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/drivers/Makefile | 4 ++--
scripts/Makefile.lib | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 16b3ceb..69331983 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1915574..f56bb4b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
@@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/drivers/Makefile | 4 ++--
scripts/Makefile.lib | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 16b3ceb..69331983 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1915574..f56bb4b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
@@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F)
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, Jeff Dike, x86, linux-um, linux-kernel,
Masahiro Yamada, Russell King, openrisc, Kirill A . Shutemov,
linux-riscv, linux-arm-kernel
Put $(LDFLAGS_$(@F)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/drivers/Makefile | 4 ++--
scripts/Makefile.lib | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 16b3ceb..69331983 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
- $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
+ $(LD) -r -dp -o $@ $^ $(ld_flags)
#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1915574..f56bb4b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
@@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 6/6] kbuild: rename LDFLAGS to KBUILD_LDFLAGS
2018-07-12 8:01 ` Masahiro Yamada
(?)
(?)
@ 2018-07-12 8:01 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-kbuild
Cc: Richard Weinberger, x86, linux-um, linux-kernel, Russell King,
openrisc, linux-arm-kernel, linux-riscv, Jeff Dike,
Kirill A . Shutemov, Masahiro Yamada
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>
---
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 4 ++--
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 4 ++--
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 2 +-
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 2 +-
scripts/Makefile.modpost | 2 +-
28 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/Makefile b/Makefile
index 925c55f..9eaa9b7 100644
--- a/Makefile
+++ b/Makefile
@@ -426,7 +426,7 @@ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
-LDFLAGS :=
+KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
@@ -434,7 +434,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX 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 CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -997,7 +997,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link
cmd_link-vmlinux = \
- $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
+ $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d..5aecb8b 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
# Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
head-y := arch/arc/kernel/head.o
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e7d703d..360f80a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__ARMEB__
AS += -EB
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__ARMEL__
AS += -EL
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
#
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 7976d2d..ae064d1 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -60,13 +60,13 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__AARCH64EB__
AS += -EB
-LDFLAGS += -EB -maarch64elfb
+KBUILD_LDFLAGS += -EB -maarch64elfb
UTS_MACHINE := aarch64_be
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__AARCH64EL__
AS += -EL
-LDFLAGS += -EL -maarch64elf
+KBUILD_LDFLAGS += -EL -maarch64elf
UTS_MACHINE := aarch64
endif
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index 6ab942e..3fe8a94 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian
-KBUILD_LDFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -mbig-endian -EB
CHECKFLAGS += -D_BIG_ENDIAN
endif
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index e1c02ca..f9cbbb1 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -20,7 +20,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
KBUILD_CFLAGS += -D__linux__
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
KBUILD_AFLAGS += $(aflags-y)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := h8300-unknown-linux-
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile
index 2efaa18..4c5858b 100644
--- a/arch/hexagon/Makefile
+++ b/arch/hexagon/Makefile
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y)
-
-# no KBUILD_LDFLAGS?
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
# Thread-info register will be r19. This value is not configureable;
# it is hard-coded in several files.
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index f0dd9fc..997c9f2 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
KBUILD_AFLAGS += -D__uClinux__
endif
-LDFLAGS := -m m68kelf
+KBUILD_LDFLAGS := -m m68kelf
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifdef CONFIG_SUN3
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 7333036..4f3ab57 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CFLAGS += -mlittle-endian
KBUILD_AFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e2122cc..0d1b5e6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -303,7 +303,7 @@ endif
# instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS += -m $(ld-emul)
+KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_MIPS
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 abe77ad..3c453a1 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
vmlinuzobjs-y += $(obj)/piggy.o
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 $@
cmd_strip = $(STRIP) -s $@
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 9ab1326..78ce4cf 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
# Rule to make the bootloader
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
- $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
+ $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
$(obj)/%.o: $(obj)/%.gz
$(LD) -r -o $@ -b binary $<
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index 513bb2e..b1321c4 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -33,11 +33,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += $(call cc-option, -EL)
KBUILD_AFLAGS += $(call cc-option, -EL)
-LDFLAGS += $(call cc-option, -EL)
+KBUILD_LDFLAGS += $(call cc-option, -EL)
else
KBUILD_CFLAGS += $(call cc-option, -EB)
KBUILD_AFLAGS += $(call cc-option, -EB)
-LDFLAGS += $(call cc-option, -EB)
+KBUILD_LDFLAGS += $(call cc-option, -EB)
endif
boot := arch/nds32/boot
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2ea575c..3d157fc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -76,14 +76,14 @@ endif
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
KBUILD_CFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
LDEMULATION := lppc
GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
else
KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
LDEMULATION := ppc
GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(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)
endif
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 2627e48..71b5741 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -26,7 +26,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
KBUILD_CFLAGS += -mabi=lp64
KBUILD_AFLAGS += -mabi=lp64
KBUILD_MARCH = rv64im
- LDFLAGS += -melf64lriscv
+ KBUILD_LDFLAGS += -melf64lriscv
else
BITS := 32
UTS_MACHINE := riscv32
@@ -34,7 +34,7 @@ else
KBUILD_CFLAGS += -mabi=ilp32
KBUILD_AFLAGS += -mabi=ilp32
KBUILD_MARCH = rv32im
- LDFLAGS += -melf32lriscv
+ KBUILD_LDFLAGS += -melf32lriscv
endif
KBUILD_CFLAGS += -Wall
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 68a6904..60120b6 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -11,7 +11,7 @@
#
LD_BFD := elf64-s390
-LDFLAGS := -m elf64_s390
+KBUILD_LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 65300193..c521ade 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -122,11 +122,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
ld-bfd := elf32-$(UTS_MACHINE)-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
else
ld-bfd := elf32-$(UTS_MACHINE)big-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
endif
export ld-bfd BITS
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 966a13d..8ece494 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y)
#
CHECKFLAGS += -D__sparc__
-LDFLAGS := -m elf32_sparc
+KBUILD_LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
@@ -40,7 +40,7 @@ else
#
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
-LDFLAGS := -m elf64_sparc
+KBUILD_LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..6c4aed1 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -142,7 +142,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
# The wrappers will select whether using "malloc" or the kernel allocator.
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
# Used by link-vmlinux.sh which has special support for um link
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a08e828..9129a96 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -224,7 +224,7 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
#
# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
@@ -232,7 +232,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE)
# by the linker.
#
ifdef CONFIG_X86_64
-LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
+KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
endif
# Speed up the build
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 5296f8c..0d347ee 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/
ifeq ($(CONFIG_X86_32),y)
START := 0x8048000
-LDFLAGS += -m elf_i386
+KBUILD_LDFLAGS += -m elf_i386
ELF_ARCH := i386
ELF_FORMAT := elf32-i386
CHECKFLAGS += -D__i386__
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f89..e1dc356 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -42,16 +42,16 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
UBSAN_SANITIZE :=n
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
# Compressed kernel should be built as PIE since it may be loaded at any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
-LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
+KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
else
# To build 64-bit compressed kernel as PIE, we disable relocation
# overflow check to avoid relocation overflow error with a new linker
# command-line option, -z noreloc-overflow.
-LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
+KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
LDFLAGS_vmlinux := -T
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 3a934b7..295c120 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
ifneq ($(CONFIG_LD_NO_RELAX),)
-LDFLAGS := --no-relax
+KBUILD_LDFLAGS := --no-relax
endif
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 5214719..12ae1e9 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)
$(OBJS) $@
$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
- $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
+ $(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(obj)/boot.lds \
--build-id=none \
-o $@ $(obj)/Image.o
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c8156d6..feb918f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\
$(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
# ld-option
-# Usage: LDFLAGS += $(call ld-option, -X)
-ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
+# Usage: KBUILD_LDFLAGS += $(call ld-option, -X)
+ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e7889f4..42d61c1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -197,7 +197,7 @@ cmd_modversions_c = \
$(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
@@ -404,7 +404,7 @@ cmd_modversions_S = \
$(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f56bb4b..193c551 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
+ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index df41744..fa00c61 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Step 6), final link of the modules with optional arch pass after final link
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = \
- $(LD) -r $(LDFLAGS) \
+ $(LD) -r $(KBUILD_LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
-o $@ $(filter-out FORCE,$^) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 6/6] kbuild: rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-riscv
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>
---
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 4 ++--
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 4 ++--
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 2 +-
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 2 +-
scripts/Makefile.modpost | 2 +-
28 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/Makefile b/Makefile
index 925c55f..9eaa9b7 100644
--- a/Makefile
+++ b/Makefile
@@ -426,7 +426,7 @@ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
-LDFLAGS :=
+KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
@@ -434,7 +434,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX 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 CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -997,7 +997,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link
cmd_link-vmlinux = \
- $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
+ $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d..5aecb8b 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
# Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
head-y := arch/arc/kernel/head.o
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e7d703d..360f80a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__ARMEB__
AS += -EB
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__ARMEL__
AS += -EL
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
#
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 7976d2d..ae064d1 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -60,13 +60,13 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__AARCH64EB__
AS += -EB
-LDFLAGS += -EB -maarch64elfb
+KBUILD_LDFLAGS += -EB -maarch64elfb
UTS_MACHINE := aarch64_be
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__AARCH64EL__
AS += -EL
-LDFLAGS += -EL -maarch64elf
+KBUILD_LDFLAGS += -EL -maarch64elf
UTS_MACHINE := aarch64
endif
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index 6ab942e..3fe8a94 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian
-KBUILD_LDFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -mbig-endian -EB
CHECKFLAGS += -D_BIG_ENDIAN
endif
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index e1c02ca..f9cbbb1 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -20,7 +20,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
KBUILD_CFLAGS += -D__linux__
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
KBUILD_AFLAGS += $(aflags-y)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := h8300-unknown-linux-
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile
index 2efaa18..4c5858b 100644
--- a/arch/hexagon/Makefile
+++ b/arch/hexagon/Makefile
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y)
-
-# no KBUILD_LDFLAGS?
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
# Thread-info register will be r19. This value is not configureable;
# it is hard-coded in several files.
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index f0dd9fc..997c9f2 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
KBUILD_AFLAGS += -D__uClinux__
endif
-LDFLAGS := -m m68kelf
+KBUILD_LDFLAGS := -m m68kelf
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifdef CONFIG_SUN3
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 7333036..4f3ab57 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CFLAGS += -mlittle-endian
KBUILD_AFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e2122cc..0d1b5e6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -303,7 +303,7 @@ endif
# instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS += -m $(ld-emul)
+KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_MIPS
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 abe77ad..3c453a1 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
vmlinuzobjs-y += $(obj)/piggy.o
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 $@
cmd_strip = $(STRIP) -s $@
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 9ab1326..78ce4cf 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
# Rule to make the bootloader
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
- $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
+ $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
$(obj)/%.o: $(obj)/%.gz
$(LD) -r -o $@ -b binary $<
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index 513bb2e..b1321c4 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -33,11 +33,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += $(call cc-option, -EL)
KBUILD_AFLAGS += $(call cc-option, -EL)
-LDFLAGS += $(call cc-option, -EL)
+KBUILD_LDFLAGS += $(call cc-option, -EL)
else
KBUILD_CFLAGS += $(call cc-option, -EB)
KBUILD_AFLAGS += $(call cc-option, -EB)
-LDFLAGS += $(call cc-option, -EB)
+KBUILD_LDFLAGS += $(call cc-option, -EB)
endif
boot := arch/nds32/boot
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2ea575c..3d157fc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -76,14 +76,14 @@ endif
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
KBUILD_CFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
LDEMULATION := lppc
GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
else
KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
LDEMULATION := ppc
GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(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)
endif
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 2627e48..71b5741 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -26,7 +26,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
KBUILD_CFLAGS += -mabi=lp64
KBUILD_AFLAGS += -mabi=lp64
KBUILD_MARCH = rv64im
- LDFLAGS += -melf64lriscv
+ KBUILD_LDFLAGS += -melf64lriscv
else
BITS := 32
UTS_MACHINE := riscv32
@@ -34,7 +34,7 @@ else
KBUILD_CFLAGS += -mabi=ilp32
KBUILD_AFLAGS += -mabi=ilp32
KBUILD_MARCH = rv32im
- LDFLAGS += -melf32lriscv
+ KBUILD_LDFLAGS += -melf32lriscv
endif
KBUILD_CFLAGS += -Wall
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 68a6904..60120b6 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -11,7 +11,7 @@
#
LD_BFD := elf64-s390
-LDFLAGS := -m elf64_s390
+KBUILD_LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 65300193..c521ade 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -122,11 +122,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
ld-bfd := elf32-$(UTS_MACHINE)-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
else
ld-bfd := elf32-$(UTS_MACHINE)big-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
endif
export ld-bfd BITS
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 966a13d..8ece494 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y)
#
CHECKFLAGS += -D__sparc__
-LDFLAGS := -m elf32_sparc
+KBUILD_LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
@@ -40,7 +40,7 @@ else
#
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
-LDFLAGS := -m elf64_sparc
+KBUILD_LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..6c4aed1 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -142,7 +142,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
# The wrappers will select whether using "malloc" or the kernel allocator.
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
# Used by link-vmlinux.sh which has special support for um link
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a08e828..9129a96 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -224,7 +224,7 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
#
# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
@@ -232,7 +232,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE)
# by the linker.
#
ifdef CONFIG_X86_64
-LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
+KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
endif
# Speed up the build
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 5296f8c..0d347ee 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/
ifeq ($(CONFIG_X86_32),y)
START := 0x8048000
-LDFLAGS += -m elf_i386
+KBUILD_LDFLAGS += -m elf_i386
ELF_ARCH := i386
ELF_FORMAT := elf32-i386
CHECKFLAGS += -D__i386__
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f89..e1dc356 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -42,16 +42,16 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
UBSAN_SANITIZE :=n
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
# Compressed kernel should be built as PIE since it may be loaded@any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
-LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
+KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
else
# To build 64-bit compressed kernel as PIE, we disable relocation
# overflow check to avoid relocation overflow error with a new linker
# command-line option, -z noreloc-overflow.
-LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
+KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
LDFLAGS_vmlinux := -T
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 3a934b7..295c120 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
ifneq ($(CONFIG_LD_NO_RELAX),)
-LDFLAGS := --no-relax
+KBUILD_LDFLAGS := --no-relax
endif
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 5214719..12ae1e9 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)
$(OBJS) $@
$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
- $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
+ $(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(obj)/boot.lds \
--build-id=none \
-o $@ $(obj)/Image.o
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c8156d6..feb918f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\
$(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
# ld-option
-# Usage: LDFLAGS += $(call ld-option, -X)
-ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
+# Usage: KBUILD_LDFLAGS += $(call ld-option, -X)
+ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e7889f4..42d61c1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -197,7 +197,7 @@ cmd_modversions_c = \
$(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
@@ -404,7 +404,7 @@ cmd_modversions_S = \
$(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f56bb4b..193c551 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
+ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index df41744..fa00c61 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Step 6), final link of the modules with optional arch pass after final link
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = \
- $(LD) -r $(LDFLAGS) \
+ $(LD) -r $(KBUILD_LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
-o $@ $(filter-out FORCE,$^) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 6/6] kbuild: rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 4 ++--
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 4 ++--
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 2 +-
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 2 +-
scripts/Makefile.modpost | 2 +-
28 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/Makefile b/Makefile
index 925c55f..9eaa9b7 100644
--- a/Makefile
+++ b/Makefile
@@ -426,7 +426,7 @@ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
-LDFLAGS :=
+KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
@@ -434,7 +434,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX 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 CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -997,7 +997,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link
cmd_link-vmlinux = \
- $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
+ $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d..5aecb8b 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
# Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
head-y := arch/arc/kernel/head.o
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e7d703d..360f80a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__ARMEB__
AS += -EB
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__ARMEL__
AS += -EL
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
#
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 7976d2d..ae064d1 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -60,13 +60,13 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__AARCH64EB__
AS += -EB
-LDFLAGS += -EB -maarch64elfb
+KBUILD_LDFLAGS += -EB -maarch64elfb
UTS_MACHINE := aarch64_be
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__AARCH64EL__
AS += -EL
-LDFLAGS += -EL -maarch64elf
+KBUILD_LDFLAGS += -EL -maarch64elf
UTS_MACHINE := aarch64
endif
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index 6ab942e..3fe8a94 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian
-KBUILD_LDFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -mbig-endian -EB
CHECKFLAGS += -D_BIG_ENDIAN
endif
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index e1c02ca..f9cbbb1 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -20,7 +20,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
KBUILD_CFLAGS += -D__linux__
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
KBUILD_AFLAGS += $(aflags-y)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := h8300-unknown-linux-
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile
index 2efaa18..4c5858b 100644
--- a/arch/hexagon/Makefile
+++ b/arch/hexagon/Makefile
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y)
-
-# no KBUILD_LDFLAGS?
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
# Thread-info register will be r19. This value is not configureable;
# it is hard-coded in several files.
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index f0dd9fc..997c9f2 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
KBUILD_AFLAGS += -D__uClinux__
endif
-LDFLAGS := -m m68kelf
+KBUILD_LDFLAGS := -m m68kelf
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifdef CONFIG_SUN3
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 7333036..4f3ab57 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CFLAGS += -mlittle-endian
KBUILD_AFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e2122cc..0d1b5e6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -303,7 +303,7 @@ endif
# instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS += -m $(ld-emul)
+KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_MIPS
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 abe77ad..3c453a1 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
vmlinuzobjs-y += $(obj)/piggy.o
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 $@
cmd_strip = $(STRIP) -s $@
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 9ab1326..78ce4cf 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
# Rule to make the bootloader
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
- $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
+ $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
$(obj)/%.o: $(obj)/%.gz
$(LD) -r -o $@ -b binary $<
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index 513bb2e..b1321c4 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -33,11 +33,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += $(call cc-option, -EL)
KBUILD_AFLAGS += $(call cc-option, -EL)
-LDFLAGS += $(call cc-option, -EL)
+KBUILD_LDFLAGS += $(call cc-option, -EL)
else
KBUILD_CFLAGS += $(call cc-option, -EB)
KBUILD_AFLAGS += $(call cc-option, -EB)
-LDFLAGS += $(call cc-option, -EB)
+KBUILD_LDFLAGS += $(call cc-option, -EB)
endif
boot := arch/nds32/boot
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2ea575c..3d157fc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -76,14 +76,14 @@ endif
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
KBUILD_CFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
LDEMULATION := lppc
GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
else
KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
LDEMULATION := ppc
GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(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)
endif
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 2627e48..71b5741 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -26,7 +26,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
KBUILD_CFLAGS += -mabi=lp64
KBUILD_AFLAGS += -mabi=lp64
KBUILD_MARCH = rv64im
- LDFLAGS += -melf64lriscv
+ KBUILD_LDFLAGS += -melf64lriscv
else
BITS := 32
UTS_MACHINE := riscv32
@@ -34,7 +34,7 @@ else
KBUILD_CFLAGS += -mabi=ilp32
KBUILD_AFLAGS += -mabi=ilp32
KBUILD_MARCH = rv32im
- LDFLAGS += -melf32lriscv
+ KBUILD_LDFLAGS += -melf32lriscv
endif
KBUILD_CFLAGS += -Wall
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 68a6904..60120b6 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -11,7 +11,7 @@
#
LD_BFD := elf64-s390
-LDFLAGS := -m elf64_s390
+KBUILD_LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 65300193..c521ade 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -122,11 +122,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
ld-bfd := elf32-$(UTS_MACHINE)-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
else
ld-bfd := elf32-$(UTS_MACHINE)big-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
endif
export ld-bfd BITS
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 966a13d..8ece494 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y)
#
CHECKFLAGS += -D__sparc__
-LDFLAGS := -m elf32_sparc
+KBUILD_LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
@@ -40,7 +40,7 @@ else
#
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
-LDFLAGS := -m elf64_sparc
+KBUILD_LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..6c4aed1 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -142,7 +142,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
# The wrappers will select whether using "malloc" or the kernel allocator.
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
# Used by link-vmlinux.sh which has special support for um link
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a08e828..9129a96 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -224,7 +224,7 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
#
# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
@@ -232,7 +232,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE)
# by the linker.
#
ifdef CONFIG_X86_64
-LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
+KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
endif
# Speed up the build
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 5296f8c..0d347ee 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/
ifeq ($(CONFIG_X86_32),y)
START := 0x8048000
-LDFLAGS += -m elf_i386
+KBUILD_LDFLAGS += -m elf_i386
ELF_ARCH := i386
ELF_FORMAT := elf32-i386
CHECKFLAGS += -D__i386__
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f89..e1dc356 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -42,16 +42,16 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
UBSAN_SANITIZE :=n
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
# Compressed kernel should be built as PIE since it may be loaded@any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
-LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
+KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
else
# To build 64-bit compressed kernel as PIE, we disable relocation
# overflow check to avoid relocation overflow error with a new linker
# command-line option, -z noreloc-overflow.
-LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
+KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
LDFLAGS_vmlinux := -T
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 3a934b7..295c120 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
ifneq ($(CONFIG_LD_NO_RELAX),)
-LDFLAGS := --no-relax
+KBUILD_LDFLAGS := --no-relax
endif
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 5214719..12ae1e9 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)
$(OBJS) $@
$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
- $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
+ $(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(obj)/boot.lds \
--build-id=none \
-o $@ $(obj)/Image.o
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c8156d6..feb918f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\
$(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
# ld-option
-# Usage: LDFLAGS += $(call ld-option, -X)
-ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
+# Usage: KBUILD_LDFLAGS += $(call ld-option, -X)
+ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e7889f4..42d61c1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -197,7 +197,7 @@ cmd_modversions_c = \
$(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
@@ -404,7 +404,7 @@ cmd_modversions_S = \
$(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f56bb4b..193c551 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
+ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index df41744..fa00c61 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Step 6), final link of the modules with optional arch pass after final link
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = \
- $(LD) -r $(LDFLAGS) \
+ $(LD) -r $(KBUILD_LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
-o $@ $(filter-out FORCE,$^) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 6/6] kbuild: rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 8:01 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-12 8:01 UTC (permalink / raw)
To: openrisc
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>
---
Makefile | 6 +++---
arch/arc/Makefile | 2 +-
arch/arm/Makefile | 4 ++--
arch/arm64/Makefile | 4 ++--
arch/c6x/Makefile | 3 +--
arch/h8300/Makefile | 2 +-
arch/hexagon/Makefile | 4 +---
arch/m68k/Makefile | 2 +-
arch/microblaze/Makefile | 4 ++--
arch/mips/Makefile | 2 +-
arch/mips/boot/compressed/Makefile | 2 +-
arch/mips/lasat/image/Makefile | 2 +-
arch/nds32/Makefile | 4 ++--
arch/powerpc/Makefile | 6 +++---
arch/riscv/Makefile | 4 ++--
arch/s390/Makefile | 2 +-
arch/sh/Makefile | 4 ++--
arch/sparc/Makefile | 4 ++--
arch/um/Makefile | 2 +-
arch/x86/Makefile | 4 ++--
arch/x86/Makefile.um | 2 +-
arch/x86/boot/compressed/Makefile | 6 +++---
arch/xtensa/Makefile | 2 +-
arch/xtensa/boot/boot-elf/Makefile | 2 +-
scripts/Kbuild.include | 4 ++--
scripts/Makefile.build | 4 ++--
scripts/Makefile.lib | 2 +-
scripts/Makefile.modpost | 2 +-
28 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/Makefile b/Makefile
index 925c55f..9eaa9b7 100644
--- a/Makefile
+++ b/Makefile
@@ -426,7 +426,7 @@ KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
-LDFLAGS :=
+KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
@@ -434,7 +434,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX 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 CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
@@ -997,7 +997,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link
cmd_link-vmlinux = \
- $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \
+ $(CONFIG_SHELL) $< $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d..5aecb8b 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -95,7 +95,7 @@ KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
# Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
head-y := arch/arc/kernel/head.o
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e7d703d..360f80a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -43,12 +43,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__ARMEB__
AS += -EB
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__ARMEL__
AS += -EL
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
#
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 7976d2d..ae064d1 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -60,13 +60,13 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS += -D__AARCH64EB__
AS += -EB
-LDFLAGS += -EB -maarch64elfb
+KBUILD_LDFLAGS += -EB -maarch64elfb
UTS_MACHINE := aarch64_be
else
KBUILD_CPPFLAGS += -mlittle-endian
CHECKFLAGS += -D__AARCH64EL__
AS += -EL
-LDFLAGS += -EL -maarch64elf
+KBUILD_LDFLAGS += -EL -maarch64elf
UTS_MACHINE := aarch64
endif
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index 6ab942e..3fe8a94 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -23,8 +23,7 @@ ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian
-KBUILD_LDFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -mbig-endian -EB
CHECKFLAGS += -D_BIG_ENDIAN
endif
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index e1c02ca..f9cbbb1 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -20,7 +20,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
KBUILD_CFLAGS += -D__linux__
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
KBUILD_AFLAGS += $(aflags-y)
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := h8300-unknown-linux-
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile
index 2efaa18..4c5858b 100644
--- a/arch/hexagon/Makefile
+++ b/arch/hexagon/Makefile
@@ -22,9 +22,7 @@ ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y)
-
-# no KBUILD_LDFLAGS?
-LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
# Thread-info register will be r19. This value is not configureable;
# it is hard-coded in several files.
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index f0dd9fc..997c9f2 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -69,7 +69,7 @@ KBUILD_CFLAGS += -D__uClinux__
KBUILD_AFLAGS += -D__uClinux__
endif
-LDFLAGS := -m m68kelf
+KBUILD_LDFLAGS := -m m68kelf
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifdef CONFIG_SUN3
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 7333036..4f3ab57 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -40,11 +40,11 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN
KBUILD_CFLAGS += -mbig-endian
KBUILD_AFLAGS += -mbig-endian
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
else
KBUILD_CFLAGS += -mlittle-endian
KBUILD_AFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e2122cc..0d1b5e6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -303,7 +303,7 @@ endif
# instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS += -m $(ld-emul)
+KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_MIPS
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 abe77ad..3c453a1 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -92,7 +92,7 @@ UIMAGE_LOADADDR = $(VMLINUZ_LOAD_ADDRESS)
vmlinuzobjs-y += $(obj)/piggy.o
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 $@
cmd_strip = $(STRIP) -s $@
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 9ab1326..78ce4cf 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -38,7 +38,7 @@ $(obj)/rom.bin: $(obj)/rom
# Rule to make the bootloader
$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
- $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
+ $(LD) $(KBUILD_LDFLAGS) $(LDSCRIPT) -o $@ $^
$(obj)/%.o: $(obj)/%.gz
$(LD) -r -o $@ -b binary $<
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index 513bb2e..b1321c4 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -33,11 +33,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += $(call cc-option, -EL)
KBUILD_AFLAGS += $(call cc-option, -EL)
-LDFLAGS += $(call cc-option, -EL)
+KBUILD_LDFLAGS += $(call cc-option, -EL)
else
KBUILD_CFLAGS += $(call cc-option, -EB)
KBUILD_AFLAGS += $(call cc-option, -EB)
-LDFLAGS += $(call cc-option, -EB)
+KBUILD_LDFLAGS += $(call cc-option, -EB)
endif
boot := arch/nds32/boot
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2ea575c..3d157fc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -76,14 +76,14 @@ endif
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
KBUILD_CFLAGS += -mlittle-endian
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
LDEMULATION := lppc
GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
else
KBUILD_CFLAGS += $(call cc-option,-mbig-endian)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
LDEMULATION := ppc
GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple
@@ -108,7 +108,7 @@ aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
ifeq ($(HAS_BIARCH),y)
KBUILD_CFLAGS += -m$(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)
endif
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 2627e48..71b5741 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -26,7 +26,7 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
KBUILD_CFLAGS += -mabi=lp64
KBUILD_AFLAGS += -mabi=lp64
KBUILD_MARCH = rv64im
- LDFLAGS += -melf64lriscv
+ KBUILD_LDFLAGS += -melf64lriscv
else
BITS := 32
UTS_MACHINE := riscv32
@@ -34,7 +34,7 @@ else
KBUILD_CFLAGS += -mabi=ilp32
KBUILD_AFLAGS += -mabi=ilp32
KBUILD_MARCH = rv32im
- LDFLAGS += -melf32lriscv
+ KBUILD_LDFLAGS += -melf32lriscv
endif
KBUILD_CFLAGS += -Wall
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 68a6904..60120b6 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -11,7 +11,7 @@
#
LD_BFD := elf64-s390
-LDFLAGS := -m elf64_s390
+KBUILD_LDFLAGS := -m elf64_s390
KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 65300193..c521ade 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -122,11 +122,11 @@ endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
ld-bfd := elf32-$(UTS_MACHINE)-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
-LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
else
ld-bfd := elf32-$(UTS_MACHINE)big-linux
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
-LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
endif
export ld-bfd BITS
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 966a13d..8ece494 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SPARC32),y)
#
CHECKFLAGS += -D__sparc__
-LDFLAGS := -m elf32_sparc
+KBUILD_LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
@@ -40,7 +40,7 @@ else
#
CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
-LDFLAGS := -m elf64_sparc
+KBUILD_LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..6c4aed1 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -142,7 +142,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
# The wrappers will select whether using "malloc" or the kernel allocator.
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS),-Wl,$(opt))
# Used by link-vmlinux.sh which has special support for um link
export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a08e828..9129a96 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -224,7 +224,7 @@ sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA2
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
#
# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
@@ -232,7 +232,7 @@ LDFLAGS := -m elf_$(UTS_MACHINE)
# by the linker.
#
ifdef CONFIG_X86_64
-LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
+KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
endif
# Speed up the build
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 5296f8c..0d347ee 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -4,7 +4,7 @@ core-y += arch/x86/crypto/
ifeq ($(CONFIG_X86_32),y)
START := 0x8048000
-LDFLAGS += -m elf_i386
+KBUILD_LDFLAGS += -m elf_i386
ELF_ARCH := i386
ELF_FORMAT := elf32-i386
CHECKFLAGS += -D__i386__
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f89..e1dc356 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -42,16 +42,16 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
UBSAN_SANITIZE :=n
-LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
# Compressed kernel should be built as PIE since it may be loaded@any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
-LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
+KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
else
# To build 64-bit compressed kernel as PIE, we disable relocation
# overflow check to avoid relocation overflow error with a new linker
# command-line option, -z noreloc-overflow.
-LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
+KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
LDFLAGS_vmlinux := -T
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 3a934b7..295c120 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
ifneq ($(CONFIG_LD_NO_RELAX),)
-LDFLAGS := --no-relax
+KBUILD_LDFLAGS := --no-relax
endif
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 5214719..12ae1e9 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)
$(OBJS) $@
$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
- $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
+ $(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(obj)/boot.lds \
--build-id=none \
-o $@ $(obj)/Image.o
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c8156d6..feb918f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\
$(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
# ld-option
-# Usage: LDFLAGS += $(call ld-option, -X)
-ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
+# Usage: KBUILD_LDFLAGS += $(call ld-option, -X)
+ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e7889f4..42d61c1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -197,7 +197,7 @@ cmd_modversions_c = \
$(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
@@ -404,7 +404,7 @@ cmd_modversions_S = \
$(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f56bb4b..193c551 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
+ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index df41744..fa00c61 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Step 6), final link of the modules with optional arch pass after final link
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = \
- $(LD) -r $(LDFLAGS) \
+ $(LD) -r $(KBUILD_LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
-o $@ $(filter-out FORCE,$^) ; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
--
2.7.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
2018-07-12 8:01 ` Masahiro Yamada
` (2 preceding siblings ...)
(?)
@ 2018-07-12 14:05 ` Kirill A. Shutemov
-1 siblings, 0 replies; 41+ messages in thread
From: Kirill A. Shutemov @ 2018-07-12 14:05 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Richard Weinberger, x86, linux-um, linux-kernel,
Russell King, openrisc, linux-arm-kernel, linux-riscv, Jeff Dike
On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>
> This series renames LDFLAGS to KBUILD_LDFLAGS
> after some Makefile cleanups.
>
> Currently, the last patch does not apply to Linus' tree
> due to missing pre-requisite patches.
>
> I will resolve conflicts as needed.
>
>
>
> Masahiro Yamada (6):
> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
> ARM: vfp: clean-up arch/arm/vfp/Makefile
> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
> kbuild: change ld_flags to contain LDFLAGS_$(@F)
> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Thanks! Looks sane to me
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 14:05 ` Kirill A. Shutemov
0 siblings, 0 replies; 41+ messages in thread
From: Kirill A. Shutemov @ 2018-07-12 14:05 UTC (permalink / raw)
To: linux-riscv
On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>
> This series renames LDFLAGS to KBUILD_LDFLAGS
> after some Makefile cleanups.
>
> Currently, the last patch does not apply to Linus' tree
> due to missing pre-requisite patches.
>
> I will resolve conflicts as needed.
>
>
>
> Masahiro Yamada (6):
> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
> ARM: vfp: clean-up arch/arm/vfp/Makefile
> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
> kbuild: change ld_flags to contain LDFLAGS_$(@F)
> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Thanks! Looks sane to me
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 14:05 ` Kirill A. Shutemov
0 siblings, 0 replies; 41+ messages in thread
From: Kirill A. Shutemov @ 2018-07-12 14:05 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>
> This series renames LDFLAGS to KBUILD_LDFLAGS
> after some Makefile cleanups.
>
> Currently, the last patch does not apply to Linus' tree
> due to missing pre-requisite patches.
>
> I will resolve conflicts as needed.
>
>
>
> Masahiro Yamada (6):
> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
> ARM: vfp: clean-up arch/arm/vfp/Makefile
> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
> kbuild: change ld_flags to contain LDFLAGS_$(@F)
> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Thanks! Looks sane to me
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 14:05 ` Kirill A. Shutemov
0 siblings, 0 replies; 41+ messages in thread
From: Kirill A. Shutemov @ 2018-07-12 14:05 UTC (permalink / raw)
To: openrisc
On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>
> This series renames LDFLAGS to KBUILD_LDFLAGS
> after some Makefile cleanups.
>
> Currently, the last patch does not apply to Linus' tree
> due to missing pre-requisite patches.
>
> I will resolve conflicts as needed.
>
>
>
> Masahiro Yamada (6):
> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
> ARM: vfp: clean-up arch/arm/vfp/Makefile
> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
> kbuild: change ld_flags to contain LDFLAGS_$(@F)
> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Thanks! Looks sane to me
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-12 14:05 ` Kirill A. Shutemov
0 siblings, 0 replies; 41+ messages in thread
From: Kirill A. Shutemov @ 2018-07-12 14:05 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Richard Weinberger, Jeff Dike, x86, linux-um,
linux-kernel, Russell King, openrisc, linux-riscv,
linux-arm-kernel
On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>
> This series renames LDFLAGS to KBUILD_LDFLAGS
> after some Makefile cleanups.
>
> Currently, the last patch does not apply to Linus' tree
> due to missing pre-requisite patches.
>
> I will resolve conflicts as needed.
>
>
>
> Masahiro Yamada (6):
> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
> ARM: vfp: clean-up arch/arm/vfp/Makefile
> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
> kbuild: change ld_flags to contain LDFLAGS_$(@F)
> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
Thanks! Looks sane to me
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
2018-07-12 14:05 ` Kirill A. Shutemov
` (2 preceding siblings ...)
(?)
@ 2018-07-18 23:41 ` Masahiro Yamada
-1 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-18 23:41 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Linux Kbuild mailing list, Richard Weinberger, X86 ML, linux-um,
Linux Kernel Mailing List, Russell King, openrisc,
linux-arm-kernel, linux-riscv, Jeff Dike
2018-07-12 23:05 GMT+09:00 Kirill A. Shutemov <kirill@shutemov.name>:
> On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>>
>> This series renames LDFLAGS to KBUILD_LDFLAGS
>> after some Makefile cleanups.
>>
>> Currently, the last patch does not apply to Linus' tree
>> due to missing pre-requisite patches.
>>
>> I will resolve conflicts as needed.
>>
>>
>>
>> Masahiro Yamada (6):
>> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
>> ARM: vfp: clean-up arch/arm/vfp/Makefile
>> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
>> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
>> kbuild: change ld_flags to contain LDFLAGS_$(@F)
>> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
>
> Thanks! Looks sane to me
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>
Patch 1, 3, 4, 5 applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-18 23:41 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-18 23:41 UTC (permalink / raw)
To: linux-riscv
2018-07-12 23:05 GMT+09:00 Kirill A. Shutemov <kirill@shutemov.name>:
> On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>>
>> This series renames LDFLAGS to KBUILD_LDFLAGS
>> after some Makefile cleanups.
>>
>> Currently, the last patch does not apply to Linus' tree
>> due to missing pre-requisite patches.
>>
>> I will resolve conflicts as needed.
>>
>>
>>
>> Masahiro Yamada (6):
>> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
>> ARM: vfp: clean-up arch/arm/vfp/Makefile
>> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
>> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
>> kbuild: change ld_flags to contain LDFLAGS_$(@F)
>> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
>
> Thanks! Looks sane to me
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>
Patch 1, 3, 4, 5 applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-18 23:41 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-18 23:41 UTC (permalink / raw)
To: linux-arm-kernel
2018-07-12 23:05 GMT+09:00 Kirill A. Shutemov <kirill@shutemov.name>:
> On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>>
>> This series renames LDFLAGS to KBUILD_LDFLAGS
>> after some Makefile cleanups.
>>
>> Currently, the last patch does not apply to Linus' tree
>> due to missing pre-requisite patches.
>>
>> I will resolve conflicts as needed.
>>
>>
>>
>> Masahiro Yamada (6):
>> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
>> ARM: vfp: clean-up arch/arm/vfp/Makefile
>> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
>> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
>> kbuild: change ld_flags to contain LDFLAGS_$(@F)
>> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
>
> Thanks! Looks sane to me
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>
Patch 1, 3, 4, 5 applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 41+ messages in thread
* [OpenRISC] [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-18 23:41 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-18 23:41 UTC (permalink / raw)
To: openrisc
2018-07-12 23:05 GMT+09:00 Kirill A. Shutemov <kirill@shutemov.name>:
> On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>>
>> This series renames LDFLAGS to KBUILD_LDFLAGS
>> after some Makefile cleanups.
>>
>> Currently, the last patch does not apply to Linus' tree
>> due to missing pre-requisite patches.
>>
>> I will resolve conflicts as needed.
>>
>>
>>
>> Masahiro Yamada (6):
>> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
>> ARM: vfp: clean-up arch/arm/vfp/Makefile
>> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
>> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
>> kbuild: change ld_flags to contain LDFLAGS_$(@F)
>> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
>
> Thanks! Looks sane to me
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>
Patch 1, 3, 4, 5 applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS
@ 2018-07-18 23:41 ` Masahiro Yamada
0 siblings, 0 replies; 41+ messages in thread
From: Masahiro Yamada @ 2018-07-18 23:41 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Linux Kbuild mailing list, Richard Weinberger, Jeff Dike, X86 ML,
linux-um, Linux Kernel Mailing List, Russell King, openrisc,
linux-riscv, linux-arm-kernel
2018-07-12 23:05 GMT+09:00 Kirill A. Shutemov <kirill@shutemov.name>:
> On Thu, Jul 12, 2018 at 05:01:30PM +0900, Masahiro Yamada wrote:
>>
>> This series renames LDFLAGS to KBUILD_LDFLAGS
>> after some Makefile cleanups.
>>
>> Currently, the last patch does not apply to Linus' tree
>> due to missing pre-requisite patches.
>>
>> I will resolve conflicts as needed.
>>
>>
>>
>> Masahiro Yamada (6):
>> um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um
>> ARM: vfp: clean-up arch/arm/vfp/Makefile
>> kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile
>> kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
>> kbuild: change ld_flags to contain LDFLAGS_$(@F)
>> kbuild: rename LDFLAGS to KBUILD_LDFLAGS
>
> Thanks! Looks sane to me
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>
Patch 1, 3, 4, 5 applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2018-07-18 23:42 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-12 8:01 [PATCH 0/6] kbuild: clean-up and rename LDFLAGS to KBUILD_LDFLAGS Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 1/6] um: remove redundant 'export LDFLAGS' in arch/x86/Makefile.um Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 2/6] ARM: vfp: clean-up arch/arm/vfp/Makefile Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 3/6] kbuild: remove redundant LDFLAGS clearing in arch/*/Makefile Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 4/6] kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags) Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 5/6] kbuild: change ld_flags to contain LDFLAGS_$(@F) Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` [PATCH 6/6] kbuild: rename LDFLAGS to KBUILD_LDFLAGS Masahiro Yamada
2018-07-12 8:01 ` [OpenRISC] " Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 8:01 ` Masahiro Yamada
2018-07-12 14:05 ` [PATCH 0/6] kbuild: clean-up and " Kirill A. Shutemov
2018-07-12 14:05 ` Kirill A. Shutemov
2018-07-12 14:05 ` [OpenRISC] " Kirill A. Shutemov
2018-07-12 14:05 ` Kirill A. Shutemov
2018-07-12 14:05 ` Kirill A. Shutemov
2018-07-18 23:41 ` Masahiro Yamada
2018-07-18 23:41 ` Masahiro Yamada
2018-07-18 23:41 ` [OpenRISC] " Masahiro Yamada
2018-07-18 23:41 ` Masahiro Yamada
2018-07-18 23:41 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.