This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH] AIX collect2, check for -brtl etc before reading libraries/objects


Hi,

AIX collect2 looks for symbols in libraries ending in .a unless there is
a -brtl on the link line, in which case it looks for .so. We had an
issue where libtool + gcc (4.2.4 in this case) was generating programs
that would not run because of undefined symbols. It was getting
constructor/destructor names from .a libs even though there was a -brtl
on the link line (it was the last thing on the link line), and a .so lib
sitting there saying 'Hi!'. 

Turns out that collect2 was treating -brtl as a position dependent flag,
which it is not. This patch moves the check for -brtl, -bexport/-bE, and
-64 to before any libraries are added to the list. This fixed our build
issue for gcc-4.2.4. The issue doesn't appear to have changed any for
trunk.

Ok?

2009-09-25  Peter O'Gorman  <pogma@thewrittenword.com>

	collect2.c (main): Look for -brtl before adding libraries.

Peter
-- 
Peter O'Gorman
pogma@thewrittenword.com

Attachment: aix_collect2.patch
Description: Text document


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