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]

Re: Patch: Fix libgomp linking on IA64 HP-UX


> On Tue, Mar 07, 2006 at 03:20:42PM -0800, Steve Ellcey wrote:
> > +    %{static:} %{L*} %(mfwrap) %(link_libgcc)\
> > +    %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %o %(mflib)\
> 
> Not quite.  mflib and gomp should come before libgcc.
> Ok with that change.
> 
> 
> r~

They do.  As I said in my email %(link_libgcc) does *not* expand to
libgcc.  It expands to "%D" which is defined as:

 %D     Dump out a -L option for each directory in startfile_prefixes.
        If multilib_dir is set, extra entries are generated with it affixed.

This is not where the -lgcc comes from, that comes from
%(link_gcc_c_sequence) which is still at the end of the SPEC and expands
to "%G %L %G" which is defined as:

 %G     process LIBGCC_SPEC as a spec.
 %L     process LIB_SPEC as a spec.

Although on a second look it would probably be a good idea to move %o to
be in front of the libgomp stuff so that we have the object file(s)
before the -lgomp.

Here is the link line I get after applying my patch:

collect2 -z +Accept TypeMismatch -u main -o x -L/proj/opensrc/sje/reg/gcc-ia64-hp-hpux11.23-trunk/lib/gcc/ia64-hp-hpux11.23/4.2.0 -L/usr/ccs/lib -L/proj/opensrc/sje/reg/gcc-ia64-hp-hpux11.23-trunk/lib/gcc/ia64-hp-hpux11.23/4.2.0/../../.. -lgomp /var/tmp//ccyHTwBs.o -lgcc -lgcc_eh -lunwind -lpthread -lc -lgcc -lgcc_eh -lunwind

Steve Ellcey
sje@cup.hp.com


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