https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113398

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hp at gcc dot gnu.org

--- Comment #3 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
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 <string> 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 <string>, right or
wrong.

Reply via email to