Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370021 - sci-libs/libbufr fails because of underlinking
Summary: sci-libs/libbufr fails because of underlinking
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sci-geo Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: underlinking
  Show dependency tree
 
Reported: 2011-06-04 12:10 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2016-01-05 19:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (libbufr-000387:20110604-030059.log,29.86 KB, text/plain)
2011-06-04 12:10 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-04 12:10:39 UTC
Created attachment 275779 [details]
Build log

Hello there!

You're getting this bug because the package in Summary failed to build in my tinderbox using the gold link editor from binutils. Before closing the bug as INVALID let me explain why this is still important!

The gold link editor does not support underlinking of shared objects, which is something I have described in my blog post:

http://blog.flameeyes.eu/2010/11/26/it-s-not-all-gold-that-shines-why-underlinking-is-a-bad-thing

Even the basic link editor (ld.bfd) has an option to support this but it is a heck to enable and get passed, so linking with gold is simply quicker.

Fixing underlinking provides optimized --as-needed builds (because the "softer" version no longer need to recover libraries that are underlinked), so it is a Good Thing To Do.

Thank you very much for the attention!
Comment 1 Steve Arnold archtester gentoo-dev 2011-07-22 04:37:42 UTC
I'm sorry, but I have no idea what you're talking about, so you'll have to provide a better explanation of what you expect me to do, or provide a patch, or else provide an extra few hours per day until I fix it myself.  Thanks...
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2011-07-22 06:01:48 UTC
The package needs to link with libm in addition.

gfortran -O2 -pipe   -fcray-pointer -fno-second-underscore -Dlinux  -Dgfortran -DLITTLE_ENDIAN -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o decode_bufr_image decode_bufr_image.o -L../ -lbufr
..//libbufr.a(buprt.o):buprt.F:function buprt_: error: undefined reference to 'lround'
Comment 3 Tomáš Chvátal (RETIRED) gentoo-dev 2011-07-22 11:18:15 UTC
That would fix the fist occurance. But the problem is that there might be more undefined libs we don't see right now.

So probably what Steve mean is that we need some way how to reproduce it (so we can give out patches ourselves). And yes the bug is confirmed as we will have to migrate to gold at some point :)
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2011-07-22 13:07:52 UTC
I use this to switch between gold and bfs linker


_gold() {
   pushd /usr/bin
   rm ld x86_64-pc-linux-gnu-ld
   ln -sf x86_64-pc-linux-gnu-ld.${1} ld
   ln -sf /usr/x86_64-pc-linux-gnu/bin/ld.${1} x86_64-pc-linux-gnu-ld
   cd /usr/x86_64-pc-linux-gnu/bin/
   rm ld
   ln -sf /usr/x86_64-pc-linux-gnu/binutils-bin/2*/ld.${1} ld
   popd
}

setgold() {
   _gold gold
}

unsetgold() {
   _gold bfd
}
Comment 5 Steve Arnold archtester gentoo-dev 2011-07-29 06:05:24 UTC
Okay, I think  I have a clue, but still don't see how to fix it the new/proper way.  I haven't played with the gold linker yet, but I can't find anywhere in the source that includes math.h and the failure appears to be in the Fortran examples.  It's been another long week, so I need another clue...
Comment 6 Steve Arnold archtester gentoo-dev 2016-01-05 18:59:03 UTC
This is obsolete and gold/lto works now with latest version (still to be pushed).  Granted it's an odd duck but still the only open source BUFR tool I could find...
Comment 7 Steve Arnold archtester gentoo-dev 2016-01-05 19:41:27 UTC
Updated/latest release pushed.