[v2] sparc: allow sparc32 alias for archhelp

Message ID 20230410011316.26564-1-rdunlap@infradead.org
State New
Headers
Series [v2] sparc: allow sparc32 alias for archhelp |

Commit Message

Randy Dunlap April 10, 2023, 1:13 a.m. UTC
  Currently, entering
$ make ARCH=sparc32 help
prints the archhelp text for sparc64.

Since "sparc32" is documented (Documentation/kbuild/kbuild.rst)
to be a recognized alias for 32-bit sparc, also support that
string in sparc's archhelp by allowing either ARCH=sparc or
ARCH=sparc32 for sparc32 archhelp.

Fixes: 5e53879008b9 ("sparc,sparc64: unify Makefile")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
---
v2: rebase/resend; add Masahiro to Cc: list

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

Comments

Masahiro Yamada April 10, 2023, 11:33 p.m. UTC | #1
On Mon, Apr 10, 2023 at 10:13 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Currently, entering
> $ make ARCH=sparc32 help
> prints the archhelp text for sparc64.
>
> Since "sparc32" is documented (Documentation/kbuild/kbuild.rst)
> to be a recognized alias for 32-bit sparc, also support that
> string in sparc's archhelp by allowing either ARCH=sparc or
> ARCH=sparc32 for sparc32 archhelp.
>
> Fixes: 5e53879008b9 ("sparc,sparc64: unify Makefile")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> ---
> v2: rebase/resend; add Masahiro to Cc: list
>
>  arch/sparc/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -- a/arch/sparc/Makefile b/arch/sparc/Makefile
> --- a/arch/sparc/Makefile
> +++ b/arch/sparc/Makefile
> @@ -83,7 +83,7 @@ vdso_install:
>  KBUILD_IMAGE := $(boot)/zImage
>
>  # Don't use tabs in echo arguments.
> -ifeq ($(ARCH),sparc)
> +ifeq ($(ARCH),$(filter $(ARCH),sparc sparc32))


ifneq ($(ARCH),sparc64)

is simpler.





>  define archhelp
>    echo  '* image        - kernel image ($(boot)/image)'
>    echo  '* zImage       - stripped kernel image ($(boot)/zImage)'
  
Masahiro Yamada April 10, 2023, 11:45 p.m. UTC | #2
On Mon, Apr 10, 2023 at 10:13 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Currently, entering
> $ make ARCH=sparc32 help
> prints the archhelp text for sparc64.
>
> Since "sparc32" is documented (Documentation/kbuild/kbuild.rst)
> to be a recognized alias for 32-bit sparc, also support that
> string in sparc's archhelp by allowing either ARCH=sparc or
> ARCH=sparc32 for sparc32 archhelp.
>
> Fixes: 5e53879008b9 ("sparc,sparc64: unify Makefile")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> ---
> v2: rebase/resend; add Masahiro to Cc: list
>
>  arch/sparc/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -- a/arch/sparc/Makefile b/arch/sparc/Makefile
> --- a/arch/sparc/Makefile
> +++ b/arch/sparc/Makefile
> @@ -83,7 +83,7 @@ vdso_install:
>  KBUILD_IMAGE := $(boot)/zImage
>
>  # Don't use tabs in echo arguments.
> -ifeq ($(ARCH),sparc)
> +ifeq ($(ARCH),$(filter $(ARCH),sparc sparc32))
>  define archhelp
>    echo  '* image        - kernel image ($(boot)/image)'


BTW, this is strange.


The asterisk means it is built by 'all'.


But, I only see the following in this Makefile.


# Default target
all: zImage





Seeing arch/sparc/boot/Makefile,
it is true $(boot)/image is generated
as a side-effect of zImage, but it it true for
both 32-bit and 64-bit.

I think it is even better to rewrite archhelp
to unify the 32/64 bits.





>    echo  '* zImage       - stripped kernel image ($(boot)/zImage)'
  
Randy Dunlap April 11, 2023, 12:13 a.m. UTC | #3
On 4/10/23 16:45, Masahiro Yamada wrote:
> On Mon, Apr 10, 2023 at 10:13 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Currently, entering
>> $ make ARCH=sparc32 help
>> prints the archhelp text for sparc64.
>>
>> Since "sparc32" is documented (Documentation/kbuild/kbuild.rst)
>> to be a recognized alias for 32-bit sparc, also support that
>> string in sparc's archhelp by allowing either ARCH=sparc or
>> ARCH=sparc32 for sparc32 archhelp.
>>
>> Fixes: 5e53879008b9 ("sparc,sparc64: unify Makefile")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Sam Ravnborg <sam@ravnborg.org>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: sparclinux@vger.kernel.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>> ---
>> v2: rebase/resend; add Masahiro to Cc: list
>>
>>  arch/sparc/Makefile |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff -- a/arch/sparc/Makefile b/arch/sparc/Makefile
>> --- a/arch/sparc/Makefile
>> +++ b/arch/sparc/Makefile
>> @@ -83,7 +83,7 @@ vdso_install:
>>  KBUILD_IMAGE := $(boot)/zImage
>>
>>  # Don't use tabs in echo arguments.
>> -ifeq ($(ARCH),sparc)
>> +ifeq ($(ARCH),$(filter $(ARCH),sparc sparc32))
>>  define archhelp
>>    echo  '* image        - kernel image ($(boot)/image)'
> 
> 
> BTW, this is strange.
> 
> 
> The asterisk means it is built by 'all'.
> 
> 
> But, I only see the following in this Makefile.
> 
> 
> # Default target
> all: zImage
> 
> 
> 
> 
> 
> Seeing arch/sparc/boot/Makefile,
> it is true $(boot)/image is generated
> as a side-effect of zImage, but it it true for
> both 32-bit and 64-bit.
> 
> I think it is even better to rewrite archhelp
> to unify the 32/64 bits.
> 

Yeah, I had thought of that also. I'll do that and resend it.

Thanks.

> 
> 
> 
> 
>>    echo  '* zImage       - stripped kernel image ($(boot)/zImage)'
> 
> 
>
  

Patch

diff -- a/arch/sparc/Makefile b/arch/sparc/Makefile
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -83,7 +83,7 @@  vdso_install:
 KBUILD_IMAGE := $(boot)/zImage
 
 # Don't use tabs in echo arguments.
-ifeq ($(ARCH),sparc)
+ifeq ($(ARCH),$(filter $(ARCH),sparc sparc32))
 define archhelp
   echo  '* image        - kernel image ($(boot)/image)'
   echo  '* zImage       - stripped kernel image ($(boot)/zImage)'