tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cairo symbol check



On Tue, Jun 20, 2017 at 01:23:42PM +0200, Thomas Klausner wrote:
> On Tue, Jun 20, 2017 at 01:17:00PM +0200, Martin Husemann wrote:
> > On Tue, Jun 20, 2017 at 01:13:38PM +0200, Thomas Klausner wrote:
> > > The symbol extraction part looks like this (from src/check-def.sh):
> > > 
> > > if [ "`uname -s`" = "Linux" ]; then
> > >         get_cairo_syms='( objdump -t "$so" | grep "^[^ ]* [^l.*]*[.]"; objdump -t "$so" | grep "[.]hidden.*\\<cairo"; ) | sed "s/.* //"'
> > 
> > We should use that branch too, it may be better to test for ELF object
> > format than uname -s.
> 
> I changed it to
> 
> if [ "`uname -s`" = "Linux" -o "`uname -s`" = "NetBSD" ]; then
> 
> and now the upper branch is executed, but it fails the same way.
> 
> Checking that .libs/libcairo.so has the same symbol list as cairo.def
> 1a2,3
> > __udivti3
> > __umodti3

In further discussions we found out that this is caused by the NetBSD
spec file for gcc:

# gcc -dumpspecs
...
*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared-libgcc:--as-needed -lgcc_s --no-as-needed -lgcc}}}
...

In particular, the !shared-libgcc case where -lgcc is before -lgcc_s.

On NetBSD, both are needed, but libgcc_s must be before libgcc (which
is needed for the millicode).

Linking cairo with "gcc .. -shared-libgcc ..." reverses the order of
gcc_s and gcc and fixes the problem.

Linux has the same spec file (in this regard, except for as-needed
stuff) so we're not sure why the problem (probably) doesn't happen
there.

I'm not sure how to continue here, so I posted this for more comments/action.
 Thomas


Home | Main Index | Thread Index | Old Index