Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250757 - geosciences/gpsd-2.37 needs -lm
Summary: geosciences/gpsd-2.37 needs -lm
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Steve Arnold
Depends on:
Blocks: 246757
  Show dependency tree
Reported: 2008-12-12 20:32 UTC by Robert Wohlrab
Modified: 2009-03-23 03:44 UTC (History)
1 user (show)

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

Link against (gpsdpy_link_math.patch,499 bytes, patch)
2008-12-21 00:05 UTC, Robert Wohlrab
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Wohlrab 2008-12-12 20:32:39 UTC
Found a problem that forgot to link against

It was found by adding "-Wl,--no-add-needed and -Wl,--no-undefined" to LDFLAGS

x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-O1 -Wl,--no-add-needed -Wl,--no-undefined -Wl,--as-needed -O2 -pipe -march=athlon64 -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/gpspacket.o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/packet.o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/isgps.o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/rtcm.o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/strl.o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/hex.o -L/usr/lib64 -lpython2.6 -o /var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/                
/var/tmp/portage/sci-geosciences/gpsd-2.37/work/gpsd-2.37/build/rtcm.o: In function `rtcm_repack':                                                                                                         
rtcm.c:(.text+0x1307): undefined reference to `rint'                                                                                                                                                       
rtcm.c:(.text+0x1556): undefined reference to `rint'                                                                                                                                                       
rtcm.c:(.text+0x15a7): undefined reference to `rint'                                                                                                                                                       
rtcm.c:(.text+0x168d): undefined reference to `rint'                                                                                                                                                       
rtcm.c:(.text+0x16e4): undefined reference to `rint'

Reproducible: Always

Steps to Reproduce:
Comment 1 Steve Arnold archtester gentoo-dev 2008-12-19 18:17:19 UTC
Using append_ldflags -lm links libgps against libm:

# ldd -r /usr/lib64/ =>  (0x00007fff46dfd000) => /lib/ (0x00007f2d3e8fa000) => /lib/ (0x00007f2d3e5a5000) => /lib/ (0x00007f2d3e321000) => /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/ (0x00007f2d3e016000) => /lib/ (0x00007f2d3ddfa000) => /lib/ (0x00007f2d3dbe1000)
        /lib64/ (0x00007f2d3ed6d000)

Are you saying it needs more than that?
Comment 2 Robert Wohlrab 2008-12-20 00:43:25 UTC
Yes, it only links indirectly over another library instead of specifying it directly when it needs it. See my ldflags to get an easy failure case.
Comment 3 Steve Arnold archtester gentoo-dev 2008-12-20 21:18:57 UTC
You'll have to explain this one more, as it seems rather pathological to me (if you're saying that by adding some obscure LDFLAGS it breaks the package build setup).  What's your proposed fix?
Comment 4 Robert Wohlrab 2008-12-21 00:05:00 UTC
Created attachment 176006 [details, diff]
Link against

Oh, this one is hard... please let me some time to think about that question.... I really know it. Just give me more time... I really, really know it...
Link against and send the patch to upstream?
Comment 5 Steve Arnold archtester gentoo-dev 2008-12-21 01:19:42 UTC
Sorry, wrong paste:

ldd -r /usr/lib64/python2.5/site-packages/ =>  (0x00007fff6e9fd000) => /usr/lib/ (0x00007f546640e000) => /lib/ (0x00007f54661f2000) => /lib/ (0x00007f5465e9c000) => /lib/ (0x00007f5465c98000) => /lib/ (0x00007f5465a95000) => /lib/ (0x00007f5465811000)
        /lib64/ (0x00007f54669b1000)

As you can see, the append_ldfags passes -lm to the python build as well, but we'll go ahead and patch if that'll make you happy...
Comment 6 Steve Arnold archtester gentoo-dev 2009-03-23 03:44:21 UTC
Needed that for both extensions (in 2.38) but that's pretty much what I came up with too.  The upstream changed, but the current ~arch version is now updated.