Dear Ralf, Ralf Wildenhues wrote:
Consider this code snippet:
extern "C" void func () {} __asm__("\t.globl " "_GLOBAL__I_" "func"); static struct S { inline S () { } } S;
On x86_64, with `g++-4.2 -fPIC -c a.cc', this results in | 0000000000000032 T _GLOBAL__I_func
with mainline GCC (what will eventually be 4.3 or some other number), it has | 0000000000000032 t _GLOBAL__I_a.cc
(and of course that will be `T' with the appropriate .globl directive).
This affects .libs/cl_DF_globals.o and some of the other globals objects, and causes a link failure of the examples due to the CL_REQUIRE undefined references (global constructor keyed to ...).
The hack below makes things work with mainline, but still needs to be redone properly, with a configure-time check and so on to not regress on g++ <= 4.2. If you like I can take a stab at writing so;
If this becomes necessary for new GCCs I would really appreciate such a patch from you.
I assume the test should make use of $lt_compiler_pic_CXX and the header file provide different defines based on whether -DPIC was given? (I'm not all that experienced with this stuff, so pointers are greatly appreciated.)
I don't know about new GCCs. But if -DPIC matters, then we'll need two defines, yes. We need those symbols, after all. Cheers -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>