* [PATCH 1/2] powerpc/32: Add ppc_defconfig
@ 2019-02-07 5:16 Michael Ellerman
2019-02-07 5:16 ` [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling Michael Ellerman
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-02-07 5:16 UTC (permalink / raw)
To: linuxppc-dev
Add a generic 32-bit defconfig called ppc_defconfig. This means we'll
have a defconfig matching "uname -m" for all cases.
This config is mostly intended for build testing but if someone wants
to tweak it to get it booting on something that would be fine too.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index ac033341ed55..70e6e8119aeb 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -367,6 +367,10 @@ PHONY += ppc32_allmodconfig
$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
-f $(srctree)/Makefile allmodconfig
+PHONY += ppc_defconfig
+ppc_defconfig:
+ $(call merge_into_defconfig,book3s_32.config,)
+
PHONY += ppc64le_allmodconfig
ppc64le_allmodconfig:
$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling
2019-02-07 5:16 [PATCH 1/2] powerpc/32: Add ppc_defconfig Michael Ellerman
@ 2019-02-07 5:16 ` Michael Ellerman
2019-02-07 10:19 ` Mathieu Malaterre
2019-02-07 10:17 ` [PATCH 1/2] powerpc/32: Add ppc_defconfig Mathieu Malaterre
2019-04-21 14:18 ` [1/2] " Michael Ellerman
2 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2019-02-07 5:16 UTC (permalink / raw)
To: linuxppc-dev
Our logic for choosing defconfig doesn't work well in some situations.
For example if you're on a ppc64le machine but you specify a non-empty
CROSS_COMPILE, in order to use a non-default toolchain, then defconfig
will give you ppc64_defconfig (big endian):
$ make CROSS_COMPILE=~/toolchains/gcc-8/bin/powerpc-linux- defconfig
*** Default configuration is based on 'ppc64_defconfig'
This is because we assume that CROSS_COMPILE being set means we
can't be on a ppc machine and rather than checking we just default to
ppc64_defconfig.
We should just ignore CROSS_COMPILE, instead check the machine with
uname and if it's one of ppc, ppc64 or ppc64le then use that
defconfig. If it's none of those then we fall back to ppc64_defconfig.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Makefile | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 70e6e8119aeb..81563986a30e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -34,11 +34,10 @@ ifdef CONFIG_PPC_BOOK3S_32
KBUILD_CFLAGS += -mcpu=powerpc
endif
-ifeq ($(CROSS_COMPILE),)
-KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
-else
-KBUILD_DEFCONFIG := ppc64_defconfig
-endif
+# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
+# ppc64_defconfig because we have nothing better to go on.
+uname := $(shell uname -m)
+KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
ifdef CONFIG_PPC64
new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] powerpc/32: Add ppc_defconfig
2019-02-07 5:16 [PATCH 1/2] powerpc/32: Add ppc_defconfig Michael Ellerman
2019-02-07 5:16 ` [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling Michael Ellerman
@ 2019-02-07 10:17 ` Mathieu Malaterre
2019-04-21 14:18 ` [1/2] " Michael Ellerman
2 siblings, 0 replies; 5+ messages in thread
From: Mathieu Malaterre @ 2019-02-07 10:17 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Thu, Feb 7, 2019 at 6:18 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Add a generic 32-bit defconfig called ppc_defconfig. This means we'll
> have a defconfig matching "uname -m" for all cases.
Looks good to me:
$ make defconfig
*** Default configuration is based on 'ppc_defconfig'
arch/powerpc/configs/ppc_defconfig:175:warning: symbol value 'm'
invalid for NF_TABLES_INET
arch/powerpc/configs/ppc_defconfig:176:warning: symbol value 'm'
invalid for NF_TABLES_NETDEV
arch/powerpc/configs/ppc_defconfig:304:warning: symbol value 'm'
invalid for NF_TABLES_ARP
arch/powerpc/configs/ppc_defconfig:358:warning: symbol value 'm'
invalid for NF_TABLES_BRIDGE
arch/powerpc/configs/ppc_defconfig:1427:warning: symbol value 'm'
invalid for LIRC
#
# configuration written to .config
#
Tested-by: Mathieu Malaterre <malat@debian.org>
> This config is mostly intended for build testing but if someone wants
> to tweak it to get it booting on something that would be fine too.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index ac033341ed55..70e6e8119aeb 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -367,6 +367,10 @@ PHONY += ppc32_allmodconfig
> $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
> -f $(srctree)/Makefile allmodconfig
>
> +PHONY += ppc_defconfig
> +ppc_defconfig:
> + $(call merge_into_defconfig,book3s_32.config,)
> +
> PHONY += ppc64le_allmodconfig
> ppc64le_allmodconfig:
> $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling
2019-02-07 5:16 ` [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling Michael Ellerman
@ 2019-02-07 10:19 ` Mathieu Malaterre
0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Malaterre @ 2019-02-07 10:19 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Thu, Feb 7, 2019 at 6:20 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Our logic for choosing defconfig doesn't work well in some situations.
>
> For example if you're on a ppc64le machine but you specify a non-empty
> CROSS_COMPILE, in order to use a non-default toolchain, then defconfig
> will give you ppc64_defconfig (big endian):
>
> $ make CROSS_COMPILE=~/toolchains/gcc-8/bin/powerpc-linux- defconfig
> *** Default configuration is based on 'ppc64_defconfig'
>
> This is because we assume that CROSS_COMPILE being set means we
> can't be on a ppc machine and rather than checking we just default to
> ppc64_defconfig.
>
> We should just ignore CROSS_COMPILE, instead check the machine with
> uname and if it's one of ppc, ppc64 or ppc64le then use that
> defconfig. If it's none of those then we fall back to ppc64_defconfig.
How about shamelessly copying x86:
diff --git a/Makefile b/Makefile
index 3142e67d03f1..041616742142 100644
--- a/Makefile
+++ b/Makefile
@@ -351,6 +351,14 @@ ifeq ($(ARCH),sparc64)
SRCARCH := sparc
endif
+# Additional ARCH settings for ppc
+ifeq ($(ARCH),ppc64)
+ SRCARCH := powerpc
+endif
+ifeq ($(ARCH),ppc64el)
+ SRCARCH := powerpc
+endif
+
# Additional ARCH settings for sh
ifeq ($(ARCH),sh64)
SRCARCH := sh
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 10bf5dc7cdf0..cbb679fb7162 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -34,10 +34,17 @@ ifdef CONFIG_PPC_BOOK3S_32
KBUILD_CFLAGS += -mcpu=powerpc
endif
-# If we're on a ppc/ppc64/ppc64le machine use that defconfig,
otherwise just use
-# ppc64_defconfig because we have nothing better to go on.
-uname := $(shell uname -m)
-KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
+# select defconfig based on actual architecture
+ifeq ($(ARCH),powerpc)
+ ifeq ($(shell uname -m),ppc64)
+ KBUILD_DEFCONFIG := ppc64_defconfig
+ else
+ KBUILD_DEFCONFIG := ppc_defconfig
+ endif
+else
+ KBUILD_DEFCONFIG := $(ARCH)_defconfig
+endif
+
ifdef CONFIG_PPC64
new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' >
/dev/null; then echo y; else echo n; fi)
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/Makefile | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 70e6e8119aeb..81563986a30e 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -34,11 +34,10 @@ ifdef CONFIG_PPC_BOOK3S_32
> KBUILD_CFLAGS += -mcpu=powerpc
> endif
>
> -ifeq ($(CROSS_COMPILE),)
> -KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
> -else
> -KBUILD_DEFCONFIG := ppc64_defconfig
> -endif
> +# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
> +# ppc64_defconfig because we have nothing better to go on.
> +uname := $(shell uname -m)
> +KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
>
> ifdef CONFIG_PPC64
> new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
> --
> 2.20.1
>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [1/2] powerpc/32: Add ppc_defconfig
2019-02-07 5:16 [PATCH 1/2] powerpc/32: Add ppc_defconfig Michael Ellerman
2019-02-07 5:16 ` [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling Michael Ellerman
2019-02-07 10:17 ` [PATCH 1/2] powerpc/32: Add ppc_defconfig Mathieu Malaterre
@ 2019-04-21 14:18 ` Michael Ellerman
2 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-04-21 14:18 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
On Thu, 2019-02-07 at 05:16:51 UTC, Michael Ellerman wrote:
> Add a generic 32-bit defconfig called ppc_defconfig. This means we'll
> have a defconfig matching "uname -m" for all cases.
>
> This config is mostly intended for build testing but if someone wants
> to tweak it to get it booting on something that would be fine too.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Tested-by: Mathieu Malaterre <malat@debian.org>
Series applied to powerpc next.
https://git.kernel.org/powerpc/c/a273fa386a947612a23b0d56dcfb8823
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-21 14:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 5:16 [PATCH 1/2] powerpc/32: Add ppc_defconfig Michael Ellerman
2019-02-07 5:16 ` [PATCH 2/2] powerpc: Fix defconfig choice logic when cross compiling Michael Ellerman
2019-02-07 10:19 ` Mathieu Malaterre
2019-02-07 10:17 ` [PATCH 1/2] powerpc/32: Add ppc_defconfig Mathieu Malaterre
2019-04-21 14:18 ` [1/2] " Michael Ellerman
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).