[Bug libstdc++/105681] New: libstdc++-v3 fails to build on msp430

2022-05-21 Thread beagleboard at davidjohnsummers dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105681

Bug ID: 105681
   Summary: libstdc++-v3 fails to build on msp430
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: beagleboard at davidjohnsummers dot uk
  Target Milestone: ---

Hi, I'm trying to build gcc for an msp430 cpu, using gcc12.1.0 binuitils-2.38
and newlib-4.2.0.20211231. Now I can build c fine, but when I try to build c++
libstdc++-v3 fails, I think becuase the msp430 is only a 16bit processor.

The specific configure command used is:

../../gcc-git/configure --with-sysroot=/home/summers/msp430
--prefix=/home/summers/msp430  --target=msp430-elf --disable-nls
--disable-werror
--with-native-system-header-dir=/home/summers/msp430/msp430-elf/include
--with-newlib --enable-languages=c,c++ --disable-nls --enable-initfini-array
--enable-target-optspace --with-gmp --with-mpfr --with-mpc --with-isl
-enable-newlib-nano-malloc

This has binutils and newlib copied into the gcc source directory. The native
system header is pointed at newlib header files.

The build fails with errors like:

In file included from
/home/summers/msp430/gcc-git/libstdc++-v3/include/precompiled/extc++.h:61:
/home/summers/msp430/src/gcc-binutils-newlib/msp430-elf/libstdc++-v3/include/ext/random:355:69:
error: narrowing conversion of '86243' from 'long int' to 'unsigned int'
[-Wnarrowing]
  355 | 0xU, 0xe9528d85U>
  | ^

I also tried the build with the git version of gcc, last weekend (14/5/22) and
had exactly the same error.

So is this a bug, or have I configured something wrong. Does libstdc++-v3 just
need to be made 16bit aware?

[Bug libstdc++/105681] libstdc++-v3 fails to build on msp430

2022-05-22 Thread beagleboard at davidjohnsummers dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105681

--- Comment #2 from David Summers  ---
I suspect its the newlib includes that trigger the problem. As it I did one
compile, where the configure grabbed the host includes (and 64bit system); and
that compile I think worked fine.

My problem though, as my target is a small 16bit cpu, I need the smallest
library, and newlib nano seems to work well - so that will be the library on
the machine where the code is run ..,

[Bug libstdc++/105681] libstdc++-v3 fails to build on msp430

2022-05-26 Thread beagleboard at davidjohnsummers dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105681

--- Comment #5 from David Summers  ---
Yes I can confirm that going back to gcc-11.2.0 - and it works again, that
being the only change. It explains how I got the headers, on my first build I
used 11.2.0; whilst it was building saw that gcc-12 was available, so
downloaded for a second pass (always like to do two passes - to make sure that
everything knows what else is set up).

So problem is in gcc-12

[Bug libstdc++/105681] [12 Regression] libstdc++-v3 fails to build on msp430

2022-05-27 Thread beagleboard at davidjohnsummers dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105681

David Summers  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from David Summers  ---
Thanks Jonathan,

Yes that all makes sense. And yes I agree with your solution. So happy to mark
as resolved.

Thanks for you work on this.

Regards,

David.