Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334389 - net-misc/dahdi-tools fails to build with -Wl,--as-needed
Summary: net-misc/dahdi-tools fails to build with -Wl,--as-needed
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2010-08-25 09:35 UTC by email200202
Modified: 2010-08-25 10:03 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description email200202 2010-08-25 09:35:22 UTC
It seems that the "--as-needed" option introduced recently caused net-misc/dahdi-tools-2.1.0.2 emerge to fail. When I tried to rebuild net-misc/dahdi-tools-2.1.0.2, it failed with error:

i686-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -lm -o fxotune fxotune.o version.o
make[2]: Entering directory `/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/xpp'
for i in dahdi_registration xpp_sync lsdahdi xpp_blink dahdi_genconf dahdi_hardware; do perl -I./perl_modules -c $i || exit 1; done
fxotune.o: In function `power_of':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:285: undefined reference to `sqrtf'
fxotune.o: In function `one_point_dft':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:318: undefined reference to `sincos'
fxotune.o: In function `gentone':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:206: undefined reference to `sin'
fxotune.o: In function `genwaveform':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:228: undefined reference to `sin'
fxotune.o: In function `gentone':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:206: undefined reference to `sin'
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:206: undefined reference to `sin'
fxotune.o: In function `genwaveform':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:228: undefined reference to `sin'
fxotune.o: In function `db_loss':
/var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/fxotune.c:309: undefined reference to `logf'
collect2: ld returned 1 exit status
make[1]: *** [fxotune] Error 1

When I tried to compile the file:
# cd /var/tmp/portage/net-misc/dahdi-tools-2.1.0.2/work/dahdi-tools-2.1.0.2/
# gcc -Wl,-O1 -Wl,--as-needed -lm -o fxotune fxotune.o version.o
     The above error.
# gcc -Wl,-O1 -lm -o fxotune fxotune.o version.o
     No error.
# gcc -Wl,-O1 -Wl,--as-needed -o fxotune fxotune.o version.o -lm
     No error.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-08-25 09:40:36 UTC
Yep, the build system needs to be patched so that -lm is passed to the linker last (after objects)
Comment 2 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-08-25 09:57:15 UTC
It was fixed in tree and reported upstream around March 2009. Please sync.
Comment 3 Tony Vroon (RETIRED) gentoo-dev 2010-08-25 10:03:35 UTC
For the record, the only way in which you could run into this is by building dahdi-tools from the VoIP overlay. Please do not, ever, report bugs for overlay ebuilds on the main Gentoo tracker.
As you have now found out, overlay ebuilds are not subject to the same QA that tree ebuilds are.