linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] kbuild: add AFLAGS_REMOVE
@ 2015-11-21 10:59 Heiko Carstens
  2015-11-21 10:59 ` [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option Heiko Carstens
  2015-11-21 10:59 ` [PATCH 2/2] s390: compile head.s always with -march=z900 Heiko Carstens
  0 siblings, 2 replies; 6+ messages in thread
From: Heiko Carstens @ 2015-11-21 10:59 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kbuild, linux-kernel, Martin Schwidefsky, Heiko Carstens

Hi Michal,

these are just two simple patches which add
1) an AFLAGS_REMOVE option which works just like CFLAGS_REMOVE and
2) one user of it in s390 code.

If you agree this is ok, then these two patches could go upstream either
via your tree or the s390 tree.

Thanks,
Heiko

Heiko Carstens (2):
  kbuild: add AFLAGS_REMOVE_(basename).o option
  s390: compile head.s always with -march=z900

 arch/s390/kernel/Makefile | 6 ++++--
 scripts/Makefile.lib      | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.3.9


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

* [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option
  2015-11-21 10:59 [PATCH 0/2] kbuild: add AFLAGS_REMOVE Heiko Carstens
@ 2015-11-21 10:59 ` Heiko Carstens
  2015-11-30  8:17   ` Heiko Carstens
  2015-11-21 10:59 ` [PATCH 2/2] s390: compile head.s always with -march=z900 Heiko Carstens
  1 sibling, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2015-11-21 10:59 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kbuild, linux-kernel, Martin Schwidefsky, Heiko Carstens

It is already possible to remove CFLAGS with the CFLAGS_REMOVE option
that was introduced with commit 656ee82cc855 ("kbuild: create new
CFLAGS_REMOVE_(basename).o option").  However it is not possible to
remove AFLAGS for assembler files.

So this patch just adds the AFLAGS_REMOVE option which works the same
like CFLAGS_REMOVE.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 scripts/Makefile.lib | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 79e86613712f..26a48d76eb9d 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -104,8 +104,9 @@ modname_flags  = $(if $(filter 1,$(words $(modname))),\
 orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
                  $(ccflags-y) $(CFLAGS_$(basetarget).o)
 _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
-_a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
+orig_a_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
                  $(asflags-y) $(AFLAGS_$(basetarget).o)
+_a_flags       = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))
 _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
 
 #
-- 
2.3.9


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

* [PATCH 2/2] s390: compile head.s always with -march=z900
  2015-11-21 10:59 [PATCH 0/2] kbuild: add AFLAGS_REMOVE Heiko Carstens
  2015-11-21 10:59 ` [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option Heiko Carstens
@ 2015-11-21 10:59 ` Heiko Carstens
  1 sibling, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2015-11-21 10:59 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kbuild, linux-kernel, Martin Schwidefsky, Heiko Carstens

head.s on s390 contains some sanity checks if the kernel will run on a
machine or if the machine is too old, e.g. if the kernel contains
instructions not available on the machine. If so, it will emit an error
message to the console before it stops execution.

Therefore head.s contains only instructions which are availanble with the
earliest machine generation (z900).  In order to make sure we don't
accidently add instructions which are not available on z900, always compile
with -march=z900. This makes sure compilation will fail if wrong
instructions are used.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 arch/s390/kernel/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index dc167a23b920..a53755e37e3d 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -34,8 +34,10 @@ CFLAGS_sysinfo.o += -w
 #
 CFLAGS_REMOVE_sclp.o = $(CC_FLAGS_FTRACE)
 ifneq ($(CC_FLAGS_MARCH),-march=z900)
-CFLAGS_REMOVE_sclp.o += $(CC_FLAGS_MARCH)
-CFLAGS_sclp.o	+= -march=z900
+CFLAGS_REMOVE_sclp.o 	+= $(CC_FLAGS_MARCH)
+CFLAGS_sclp.o		+= -march=z900
+AFLAGS_REMOVE_head.o	+= $(CC_FLAGS_MARCH)
+AFLAGS_head.o		+= -march=z900
 endif
 GCOV_PROFILE_sclp.o := n
 
-- 
2.3.9


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

* Re: [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option
  2015-11-21 10:59 ` [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option Heiko Carstens
@ 2015-11-30  8:17   ` Heiko Carstens
  2015-11-30  8:36     ` Michal Marek
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2015-11-30  8:17 UTC (permalink / raw)
  To: Michal Marek, linux-kbuild, linux-kernel, Martin Schwidefsky

On Sat, Nov 21, 2015 at 11:59:58AM +0100, Heiko Carstens wrote:
> It is already possible to remove CFLAGS with the CFLAGS_REMOVE option
> that was introduced with commit 656ee82cc855 ("kbuild: create new
> CFLAGS_REMOVE_(basename).o option").  However it is not possible to
> remove AFLAGS for assembler files.
> 
> So this patch just adds the AFLAGS_REMOVE option which works the same
> like CFLAGS_REMOVE.
> 
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
>  scripts/Makefile.lib | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 79e86613712f..26a48d76eb9d 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -104,8 +104,9 @@ modname_flags  = $(if $(filter 1,$(words $(modname))),\
>  orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
>                   $(ccflags-y) $(CFLAGS_$(basetarget).o)
>  _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
> -_a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
> +orig_a_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
>                   $(asflags-y) $(AFLAGS_$(basetarget).o)
> +_a_flags       = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))
>  _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
>  
>  #

Hello Michal,

since I didn't hear anything from you, I'll simply add this to the s390 tree.
The patch should be trivial enough and is certainly not controversial.

Thanks,
Heiko


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

* Re: [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option
  2015-11-30  8:17   ` Heiko Carstens
@ 2015-11-30  8:36     ` Michal Marek
  2015-11-30  8:52       ` Heiko Carstens
  0 siblings, 1 reply; 6+ messages in thread
From: Michal Marek @ 2015-11-30  8:36 UTC (permalink / raw)
  To: Heiko Carstens, linux-kbuild, linux-kernel, Martin Schwidefsky

On 2015-11-30 09:17, Heiko Carstens wrote:
> On Sat, Nov 21, 2015 at 11:59:58AM +0100, Heiko Carstens wrote:
>> It is already possible to remove CFLAGS with the CFLAGS_REMOVE option
>> that was introduced with commit 656ee82cc855 ("kbuild: create new
>> CFLAGS_REMOVE_(basename).o option").  However it is not possible to
>> remove AFLAGS for assembler files.
>>
>> So this patch just adds the AFLAGS_REMOVE option which works the same
>> like CFLAGS_REMOVE.
>>
>> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>> ---
>>  scripts/Makefile.lib | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 79e86613712f..26a48d76eb9d 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -104,8 +104,9 @@ modname_flags  = $(if $(filter 1,$(words $(modname))),\
>>  orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
>>                   $(ccflags-y) $(CFLAGS_$(basetarget).o)
>>  _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
>> -_a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
>> +orig_a_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
>>                   $(asflags-y) $(AFLAGS_$(basetarget).o)
>> +_a_flags       = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))
>>  _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
>>  
>>  #
> 
> Hello Michal,
> 
> since I didn't hear anything from you, I'll simply add this to the s390 tree.
> The patch should be trivial enough and is certainly not controversial.

Hi Heiko,

yes, please go ahead, the patch is fine.

Michal


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

* Re: [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option
  2015-11-30  8:36     ` Michal Marek
@ 2015-11-30  8:52       ` Heiko Carstens
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2015-11-30  8:52 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, Martin Schwidefsky

On Mon, Nov 30, 2015 at 09:36:29AM +0100, Michal Marek wrote:
> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> >> index 79e86613712f..26a48d76eb9d 100644
> >> --- a/scripts/Makefile.lib
> >> +++ b/scripts/Makefile.lib
> >> @@ -104,8 +104,9 @@ modname_flags  = $(if $(filter 1,$(words $(modname))),\
> >>  orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
> >>                   $(ccflags-y) $(CFLAGS_$(basetarget).o)
> >>  _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
> >> -_a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
> >> +orig_a_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
> >>                   $(asflags-y) $(AFLAGS_$(basetarget).o)
> >> +_a_flags       = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))
> >>  _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
> >>  
> >>  #
> > 
> > Hello Michal,
> > 
> > since I didn't hear anything from you, I'll simply add this to the s390 tree.
> > The patch should be trivial enough and is certainly not controversial.
> 
> Hi Heiko,
> 
> yes, please go ahead, the patch is fine.

Ok, thanks. I'll add your ack then.


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

end of thread, other threads:[~2015-11-30  8:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-21 10:59 [PATCH 0/2] kbuild: add AFLAGS_REMOVE Heiko Carstens
2015-11-21 10:59 ` [PATCH 1/2] kbuild: add AFLAGS_REMOVE_(basename).o option Heiko Carstens
2015-11-30  8:17   ` Heiko Carstens
2015-11-30  8:36     ` Michal Marek
2015-11-30  8:52       ` Heiko Carstens
2015-11-21 10:59 ` [PATCH 2/2] s390: compile head.s always with -march=z900 Heiko Carstens

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).