linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of CFLAGS_MODULE, LDFLAGS_MODULE
@ 2017-10-09 14:35 Masahiro Yamada
  2017-10-09 14:35 ` [PATCH 1/3] ARM: add KBUILD_ prefix to " Masahiro Yamada
  2017-10-15  7:47 ` [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of " Masahiro Yamada
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-10-09 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

CFLAGS_MODULE, AFLAGS_MODULE, and LDFLAGS_MODULE are supposed
to be set by users.

In-kernel Makefile must use KBUILD_ prefixed variables.

This is explained in Documentation/kbuild/{kbuild.txt, makefiles.txt}

Most of architectures follow the rule, but I found violations
in ARM, hexagone, and c6x.

Fix them.



Masahiro Yamada (3):
  ARM: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
  hexagon: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
  c6x: add KBUILD_ prefix to CFLAGS_MODULE

 arch/arm/Makefile     | 6 +++---
 arch/c6x/Makefile     | 2 +-
 arch/hexagon/Makefile | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] ARM: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
  2017-10-09 14:35 [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of CFLAGS_MODULE, LDFLAGS_MODULE Masahiro Yamada
@ 2017-10-09 14:35 ` Masahiro Yamada
  2017-10-09 15:06   ` Russell King - ARM Linux
  2017-10-15  7:47 ` [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of " Masahiro Yamada
  1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2017-10-09 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

{CFLAGS,LDFLAGS}_MODULE are supposed to be set by users, not by
in-kernel makefiles.

Documentation/kbuild/makefiles.txt clearly explains the difference:

  KBUILD_CFLAGS_MODULE   Options for $(CC) when building modules

      $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
      are used for $(CC).
      From commandline CFLAGS_MODULE shall be used (see kbuild.txt).

  KBUILD_LDFLAGS_MODULE   Options for $(LD) when linking modules

      $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
      used when linking modules. This is often a linker script.
      From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index cdb5b55..cafa4d4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -16,11 +16,11 @@ LDFLAGS		:=
 LDFLAGS_vmlinux	:=-p --no-undefined -X --pic-veneer
 ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
 LDFLAGS_vmlinux	+= --be8
-LDFLAGS_MODULE	+= --be8
+KBUILD_LDFLAGS_MODULE	+= --be8
 endif
 
 ifeq ($(CONFIG_ARM_MODULE_PLTS),y)
-LDFLAGS_MODULE	+= -T $(srctree)/arch/arm/kernel/module.lds
+KBUILD_LDFLAGS_MODULE	+= -T $(srctree)/arch/arm/kernel/module.lds
 endif
 
 GZFLAGS		:=-9
@@ -120,7 +120,7 @@ CFLAGS_ISA	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
 AFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
 # Work around buggy relocation from gas if requested:
 ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
-CFLAGS_MODULE	+=-fno-optimize-sibling-calls
+KBUILD_CFLAGS_MODULE	+=-fno-optimize-sibling-calls
 endif
 else
 CFLAGS_ISA	:=$(call cc-option,-marm,)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 1/3] ARM: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
  2017-10-09 14:35 ` [PATCH 1/3] ARM: add KBUILD_ prefix to " Masahiro Yamada
@ 2017-10-09 15:06   ` Russell King - ARM Linux
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2017-10-09 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 09, 2017 at 11:35:13PM +0900, Masahiro Yamada wrote:
> {CFLAGS,LDFLAGS}_MODULE are supposed to be set by users, not by
> in-kernel makefiles.
> 
> Documentation/kbuild/makefiles.txt clearly explains the difference:
> 
>   KBUILD_CFLAGS_MODULE   Options for $(CC) when building modules
> 
>       $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
>       are used for $(CC).
>       From commandline CFLAGS_MODULE shall be used (see kbuild.txt).
> 
>   KBUILD_LDFLAGS_MODULE   Options for $(LD) when linking modules
> 
>       $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
>       used when linking modules. This is often a linker script.
>       From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of CFLAGS_MODULE, LDFLAGS_MODULE
  2017-10-09 14:35 [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of CFLAGS_MODULE, LDFLAGS_MODULE Masahiro Yamada
  2017-10-09 14:35 ` [PATCH 1/3] ARM: add KBUILD_ prefix to " Masahiro Yamada
@ 2017-10-15  7:47 ` Masahiro Yamada
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-10-15  7:47 UTC (permalink / raw)
  To: linux-arm-kernel

2017-10-09 23:35 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> CFLAGS_MODULE, AFLAGS_MODULE, and LDFLAGS_MODULE are supposed
> to be set by users.
>
> In-kernel Makefile must use KBUILD_ prefixed variables.
>
> This is explained in Documentation/kbuild/{kbuild.txt, makefiles.txt}
>
> Most of architectures follow the rule, but I found violations
> in ARM, hexagone, and c6x.
>
> Fix them.
>
>
>
> Masahiro Yamada (3):
>   ARM: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
>   hexagon: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE
>   c6x: add KBUILD_ prefix to CFLAGS_MODULE
>
>  arch/arm/Makefile     | 6 +++---
>  arch/c6x/Makefile     | 2 +-
>  arch/hexagon/Makefile | 6 +++---
>  3 files changed, 7 insertions(+), 7 deletions(-)
>

Series, applied to linux-kbuild/kbuild.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-15  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09 14:35 [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of CFLAGS_MODULE, LDFLAGS_MODULE Masahiro Yamada
2017-10-09 14:35 ` [PATCH 1/3] ARM: add KBUILD_ prefix to " Masahiro Yamada
2017-10-09 15:06   ` Russell King - ARM Linux
2017-10-15  7:47 ` [PATCH 0/3] ARM, hexagon, c6x: build: fix usage of " Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).