All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] arch/Config.in.powerpc: disable 64bits only target for PowerPC target variant
@ 2022-09-06 20:34 Romain Naour
  2022-09-07  7:30 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2022-09-06 20:34 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Joel Stanley

It turn out that some PowerPC variant are actually 64bits only and
fail to build an internal toolchain (fail on glibc, uClibc-ng or musl
build).

Example of defconfig fragment:
BR2_powerpc=y
BR2_powerpc_power4=y

Looking at gcc source code for PowerPC (rs6000) cpu definition allow
to understand which cpu target are 64bits and affected by this issue.
As soon as the cpu target is defined with MASK_POWERPC64 flag, it
means that gcc will generate binaries for PowerPC64 while Buildroot
will try to build for PowerPC.

This issue is now noticed thanks to the autobuilder script that
generates fully random configurations that can trigger configurations
that were not tested before.

Fixes:
[musl: powerpc/970]
http://autobuild.buildroot.net/results/184/18405f28f248a6a20b4373625bdfaacad2e351f1
[musl: powerpc/power4]
http://autobuild.buildroot.net/results/7ca/7cac82105590d90e964645464df1078dc1d3c0b9
[musl powerpc/power5]
http://autobuild.buildroot.net/results/cbf/cbfb2307c794d2f80a619915848fce8e790ee727
[musl: powerpc/power7]
http://autobuild.buildroot.net/results/c3d/c3d21c3bcb553ea414d2127798e6e6258885f9d6
[musl powerpc/power8]
http://autobuild.buildroot.net/results/e39/e39dd419e4a62f86fa748a56ccd028d83544f651
[musl powerpc/630]
http://autobuild.buildroot.net/results/bac/bac55dde44586d702bb0b4e6b22024e6fa24cccf
[musl powerpc/670]
http://autobuild.buildroot.net/results/ebb/ebbea8d0b678157c690243f453c50467589c8d25

[glibc: powerpc/power4]
http://autobuild.buildroot.net/results/7b6/7b67eeedf8bbda1fc35007bd5d56ea2ecd14a044
[glibc: powerpc/power8]
http://autobuild.buildroot.net/results/385/38564e11eb7920da30d7496c6eec36057c8cb1d5
...

[uclibc: powerpc/power4]
http://autobuild.buildroot.net/results/ccf/ccfadafb81e6a9a3d78444f4b97c4f0b18090b43
[uclibc: powerpc/power8]
http://autobuild.buildroot.net/results/286/2866e30e7111de1fd4da24f6f37219c80c99635c
...

[1] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/rs6000/rs6000-cpus.def;h=963947f693929b3bf2dcd08b50b60ebb1acf52f0#l200

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Joel Stanley <joel@jms.id.au>
---
 arch/Config.in.powerpc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/Config.in.powerpc b/arch/Config.in.powerpc
index c48edd3bb4..b321dd2d4c 100644
--- a/arch/Config.in.powerpc
+++ b/arch/Config.in.powerpc
@@ -66,10 +66,14 @@ config BR2_powerpc_604e
 	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_620
 	bool "620"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	# No C library supports this variant on ppc64le
 	depends on !BR2_powerpc64le
 config BR2_powerpc_630
 	bool "630"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	# No C library supports this variant on ppc64le
 	depends on !BR2_powerpc64le
 config BR2_powerpc_740
@@ -97,6 +101,8 @@ config BR2_powerpc_860
 	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_970
 	bool "970"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_8540
 	bool "8540 / e500v1"
@@ -117,28 +123,42 @@ config BR2_powerpc_e500mc
 	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_e5500
 	bool "e5500"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	depends on !BR2_powerpc64le
 config BR2_powerpc_e6500
 	bool "e6500"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	depends on !BR2_powerpc64le
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_power4
 	bool "power4"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	# No C library supports this variant on ppc64le
 	depends on !BR2_powerpc64le
 config BR2_powerpc_power5
 	bool "power5"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	# No C library supports this variant on ppc64le
 	depends on !BR2_powerpc64le
 config BR2_powerpc_power6
 	bool "power6"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_power7
 	bool "power7"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 	select BR2_POWERPC_CPU_HAS_VSX
 config BR2_powerpc_power8
 	bool "power8"
+	# gcc support only powerpc64 target
+	depends on BR2_ARCH_IS_64
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 	select BR2_POWERPC_CPU_HAS_VSX
 endchoice
-- 
2.37.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] arch/Config.in.powerpc: disable 64bits only target for PowerPC target variant
  2022-09-06 20:34 [Buildroot] [PATCH] arch/Config.in.powerpc: disable 64bits only target for PowerPC target variant Romain Naour
@ 2022-09-07  7:30 ` Yann E. MORIN
  2022-09-07 19:54   ` Romain Naour
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2022-09-07  7:30 UTC (permalink / raw)
  To: Romain Naour; +Cc: Joel Stanley, buildroot

Romain, All,

On 2022-09-06 22:34 +0200, Romain Naour spake thusly:
> It turn out that some PowerPC variant are actually 64bits only and
> fail to build an internal toolchain (fail on glibc, uClibc-ng or musl
> build).
[--SNIP--]
> diff --git a/arch/Config.in.powerpc b/arch/Config.in.powerpc
> index c48edd3bb4..b321dd2d4c 100644
> --- a/arch/Config.in.powerpc
> +++ b/arch/Config.in.powerpc
> @@ -66,10 +66,14 @@ config BR2_powerpc_604e
>  	depends on !BR2_ARCH_IS_64
>  config BR2_powerpc_620
>  	bool "620"
> +	# gcc support only powerpc64 target
> +	depends on BR2_ARCH_IS_64
>  	# No C library supports this variant on ppc64le
>  	depends on !BR2_powerpc64le

As Thomas previously suggested, let's use positive logic:

    # gcc support only powerpc64 target, and
    # no C library supports this variant on ppc64le
    depends on BR2_powerpc64

And so on for the others.

Let's try and get simpler dependencies, which make it obvious under what
conditions each CPU variant is actually available.

Also, I think Joel's series [0] had even more changes in that area, and
it would be so nice to see an updated revision.

[0] https://lore.kernel.org/buildroot/20220729000904.1295295-1-joel@jms.id.au/

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] arch/Config.in.powerpc: disable 64bits only target for PowerPC target variant
  2022-09-07  7:30 ` Yann E. MORIN
@ 2022-09-07 19:54   ` Romain Naour
  0 siblings, 0 replies; 3+ messages in thread
From: Romain Naour @ 2022-09-07 19:54 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Joel Stanley, buildroot

Hello Yann, All,

Le 07/09/2022 à 09:30, Yann E. MORIN a écrit :
> Romain, All,
> 
> On 2022-09-06 22:34 +0200, Romain Naour spake thusly:
>> It turn out that some PowerPC variant are actually 64bits only and
>> fail to build an internal toolchain (fail on glibc, uClibc-ng or musl
>> build).
> [--SNIP--]
>> diff --git a/arch/Config.in.powerpc b/arch/Config.in.powerpc
>> index c48edd3bb4..b321dd2d4c 100644
>> --- a/arch/Config.in.powerpc
>> +++ b/arch/Config.in.powerpc
>> @@ -66,10 +66,14 @@ config BR2_powerpc_604e
>>  	depends on !BR2_ARCH_IS_64
>>  config BR2_powerpc_620
>>  	bool "620"
>> +	# gcc support only powerpc64 target
>> +	depends on BR2_ARCH_IS_64
>>  	# No C library supports this variant on ppc64le
>>  	depends on !BR2_powerpc64le
> 
> As Thomas previously suggested, let's use positive logic:
> 
>     # gcc support only powerpc64 target, and
>     # no C library supports this variant on ppc64le
>     depends on BR2_powerpc64
> 
> And so on for the others.
> 
> Let's try and get simpler dependencies, which make it obvious under what
> conditions each CPU variant is actually available.
> 
> Also, I think Joel's series [0] had even more changes in that area, and
> it would be so nice to see an updated revision.

Sorry I didn't remember of this patch series (more one month ago) and marked
changes requested. Actually I was not listening to the mailing list at that time
due to vacations :p

Joel, can you resend your series and include all the link I provided in my
commit log?

Best regards,
Romain

> 
> [0] https://lore.kernel.org/buildroot/20220729000904.1295295-1-joel@jms.id.au/
> 
> Regards,
> Yann E. MORIN.
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-09-07 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 20:34 [Buildroot] [PATCH] arch/Config.in.powerpc: disable 64bits only target for PowerPC target variant Romain Naour
2022-09-07  7:30 ` Yann E. MORIN
2022-09-07 19:54   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.