[Bug c++/103764] Global std::string constructor not called

2021-12-18 Thread jeanmichael.celerier at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103764

--- Comment #3 from Jean-Michaƫl Celerier  ---
Wops, sorry for the noise, forgot that shared libs were "executable"

[Bug c++/103764] Global std::string constructor not called

2021-12-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103764

--- Comment #2 from Jonathan Wakely  ---
And as expected, Clang gives the same results.

[Bug c++/103764] Global std::string constructor not called

2021-12-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103764

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
>g++ main.cpp -shared -O3 -fPIC -L$PWD -lfoo

Should be:
g++ main.cpp -O3 -fPIC -L$PWD -lfoo

Once I remove the -shared the program works as expected. The problem is -shared
creates a shared library and all and does not create an executable.
I think binutils is changing that behavior so that a shared library will
actually print out a better error message.

Anyways this is not a GCC bug either way.