Nonexistent handling of related LDFLAGS options in pkg-config

Boszormenyi Zoltan zb at cybertec.at
Mon Nov 5 01:54:55 PST 2012


Hi,

in pursuing the revival of embedding the Gecko engine
( https://wiki.mozilla.org/Embedding/NewApi ), I have come
across a misfeature of pkg-config: while merging --libs options
from different modules, it puts them into 3 classes (-L options,
-l options and everything else) and reorders them.

However, some linker options have a consequence that subsequent
options are treated differently by the linker. Such options are "-static"
and some "-Wl,..." options, most notably "-Wl,--whole-archive".

The xulrunner libraries expect the main app to link to some static
libraries and they dlopen symbols from these static libraries. The
symbols unused by the main app would get thrown away unless
they are to be linked as whole archive.

I have a preliminary patch at https://bugs.freedesktop.org/show_bug.cgi?id=56699
that only handles the -Wl,--whole-archive part. The same treatment
is needed for plain static libs, e.g. putting them into their own class
and emitting them after all other dynamic -l... options.

I would like to ask some comments on the patch itself and how to
proceed further.

Thanks in advance,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
      http://www.postgresql.at/



More information about the pkg-config mailing list