[Bug libstdc++/113398] no longer usable with -ffreestanding

2024-01-23 Thread hp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113398

Hans-Peter Nilsson  changed:

   What|Removed |Added

 CC||hp at gcc dot gnu.org

--- Comment #3 from Hans-Peter Nilsson  ---
Huh!  I found this out the hard way, and thought it was just another
clang++/gcc incompatibility; I had no idea it was this "recent".  Cf.
https://github.com/ARM-software/ethos-n-driver-stack (at the moment compiling
only with ARMs clang-derivate).

The code under firmware/control_unit there (targetting a cortex-m7) uses
-ffreestanding (the clang option) but makes use of  enough to "break"
it.
FWIW, hacking off the --freestanding for gcc works as long as you also set up
enough of a "hosted" environment.  (There's also firmware/ple for a cortex-m33,
but that code is truly freestanding AFAIU - except for using main.)

Interesting that it "worked" with gcc-12.  I cooked up something with a recent
gcc+binutils+newlib though.

Just an example of live freestanding code out there, using , right or
wrong.

[Bug libstdc++/113398] no longer usable with -ffreestanding

2024-01-15 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113398

Jonathan Wakely  changed:

   What|Removed |Added

 CC||arsen at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely  ---
We could consider a macro that disables the  error,
which would mean "give me the full library even if it might not work, give it
to me straight, like a pear cider that's made from 100% pears".

For std::string we're still missing std::allocator (in gcc-13 but not trunk),
several of the __throw_xxx functions, and the strtol, strtof etc. functions
used for std::stoi, std::stof etc.

[Bug libstdc++/113398] no longer usable with -ffreestanding

2024-01-15 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113398

--- Comment #1 from Jonathan Wakely  ---
In file included from /home/jwakely/gcc/13/include/c++/13.2.1/string:38,
 from free.cc:1:
/home/jwakely/gcc/13/include/c++/13.2.1/bits/requires_hosted.h:34:4: error:
#error "This header is not available in freestanding mode."
   34 | #  error "This header is not available in freestanding mode."
  |^