Linux-parisc archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] parisc: suppress error messages for 'make clean'
@ 2020-04-25  5:46 Masahiro Yamada
  2020-05-01  5:35 ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-04-25  5:46 UTC (permalink / raw)
  To: James E . J . Bottomley, Helge Deller, linux-parisc
  Cc: linux-kernel, Masahiro Yamada

'make ARCH=parisc clean' emits a tons of error messages as follows:

  $ make ARCH=parisc clean
  gcc: error: unrecognized command line option '-mno-space-regs'
  gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
  gcc: error: unrecognized command line option '-mdisable-fpregs'
  gcc: error: missing argument to '-Wframe-larger-than='
  gcc: error: unrecognized command line option '-mno-space-regs'
  gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
  gcc: error: unrecognized command line option '-mdisable-fpregs'
  gcc: error: missing argument to '-Wframe-larger-than='
    ...

You can supporess them except '-Wframe-larger-than' by setting correct
CROSS_COMPILE=, but we should not require any compiler for cleaning.

This $(shell ...) is evaluated so many times because LIBGCC is exported.
Use the ':=' operator to evaluate it just once, and sink the stderr.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/parisc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 628cd8bb7ad8..d82787da43cd 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -21,7 +21,7 @@ KBUILD_IMAGE := vmlinuz
 
 NM		= sh $(srctree)/arch/parisc/nm
 CHECKFLAGS	+= -D__hppa__=1
-LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
+LIBGCC		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
 export LIBGCC
 
 ifdef CONFIG_64BIT
-- 
2.25.1


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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-04-25  5:46 [PATCH] parisc: suppress error messages for 'make clean' Masahiro Yamada
@ 2020-05-01  5:35 ` Masahiro Yamada
  2020-05-08 21:46   ` Helge Deller
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-05-01  5:35 UTC (permalink / raw)
  To: James E . J . Bottomley, Helge Deller, linux-parisc
  Cc: Linux Kernel Mailing List

On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 'make ARCH=parisc clean' emits a tons of error messages as follows:
>
>   $ make ARCH=parisc clean
>   gcc: error: unrecognized command line option '-mno-space-regs'
>   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
>   gcc: error: unrecognized command line option '-mdisable-fpregs'
>   gcc: error: missing argument to '-Wframe-larger-than='
>   gcc: error: unrecognized command line option '-mno-space-regs'
>   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
>   gcc: error: unrecognized command line option '-mdisable-fpregs'
>   gcc: error: missing argument to '-Wframe-larger-than='
>     ...
>
> You can supporess them except '-Wframe-larger-than' by setting correct
> CROSS_COMPILE=, but we should not require any compiler for cleaning.
>
> This $(shell ...) is evaluated so many times because LIBGCC is exported.
> Use the ':=' operator to evaluate it just once, and sink the stderr.
>



Applied to linux-kbuild.


> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  arch/parisc/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 628cd8bb7ad8..d82787da43cd 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -21,7 +21,7 @@ KBUILD_IMAGE := vmlinuz
>
>  NM             = sh $(srctree)/arch/parisc/nm
>  CHECKFLAGS     += -D__hppa__=1
> -LIBGCC         = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
> +LIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
>  export LIBGCC
>
>  ifdef CONFIG_64BIT
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-05-01  5:35 ` Masahiro Yamada
@ 2020-05-08 21:46   ` Helge Deller
  2020-05-09  8:16     ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Helge Deller @ 2020-05-08 21:46 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: James E . J . Bottomley, Helge Deller, linux-parisc,
	Linux Kernel Mailing List

* Masahiro Yamada <masahiroy@kernel.org>:
> On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > 'make ARCH=parisc clean' emits a tons of error messages as follows:
> >
> >   $ make ARCH=parisc clean
> >   gcc: error: unrecognized command line option '-mno-space-regs'
> >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> >   gcc: error: missing argument to '-Wframe-larger-than='
> >   gcc: error: unrecognized command line option '-mno-space-regs'
> >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> >   gcc: error: missing argument to '-Wframe-larger-than='
> >     ...
> >
> > You can supporess them except '-Wframe-larger-than' by setting correct
> > CROSS_COMPILE=, but we should not require any compiler for cleaning.
> >
> > This $(shell ...) is evaluated so many times because LIBGCC is exported.
> > Use the ':=' operator to evaluate it just once, and sink the stderr.
> >
>
> Applied to linux-kbuild.

That patch breaks then building the boot loader/compressor:
...
  hppa-linux-gnu-ld    -X -e startup --as-needed -T arch/parisc/boot/compressed/vmlinux.lds arch/parisc/boot/compressed/head.o arch/parisc/boot/compressed/real2.o arch/parisc/boot/compressed/firmware.o arch/parisc/boot/compressed/misc.o arch/parisc/boot/compressed/piggy.o -o arch/parisc/boot/compressed/vmlinux
hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `dec_vli':
(.text+0x104): undefined reference to `__ashldi3'
hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `lzma_len':
(.text+0x2b0): undefined reference to `$$mulI'
hppa-linux-gnu-ld: (.text+0x344): undefined reference to `$$mulI'
hppa-linux-gnu-ld: (.text+0x3f8): undefined reference to `$$mulI'


The patch below works, but I wonder if it's possible to avoid
to examine LIBGCC twice....?

Helge


diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 628cd8bb7ad8..aeea20abbf01 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -21,8 +21,7 @@ KBUILD_IMAGE := vmlinuz

 NM		= sh $(srctree)/arch/parisc/nm
 CHECKFLAGS	+= -D__hppa__=1
-LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
-export LIBGCC
+LIBGCC		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)

 ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile
index 1e5879c6a752..b008cf1b5c1e 100644
--- a/arch/parisc/boot/compressed/Makefile
+++ b/arch/parisc/boot/compressed/Makefile
@@ -22,6 +22,8 @@ ifndef CONFIG_64BIT
 KBUILD_CFLAGS += -mfast-indirect-calls
 endif

+LIBGCC  := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
+
 OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o

 LDFLAGS_vmlinux := -X -e startup --as-needed -T

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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-05-08 21:46   ` Helge Deller
@ 2020-05-09  8:16     ` Masahiro Yamada
  2020-05-09 17:39       ` Helge Deller
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-05-09  8:16 UTC (permalink / raw)
  To: Helge Deller
  Cc: James E . J . Bottomley, linux-parisc, Linux Kernel Mailing List

Hi Helge,

On Sat, May 9, 2020 at 6:46 AM Helge Deller <deller@gmx.de> wrote:
>
> * Masahiro Yamada <masahiroy@kernel.org>:
> > On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > 'make ARCH=parisc clean' emits a tons of error messages as follows:
> > >
> > >   $ make ARCH=parisc clean
> > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > >   gcc: error: missing argument to '-Wframe-larger-than='
> > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > >   gcc: error: missing argument to '-Wframe-larger-than='
> > >     ...
> > >
> > > You can supporess them except '-Wframe-larger-than' by setting correct
> > > CROSS_COMPILE=, but we should not require any compiler for cleaning.
> > >
> > > This $(shell ...) is evaluated so many times because LIBGCC is exported.
> > > Use the ':=' operator to evaluate it just once, and sink the stderr.
> > >
> >
> > Applied to linux-kbuild.
>
> That patch breaks then building the boot loader/compressor:
> ...
>   hppa-linux-gnu-ld    -X -e startup --as-needed -T arch/parisc/boot/compressed/vmlinux.lds arch/parisc/boot/compressed/head.o arch/parisc/boot/compressed/real2.o arch/parisc/boot/compressed/firmware.o arch/parisc/boot/compressed/misc.o arch/parisc/boot/compressed/piggy.o -o arch/parisc/boot/compressed/vmlinux
> hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `dec_vli':
> (.text+0x104): undefined reference to `__ashldi3'
> hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `lzma_len':
> (.text+0x2b0): undefined reference to `$$mulI'
> hppa-linux-gnu-ld: (.text+0x344): undefined reference to `$$mulI'
> hppa-linux-gnu-ld: (.text+0x3f8): undefined reference to `$$mulI'
>
>
> The patch below works, but I wonder if it's possible to avoid
> to examine LIBGCC twice....?
>
> Helge


Sorry for the breakage.

How about moving LIBGCC below ?




diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index d82787da43cd..6b37aa37a365 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -21,8 +21,6 @@ KBUILD_IMAGE := vmlinuz

 NM             = sh $(srctree)/arch/parisc/nm
 CHECKFLAGS     += -D__hppa__=1
-LIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS)
-print-libgcc-file-name 2>/dev/null)
-export LIBGCC

 ifdef CONFIG_64BIT
 UTS_MACHINE    := parisc64
@@ -114,6 +112,10 @@ KBUILD_CFLAGS      += $(cflags-y)
 kernel-y                       := mm/ kernel/ math-emu/

 core-y += $(addprefix arch/parisc/, $(kernel-y))
+
+LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
+export LIBGCC
+
 libs-y += arch/parisc/lib/ $(LIBGCC)

 drivers-$(CONFIG_OPROFILE)             += arch/parisc/oprofile/













>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 628cd8bb7ad8..aeea20abbf01 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -21,8 +21,7 @@ KBUILD_IMAGE := vmlinuz
>
>  NM             = sh $(srctree)/arch/parisc/nm
>  CHECKFLAGS     += -D__hppa__=1
> -LIBGCC         = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
> -export LIBGCC
> +LIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
>
>  ifdef CONFIG_64BIT
>  UTS_MACHINE    := parisc64
> diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile
> index 1e5879c6a752..b008cf1b5c1e 100644
> --- a/arch/parisc/boot/compressed/Makefile
> +++ b/arch/parisc/boot/compressed/Makefile
> @@ -22,6 +22,8 @@ ifndef CONFIG_64BIT
>  KBUILD_CFLAGS += -mfast-indirect-calls
>  endif
>
> +LIBGCC  := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
> +
>  OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
>
>  LDFLAGS_vmlinux := -X -e startup --as-needed -T



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-05-09  8:16     ` Masahiro Yamada
@ 2020-05-09 17:39       ` Helge Deller
  2020-05-10  1:19         ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Helge Deller @ 2020-05-09 17:39 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Helge Deller, James E . J . Bottomley, linux-parisc,
	Linux Kernel Mailing List

* Masahiro Yamada <masahiroy@kernel.org>:
> Hi Helge,
>
> On Sat, May 9, 2020 at 6:46 AM Helge Deller <deller@gmx.de> wrote:
> >
> > * Masahiro Yamada <masahiroy@kernel.org>:
> > > On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > >
> > > > 'make ARCH=parisc clean' emits a tons of error messages as follows:
> > > >
> > > >   $ make ARCH=parisc clean
> > > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > > >   gcc: error: missing argument to '-Wframe-larger-than='
> > > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > > >   gcc: error: missing argument to '-Wframe-larger-than='
> > > >     ...
> > > >
> > > > You can supporess them except '-Wframe-larger-than' by setting correct
> > > > CROSS_COMPILE=, but we should not require any compiler for cleaning.
> > > >
> > > > This $(shell ...) is evaluated so many times because LIBGCC is exported.
> > > > Use the ':=' operator to evaluate it just once, and sink the stderr.
> > > >
> > >
> > > Applied to linux-kbuild.
> >
> > That patch breaks then building the boot loader/compressor:
> > ...
> >   hppa-linux-gnu-ld    -X -e startup --as-needed -T arch/parisc/boot/compressed/vmlinux.lds arch/parisc/boot/compressed/head.o arch/parisc/boot/compressed/real2.o arch/parisc/boot/compressed/firmware.o arch/parisc/boot/compressed/misc.o arch/parisc/boot/compressed/piggy.o -o arch/parisc/boot/compressed/vmlinux
> > hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `dec_vli':
> > (.text+0x104): undefined reference to `__ashldi3'
> > hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `lzma_len':
> > (.text+0x2b0): undefined reference to `$$mulI'
> > hppa-linux-gnu-ld: (.text+0x344): undefined reference to `$$mulI'
> > hppa-linux-gnu-ld: (.text+0x3f8): undefined reference to `$$mulI'
> >
> >
> > The patch below works, but I wonder if it's possible to avoid
> > to examine LIBGCC twice....?
> >
> > Helge
>
>
> Sorry for the breakage.
>
> How about moving LIBGCC below ?

Good idea.
The patch below does work for me.
We do not need $KBUILD_CFLAGS to get the libgcc.a filename,
so we do not need to pipe the output to /dev/null either.
Can you try if that works, and if yes, can you apply it?

Helge


diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 628cd8bb7ad8..fadbbd010337 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -21,8 +21,6 @@ KBUILD_IMAGE := vmlinuz

 NM		= sh $(srctree)/arch/parisc/nm
 CHECKFLAGS	+= -D__hppa__=1
-LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
-export LIBGCC

 ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
@@ -110,6 +108,8 @@ cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
 head-y			:= arch/parisc/kernel/head.o

 KBUILD_CFLAGS	+= $(cflags-y)
+LIBGCC		:= $(shell $(CC) -print-libgcc-file-name)
+export LIBGCC

 kernel-y			:= mm/ kernel/ math-emu/


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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-05-09 17:39       ` Helge Deller
@ 2020-05-10  1:19         ` Masahiro Yamada
  2020-05-10 20:28           ` Helge Deller
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-05-10  1:19 UTC (permalink / raw)
  To: Helge Deller
  Cc: James E . J . Bottomley, linux-parisc, Linux Kernel Mailing List

Hi Helge,

On Sun, May 10, 2020 at 2:39 AM Helge Deller <deller@gmx.de> wrote:
>
> * Masahiro Yamada <masahiroy@kernel.org>:
> > Hi Helge,
> >
> > On Sat, May 9, 2020 at 6:46 AM Helge Deller <deller@gmx.de> wrote:
> > >
> > > * Masahiro Yamada <masahiroy@kernel.org>:
> > > > On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > > >
> > > > > 'make ARCH=parisc clean' emits a tons of error messages as follows:
> > > > >
> > > > >   $ make ARCH=parisc clean
> > > > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > > > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > > > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > > > >   gcc: error: missing argument to '-Wframe-larger-than='
> > > > >   gcc: error: unrecognized command line option '-mno-space-regs'
> > > > >   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
> > > > >   gcc: error: unrecognized command line option '-mdisable-fpregs'
> > > > >   gcc: error: missing argument to '-Wframe-larger-than='
> > > > >     ...
> > > > >
> > > > > You can supporess them except '-Wframe-larger-than' by setting correct
> > > > > CROSS_COMPILE=, but we should not require any compiler for cleaning.
> > > > >
> > > > > This $(shell ...) is evaluated so many times because LIBGCC is exported.
> > > > > Use the ':=' operator to evaluate it just once, and sink the stderr.
> > > > >
> > > >
> > > > Applied to linux-kbuild.
> > >
> > > That patch breaks then building the boot loader/compressor:
> > > ...
> > >   hppa-linux-gnu-ld    -X -e startup --as-needed -T arch/parisc/boot/compressed/vmlinux.lds arch/parisc/boot/compressed/head.o arch/parisc/boot/compressed/real2.o arch/parisc/boot/compressed/firmware.o arch/parisc/boot/compressed/misc.o arch/parisc/boot/compressed/piggy.o -o arch/parisc/boot/compressed/vmlinux
> > > hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `dec_vli':
> > > (.text+0x104): undefined reference to `__ashldi3'
> > > hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `lzma_len':
> > > (.text+0x2b0): undefined reference to `$$mulI'
> > > hppa-linux-gnu-ld: (.text+0x344): undefined reference to `$$mulI'
> > > hppa-linux-gnu-ld: (.text+0x3f8): undefined reference to `$$mulI'
> > >
> > >
> > > The patch below works, but I wonder if it's possible to avoid
> > > to examine LIBGCC twice....?
> > >
> > > Helge
> >
> >
> > Sorry for the breakage.
> >
> > How about moving LIBGCC below ?
>
> Good idea.
> The patch below does work for me.
> We do not need $KBUILD_CFLAGS to get the libgcc.a filename,


I not not sure about this change.


Generally speaking, the path to libgcc.a is affected
by compiler flags, especially, bit size flags,
endian flags, etc.


For example, my distro gcc is biarch for i386/x86_64.

$ gcc -print-libgcc-file-name
/usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a
$ gcc -m64 -print-libgcc-file-name
/usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a
$ gcc -m32 -print-libgcc-file-name
/usr/lib/gcc/x86_64-linux-gnu/9/32/libgcc.a




One real example in Linux is arch/arc/Makefile.
ARC supports both big endian and little endian.

If you drop cflags-y from line 59
of arch/arc/Makefile, vmlinux fails to link
due to endian mismatch.


I am not familiar with parisc.
Also, as it turned out,
this change is not so trivial.

I think the best approach is to leave this up to you
since you are the parisc maintainer.

I will drop this patch from my kbuild tree,
then you will apply what you think is best
to your tree.

What do you think?




> so we do not need to pipe the output to /dev/null either.
> Can you try if that works, and if yes, can you apply it?
>
> Helge
>
>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 628cd8bb7ad8..fadbbd010337 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -21,8 +21,6 @@ KBUILD_IMAGE := vmlinuz
>
>  NM             = sh $(srctree)/arch/parisc/nm
>  CHECKFLAGS     += -D__hppa__=1
> -LIBGCC         = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
> -export LIBGCC
>
>  ifdef CONFIG_64BIT
>  UTS_MACHINE    := parisc64
> @@ -110,6 +108,8 @@ cflags-$(CONFIG_PA8X00)             += -march=2.0 -mschedule=8000
>  head-y                 := arch/parisc/kernel/head.o
>
>  KBUILD_CFLAGS  += $(cflags-y)
> +LIBGCC         := $(shell $(CC) -print-libgcc-file-name)
> +export LIBGCC
>
>  kernel-y                       := mm/ kernel/ math-emu/
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] parisc: suppress error messages for 'make clean'
  2020-05-10  1:19         ` Masahiro Yamada
@ 2020-05-10 20:28           ` Helge Deller
  0 siblings, 0 replies; 7+ messages in thread
From: Helge Deller @ 2020-05-10 20:28 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: James E . J . Bottomley, linux-parisc, Linux Kernel Mailing List

On 10.05.20 03:19, Masahiro Yamada wrote:
> Hi Helge,
>
> On Sun, May 10, 2020 at 2:39 AM Helge Deller <deller@gmx.de> wrote:
>>
>> * Masahiro Yamada <masahiroy@kernel.org>:
>>> Hi Helge,
>>>
>>> On Sat, May 9, 2020 at 6:46 AM Helge Deller <deller@gmx.de> wrote:
>>>>
>>>> * Masahiro Yamada <masahiroy@kernel.org>:
>>>>> On Sat, Apr 25, 2020 at 2:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>>>>>
>>>>>> 'make ARCH=parisc clean' emits a tons of error messages as follows:
>>>>>>
>>>>>>   $ make ARCH=parisc clean
>>>>>>   gcc: error: unrecognized command line option '-mno-space-regs'
>>>>>>   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
>>>>>>   gcc: error: unrecognized command line option '-mdisable-fpregs'
>>>>>>   gcc: error: missing argument to '-Wframe-larger-than='
>>>>>>   gcc: error: unrecognized command line option '-mno-space-regs'
>>>>>>   gcc: error: unrecognized command line option '-mfast-indirect-calls'; did you mean '-mforce-indirect-call'?
>>>>>>   gcc: error: unrecognized command line option '-mdisable-fpregs'
>>>>>>   gcc: error: missing argument to '-Wframe-larger-than='
>>>>>>     ...
>>>>>>
>>>>>> You can supporess them except '-Wframe-larger-than' by setting correct
>>>>>> CROSS_COMPILE=, but we should not require any compiler for cleaning.
>>>>>>
>>>>>> This $(shell ...) is evaluated so many times because LIBGCC is exported.
>>>>>> Use the ':=' operator to evaluate it just once, and sink the stderr.
>>>>>>
>>>>>
>>>>> Applied to linux-kbuild.
>>>>
>>>> That patch breaks then building the boot loader/compressor:
>>>> ...
>>>>   hppa-linux-gnu-ld    -X -e startup --as-needed -T arch/parisc/boot/compressed/vmlinux.lds arch/parisc/boot/compressed/head.o arch/parisc/boot/compressed/real2.o arch/parisc/boot/compressed/firmware.o arch/parisc/boot/compressed/misc.o arch/parisc/boot/compressed/piggy.o -o arch/parisc/boot/compressed/vmlinux
>>>> hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `dec_vli':
>>>> (.text+0x104): undefined reference to `__ashldi3'
>>>> hppa-linux-gnu-ld: arch/parisc/boot/compressed/misc.o: in function `lzma_len':
>>>> (.text+0x2b0): undefined reference to `$$mulI'
>>>> hppa-linux-gnu-ld: (.text+0x344): undefined reference to `$$mulI'
>>>> hppa-linux-gnu-ld: (.text+0x3f8): undefined reference to `$$mulI'
>>>>
>>>>
>>>> The patch below works, but I wonder if it's possible to avoid
>>>> to examine LIBGCC twice....?
>>>>
>>>> Helge
>>>
>>>
>>> Sorry for the breakage.
>>>
>>> How about moving LIBGCC below ?
>>
>> Good idea.
>> The patch below does work for me.
>> We do not need $KBUILD_CFLAGS to get the libgcc.a filename,
>
>
> I not not sure about this change.
> Generally speaking, the path to libgcc.a is affected
> by compiler flags, especially, bit size flags,
> endian flags, etc.
>
> For example, my distro gcc is biarch for i386/x86_64.
>
> $ gcc -print-libgcc-file-name
> /usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a
> $ gcc -m64 -print-libgcc-file-name
> /usr/lib/gcc/x86_64-linux-gnu/9/libgcc.a
> $ gcc -m32 -print-libgcc-file-name
> /usr/lib/gcc/x86_64-linux-gnu/9/32/libgcc.a
>
> One real example in Linux is arch/arc/Makefile.
> ARC supports both big endian and little endian.
>
> If you drop cflags-y from line 59
> of arch/arc/Makefile, vmlinux fails to link
> due to endian mismatch.
>
>
> I am not familiar with parisc.
> Also, as it turned out,
> this change is not so trivial.
>
> I think the best approach is to leave this up to you
> since you are the parisc maintainer.

Yes, I knew about the possible biarch options.
On parisc that's not relevant yet.


> I will drop this patch from my kbuild tree,
> then you will apply what you think is best
> to your tree.
>
> What do you think?

Sure, I'll take it through the parisc tree.

Thanks!
Helge



>> so we do not need to pipe the output to /dev/null either.
>> Can you try if that works, and if yes, can you apply it?
>>
>> Helge
>>
>>
>> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
>> index 628cd8bb7ad8..fadbbd010337 100644
>> --- a/arch/parisc/Makefile
>> +++ b/arch/parisc/Makefile
>> @@ -21,8 +21,6 @@ KBUILD_IMAGE := vmlinuz
>>
>>  NM             = sh $(srctree)/arch/parisc/nm
>>  CHECKFLAGS     += -D__hppa__=1
>> -LIBGCC         = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
>> -export LIBGCC
>>
>>  ifdef CONFIG_64BIT
>>  UTS_MACHINE    := parisc64
>> @@ -110,6 +108,8 @@ cflags-$(CONFIG_PA8X00)             += -march=2.0 -mschedule=8000
>>  head-y                 := arch/parisc/kernel/head.o
>>
>>  KBUILD_CFLAGS  += $(cflags-y)
>> +LIBGCC         := $(shell $(CC) -print-libgcc-file-name)
>> +export LIBGCC
>>
>>  kernel-y                       := mm/ kernel/ math-emu/
>>
>
>


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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25  5:46 [PATCH] parisc: suppress error messages for 'make clean' Masahiro Yamada
2020-05-01  5:35 ` Masahiro Yamada
2020-05-08 21:46   ` Helge Deller
2020-05-09  8:16     ` Masahiro Yamada
2020-05-09 17:39       ` Helge Deller
2020-05-10  1:19         ` Masahiro Yamada
2020-05-10 20:28           ` Helge Deller

Linux-parisc archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-parisc/0 linux-parisc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-parisc linux-parisc/ https://lore.kernel.org/linux-parisc \
		linux-parisc@vger.kernel.org
	public-inbox-index linux-parisc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-parisc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git