mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/build: drop a superfluous macro
@ 2018-03-16  8:49 Cao jin
  2018-03-29  1:43 ` Cao jin
  2018-03-31  8:00 ` [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times tip-bot for Cao jin
  0 siblings, 2 replies; 5+ messages in thread
From: Cao jin @ 2018-03-16  8:49 UTC (permalink / raw)
  To: x86, linux-kernel; +Cc: tglx, mingo, hpa

Some .<target>.cmd files under arch/x86 report -D__KERNEL__ appears two
times in the command line, like arch/x86/boot, arch/x86/realmode/rm.
It is already defined in KBUILD_CPPFLAGS from top Makefile. so it can be
dropped saftely from these Makefiles.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 arch/x86/Makefile                 | 3 +--
 arch/x86/boot/compressed/Makefile | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a20eacd9c7e9..592489a15d94 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -31,8 +31,7 @@ endif
 CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
 M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
 
-REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -D__KERNEL__ \
-		   -DDISABLE_BRANCH_PROFILING \
+REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
 		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
 		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
 		   -mno-mmx -mno-sse
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 4b7575b00563..78e3400c22d7 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -26,7 +26,7 @@ KCOV_INSTRUMENT		:= n
 targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
 	vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
 
-KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
+KBUILD_CFLAGS := -m$(BITS) -O2
 KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
 cflags-$(CONFIG_X86_32) := -march=i386
-- 
2.14.3

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

* Re: [PATCH] x86/build: drop a superfluous macro
  2018-03-16  8:49 [PATCH] x86/build: drop a superfluous macro Cao jin
@ 2018-03-29  1:43 ` Cao jin
  2018-03-31  8:00 ` [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times tip-bot for Cao jin
  1 sibling, 0 replies; 5+ messages in thread
From: Cao jin @ 2018-03-29  1:43 UTC (permalink / raw)
  To: x86, linux-kernel; +Cc: tglx, mingo, hpa

ping?

On 03/16/2018 04:49 PM, Cao jin wrote:
> Some .<target>.cmd files under arch/x86 report -D__KERNEL__ appears two
> times in the command line, like arch/x86/boot, arch/x86/realmode/rm.
> It is already defined in KBUILD_CPPFLAGS from top Makefile. so it can be
> dropped saftely from these Makefiles.
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>  arch/x86/Makefile                 | 3 +--
>  arch/x86/boot/compressed/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index a20eacd9c7e9..592489a15d94 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -31,8 +31,7 @@ endif
>  CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
>  M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
>  
> -REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -D__KERNEL__ \
> -		   -DDISABLE_BRANCH_PROFILING \
> +REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
>  		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
>  		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
>  		   -mno-mmx -mno-sse
> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> index 4b7575b00563..78e3400c22d7 100644
> --- a/arch/x86/boot/compressed/Makefile
> +++ b/arch/x86/boot/compressed/Makefile
> @@ -26,7 +26,7 @@ KCOV_INSTRUMENT		:= n
>  targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
>  	vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
>  
> -KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
> +KBUILD_CFLAGS := -m$(BITS) -O2
>  KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
>  KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
>  cflags-$(CONFIG_X86_32) := -march=i386
> 

-- 
Sincerely,
Cao jin

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

* [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times
  2018-03-16  8:49 [PATCH] x86/build: drop a superfluous macro Cao jin
  2018-03-29  1:43 ` Cao jin
@ 2018-03-31  8:00 ` tip-bot for Cao jin
  2018-03-31  8:38   ` Ingo Molnar
  1 sibling, 1 reply; 5+ messages in thread
From: tip-bot for Cao jin @ 2018-03-31  8:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, yamada.masahiro, linux-kernel, michal.lkml, mingo, peterz,
	caoj.fnst, torvalds, hpa

Commit-ID:  d6289f36aa7d5893d091a7a0c67eee7798719f03
Gitweb:     https://git.kernel.org/tip/d6289f36aa7d5893d091a7a0c67eee7798719f03
Author:     Cao jin <caoj.fnst@cn.fujitsu.com>
AuthorDate: Fri, 16 Mar 2018 16:49:44 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 31 Mar 2018 08:02:07 +0200

x86/build: Don't pass in -D__KERNEL__ multiple times

Some .<target>.cmd files under arch/x86 are showing two instances of
-D__KERNEL__, like arch/x86/boot/ and arch/x86/realmode/rm/.

__KERNEL__ is already defined in KBUILD_CPPFLAGS in the top Makefile,
so it can be dropped safely.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kbuild@vger.kernel.org
Link: http://lkml.kernel.org/r/20180316084944.3997-1-caoj.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Makefile                 | 3 +--
 arch/x86/boot/compressed/Makefile | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index d798e36d103c..a517852dad55 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -31,8 +31,7 @@ endif
 CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
 M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
 
-REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -D__KERNEL__ \
-		   -DDISABLE_BRANCH_PROFILING \
+REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
 		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
 		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
 		   -mno-mmx -mno-sse
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index f25e1530e064..f484ae0ece93 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -26,7 +26,7 @@ KCOV_INSTRUMENT		:= n
 targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
 	vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
 
-KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
+KBUILD_CFLAGS := -m$(BITS) -O2
 KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
 cflags-$(CONFIG_X86_32) := -march=i386

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

* Re: [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times
  2018-03-31  8:00 ` [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times tip-bot for Cao jin
@ 2018-03-31  8:38   ` Ingo Molnar
  2018-03-31  8:44     ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2018-03-31  8:38 UTC (permalink / raw)
  To: yamada.masahiro, tglx, michal.lkml, linux-kernel, hpa, torvalds,
	peterz, caoj.fnst
  Cc: linux-tip-commits


* tip-bot for Cao jin <tipbot@zytor.com> wrote:

> Commit-ID:  d6289f36aa7d5893d091a7a0c67eee7798719f03
> Gitweb:     https://git.kernel.org/tip/d6289f36aa7d5893d091a7a0c67eee7798719f03
> Author:     Cao jin <caoj.fnst@cn.fujitsu.com>
> AuthorDate: Fri, 16 Mar 2018 16:49:44 +0800
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Sat, 31 Mar 2018 08:02:07 +0200
> 
> x86/build: Don't pass in -D__KERNEL__ multiple times
> 
> Some .<target>.cmd files under arch/x86 are showing two instances of
> -D__KERNEL__, like arch/x86/boot/ and arch/x86/realmode/rm/.
> 
> __KERNEL__ is already defined in KBUILD_CPPFLAGS in the top Makefile,
> so it can be dropped safely.
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: linux-kbuild@vger.kernel.org
> Link: http://lkml.kernel.org/r/20180316084944.3997-1-caoj.fnst@cn.fujitsu.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> ---
>  arch/x86/Makefile                 | 3 +--
>  arch/x86/boot/compressed/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index d798e36d103c..a517852dad55 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -31,8 +31,7 @@ endif
>  CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
>  M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
>  
> -REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -D__KERNEL__ \
> -		   -DDISABLE_BRANCH_PROFILING \
> +REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
>  		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
>  		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
>  		   -mno-mmx -mno-sse
> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> index f25e1530e064..f484ae0ece93 100644
> --- a/arch/x86/boot/compressed/Makefile
> +++ b/arch/x86/boot/compressed/Makefile
> @@ -26,7 +26,7 @@ KCOV_INSTRUMENT		:= n
>  targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
>  	vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
>  
> -KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
> +KBUILD_CFLAGS := -m$(BITS) -O2
>  KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
>  KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
>  cflags-$(CONFIG_X86_32) := -march=i386

Dropped this patch, it's totally untested, the build fails on x86-64 defconfig 
already.

Thanks,

	Ingo

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

* Re: [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times
  2018-03-31  8:38   ` Ingo Molnar
@ 2018-03-31  8:44     ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2018-03-31  8:44 UTC (permalink / raw)
  To: yamada.masahiro, tglx, michal.lkml, linux-kernel, hpa, torvalds,
	peterz, caoj.fnst
  Cc: linux-tip-commits


* Ingo Molnar <mingo@kernel.org> wrote:

> 
> * tip-bot for Cao jin <tipbot@zytor.com> wrote:
> 
> > Commit-ID:  d6289f36aa7d5893d091a7a0c67eee7798719f03
> > Gitweb:     https://git.kernel.org/tip/d6289f36aa7d5893d091a7a0c67eee7798719f03
> > Author:     Cao jin <caoj.fnst@cn.fujitsu.com>
> > AuthorDate: Fri, 16 Mar 2018 16:49:44 +0800
> > Committer:  Ingo Molnar <mingo@kernel.org>
> > CommitDate: Sat, 31 Mar 2018 08:02:07 +0200
> > 
> > x86/build: Don't pass in -D__KERNEL__ multiple times
> > 
> > Some .<target>.cmd files under arch/x86 are showing two instances of
> > -D__KERNEL__, like arch/x86/boot/ and arch/x86/realmode/rm/.
> > 
> > __KERNEL__ is already defined in KBUILD_CPPFLAGS in the top Makefile,
> > so it can be dropped safely.
> > 
> > Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> > Cc: H. Peter Anvin <hpa@zytor.com>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Cc: Michal Marek <michal.lkml@markovi.net>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: linux-kbuild@vger.kernel.org
> > Link: http://lkml.kernel.org/r/20180316084944.3997-1-caoj.fnst@cn.fujitsu.com
> > Signed-off-by: Ingo Molnar <mingo@kernel.org>
> > ---
> >  arch/x86/Makefile                 | 3 +--
> >  arch/x86/boot/compressed/Makefile | 2 +-
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> > index d798e36d103c..a517852dad55 100644
> > --- a/arch/x86/Makefile
> > +++ b/arch/x86/Makefile
> > @@ -31,8 +31,7 @@ endif
> >  CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
> >  M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
> >  
> > -REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -D__KERNEL__ \
> > -		   -DDISABLE_BRANCH_PROFILING \
> > +REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
> >  		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
> >  		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
> >  		   -mno-mmx -mno-sse
> > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> > index f25e1530e064..f484ae0ece93 100644
> > --- a/arch/x86/boot/compressed/Makefile
> > +++ b/arch/x86/boot/compressed/Makefile
> > @@ -26,7 +26,7 @@ KCOV_INSTRUMENT		:= n
> >  targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
> >  	vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
> >  
> > -KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
> > +KBUILD_CFLAGS := -m$(BITS) -O2
> >  KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
> >  KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
> >  cflags-$(CONFIG_X86_32) := -march=i386
> 
> Dropped this patch, it's totally untested, the build fails on x86-64 defconfig 
> already.

Apologies, I messed up my testing: the patch is fine after all!

Thanks,

	Ingo

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

end of thread, other threads:[~2018-03-31  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16  8:49 [PATCH] x86/build: drop a superfluous macro Cao jin
2018-03-29  1:43 ` Cao jin
2018-03-31  8:00 ` [tip:x86/build] x86/build: Don't pass in -D__KERNEL__ multiple times tip-bot for Cao jin
2018-03-31  8:38   ` Ingo Molnar
2018-03-31  8:44     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®