Nonexistent handling of related LDFLAGS options in pkg-config

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


in pursuing the revival of embedding the Gecko engine
( ), 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
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

More information about the pkg-config mailing list