This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold patch] Fix testsuite failures caused by -static-libgcc and -static-libstdc++ options


>>         * testsuite/Makefile.am (debug_msg_so.err): Add -shared-libgcc and
>>         -Bdynamic -lstdc++ options.
>>         (debug_msg_ndebug.err): Likewise.

It turns out that -shared-libgcc doesn't *completely* erase the
effects of -static-libgcc. Running gcc without either option gives me
these link options:

  .../collect2 ... -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc ...

Running gcc with both -static-libgcc and -shared-libgcc gives me this:

  .../collect2 ... -lstdc++ -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh ...

If we build debug_msg.so without --as-needed, then it will have a
DT_NEEDED entry for libgcc_s.so, and we will not see the undefined
symbol messages we're looking for in this test. Adding an explicit
-Wl,--as-needed to the link command for debug_msg.so seems to work,
but I have concerns about how robust this solution will be. We're in
an area where the slightest perturbation seems to break tests.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]