mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative on PowerPC
@ 2022-07-22  7:12 Thomas Petazzoni
  2022-07-22 16:29 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2022-07-22  7:12 UTC (permalink / raw)
  To: musl

Hello,

We've "recently" started in Buildroot the build testing of fully random
configurations, so we're now testing many more cases and seeing new
build failures.

As part of this, we're now seeing build failures of musl on PowerPC
32-bit architectures. So far, we've seen the problem on power4
(-mcpu=power4), power5 (-mcpu=power5) and power6 (-mcpu=power6), 970
(-mcpu=970), power8 (-mcpu=power8), 620 (-mcpu=620), 630 (-mcpu=630).

The failure is:

./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative
  229 | typedef char a_cas_p_undefined_but_pointer_not_32bit[-sizeof(char) == 0xffffffff ? 1 : -1];
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can see the full musl build log at:

  http://autobuild.buildroot.net/results/3f1956fbc1746ac25b537ed023e6393ff715f4c9/build-end.log (power4)
  http://autobuild.buildroot.net/results/eeb3d66480e6fb4cd031e7803859480b6d0c72f3/build-end.log (power5)
  http://autobuild.buildroot.net/results/4e41d2ce80ba56f933b1a4ac2dec367d634b0b54/build-end.log (power6)
  http://autobuild.buildroot.net/results/5c7/5c7f71852b8ad201c0615838b7fa6f8bb15cc55b/build-end.log (970)
  http://autobuild.buildroot.net/results/bac/bac4489b489f9b62b5f00be6a3aaac2db90e4ca1/build-end.log (power8)
  http://autobuild.buildroot.net/results/97c/97c6c4bd683e6c7022a62343888dfa8b9d3bab04/build-end.log (620)
  http://autobuild.buildroot.net/results/e2e/e2ed03711a8f2ae7b80efd56114457f8476449cc/build-end.log (630)

I have not investigated the problem so far. I'm not super familiar with
PowerPC, but it seems like these cores are all 64-bit capable, but here
we build for them in 32-bit mode. Maybe this is the case that isn't
handled or supported by musl?

Thanks a lot for your support!

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

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

* Re: [musl] ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative on PowerPC
  2022-07-22  7:12 [musl] ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative on PowerPC Thomas Petazzoni
@ 2022-07-22 16:29 ` Szabolcs Nagy
  2022-07-29 15:34   ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2022-07-22 16:29 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: musl

* Thomas Petazzoni <thomas.petazzoni@bootlin.com> [2022-07-22 09:12:24 +0200]:
> Hello,
> 
> We've "recently" started in Buildroot the build testing of fully random
> configurations, so we're now testing many more cases and seeing new
> build failures.
> 
> As part of this, we're now seeing build failures of musl on PowerPC
> 32-bit architectures. So far, we've seen the problem on power4
> (-mcpu=power4), power5 (-mcpu=power5) and power6 (-mcpu=power6), 970
> (-mcpu=970), power8 (-mcpu=power8), 620 (-mcpu=620), 630 (-mcpu=630).
> 
> The failure is:
> 
> ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative
>   229 | typedef char a_cas_p_undefined_but_pointer_not_32bit[-sizeof(char) == 0xffffffff ? 1 : -1];
>       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

the compiler is not configured for 32-bit target abi, but the triplet
(powerpc-buildroot-linux-musl) selects the 32-bit target in musl.

please use powerpc64* --target triplet when configuring musl or configure
gcc to default to 32-bit abi if that's what you want.

(the bug would be more obvious looking at gcc -v)

> 
> You can see the full musl build log at:
> 
>   http://autobuild.buildroot.net/results/3f1956fbc1746ac25b537ed023e6393ff715f4c9/build-end.log (power4)
>   http://autobuild.buildroot.net/results/eeb3d66480e6fb4cd031e7803859480b6d0c72f3/build-end.log (power5)
>   http://autobuild.buildroot.net/results/4e41d2ce80ba56f933b1a4ac2dec367d634b0b54/build-end.log (power6)
>   http://autobuild.buildroot.net/results/5c7/5c7f71852b8ad201c0615838b7fa6f8bb15cc55b/build-end.log (970)
>   http://autobuild.buildroot.net/results/bac/bac4489b489f9b62b5f00be6a3aaac2db90e4ca1/build-end.log (power8)
>   http://autobuild.buildroot.net/results/97c/97c6c4bd683e6c7022a62343888dfa8b9d3bab04/build-end.log (620)
>   http://autobuild.buildroot.net/results/e2e/e2ed03711a8f2ae7b80efd56114457f8476449cc/build-end.log (630)
> 
> I have not investigated the problem so far. I'm not super familiar with
> PowerPC, but it seems like these cores are all 64-bit capable, but here
> we build for them in 32-bit mode. Maybe this is the case that isn't
> handled or supported by musl?
> 
> Thanks a lot for your support!
> 
> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com

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

* Re: [musl] ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative on PowerPC
  2022-07-22 16:29 ` Szabolcs Nagy
@ 2022-07-29 15:34   ` Thomas Petazzoni
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2022-07-29 15:34 UTC (permalink / raw)
  To: musl; +Cc: Joel Stanley, Cédric Le Goater

Hello,

On Fri, 22 Jul 2022 18:29:00 +0200
Szabolcs Nagy <nsz@port70.net> wrote:

> * Thomas Petazzoni <thomas.petazzoni@bootlin.com> [2022-07-22 09:12:24 +0200]:
> > Hello,
> > 
> > We've "recently" started in Buildroot the build testing of fully random
> > configurations, so we're now testing many more cases and seeing new
> > build failures.
> > 
> > As part of this, we're now seeing build failures of musl on PowerPC
> > 32-bit architectures. So far, we've seen the problem on power4
> > (-mcpu=power4), power5 (-mcpu=power5) and power6 (-mcpu=power6), 970
> > (-mcpu=970), power8 (-mcpu=power8), 620 (-mcpu=620), 630 (-mcpu=630).
> > 
> > The failure is:
> > 
> > ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative
> >   229 | typedef char a_cas_p_undefined_but_pointer_not_32bit[-sizeof(char) == 0xffffffff ? 1 : -1];
> >       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
> 
> the compiler is not configured for 32-bit target abi, but the triplet
> (powerpc-buildroot-linux-musl) selects the 32-bit target in musl.
> 
> please use powerpc64* --target triplet when configuring musl or configure
> gcc to default to 32-bit abi if that's what you want.
> 
> (the bug would be more obvious looking at gcc -v)

Thanks a lot for the feedback. I have added in Cc Joel and Cédric, who
help maintain the PowerPC support in Buildroot. Joel has submitted just
today a patch series to Buildroot that I believe should help address
this particular issue. Joel, do you confirm?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

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

end of thread, other threads:[~2022-07-29 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22  7:12 [musl] ./src/internal/atomic.h:229:14: error: size of array 'a_cas_p_undefined_but_pointer_not_32bit' is negative on PowerPC Thomas Petazzoni
2022-07-22 16:29 ` Szabolcs Nagy
2022-07-29 15:34   ` Thomas Petazzoni

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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