Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 140255 - app-mobilephone/gammu-1.07.00 fails with --as-needed
Summary: app-mobilephone/gammu-1.07.00 fails with --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2006-07-13 09:51 UTC by Matthias Schwarzott
Modified: 2006-07-13 14:50 UTC (History)
3 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 Matthias Schwarzott gentoo-dev 2006-07-13 09:51:37 UTC
app-mobilephone/gammu-1.07.00 fails to compile with LDFLAGS="-Wl,--as-needed"

Linking gammu-shared
./common/libGammu.so: undefined reference to `sdp_uuid_to_proto'
./common/libGammu.so: undefined reference to `hci_read_remote_name'
./common/libGammu.so: undefined reference to `sdp_close'
./common/libGammu.so: undefined reference to `sdp_general_inquiry'
./common/libGammu.so: undefined reference to `sdp_list_append'
./common/libGammu.so: undefined reference to `hci_open_dev'
./common/libGammu.so: undefined reference to `sdp_get_access_protos'
./common/libGammu.so: undefined reference to `sin'
./common/libGammu.so: undefined reference to `sdp_data_get'
./common/libGammu.so: undefined reference to `sdp_record_free'
./common/libGammu.so: undefined reference to `sdp_uuid16_create'
./common/libGammu.so: undefined reference to `sdp_data_free'
./common/libGammu.so: undefined reference to `sdp_get_group_id'
./common/libGammu.so: undefined reference to `hci_devinfo'
./common/libGammu.so: undefined reference to `ba2str'
./common/libGammu.so: undefined reference to `sdp_service_search_attr_req'
./common/libGammu.so: undefined reference to `sdp_list_free'
./common/libGammu.so: undefined reference to `sdp_connect'
./common/libGammu.so: undefined reference to `str2ba'
collect2: ld gab 1 als Ende-Status zur
Comment 1 Matthias Schwarzott gentoo-dev 2006-07-13 09:51:37 UTC
app-mobilephone/gammu-1.07.00 fails to compile with LDFLAGS="-Wl,--as-needed"

Linking gammu-shared
./common/libGammu.so: undefined reference to `sdp_uuid_to_proto'
./common/libGammu.so: undefined reference to `hci_read_remote_name'
./common/libGammu.so: undefined reference to `sdp_close'
./common/libGammu.so: undefined reference to `sdp_general_inquiry'
./common/libGammu.so: undefined reference to `sdp_list_append'
./common/libGammu.so: undefined reference to `hci_open_dev'
./common/libGammu.so: undefined reference to `sdp_get_access_protos'
./common/libGammu.so: undefined reference to `sin'
./common/libGammu.so: undefined reference to `sdp_data_get'
./common/libGammu.so: undefined reference to `sdp_record_free'
./common/libGammu.so: undefined reference to `sdp_uuid16_create'
./common/libGammu.so: undefined reference to `sdp_data_free'
./common/libGammu.so: undefined reference to `sdp_get_group_id'
./common/libGammu.so: undefined reference to `hci_devinfo'
./common/libGammu.so: undefined reference to `ba2str'
./common/libGammu.so: undefined reference to `sdp_service_search_attr_req'
./common/libGammu.so: undefined reference to `sdp_list_free'
./common/libGammu.so: undefined reference to `sdp_connect'
./common/libGammu.so: undefined reference to `str2ba'
collect2: ld gab 1 als Ende-Status zurück
make: *** [gammu/gammu-shared] Fehler 1

!!! ERROR: app-mobilephone/gammu-1.07.00 failed.
Call stack:
  ebuild.sh, line 1545:   Called dyn_compile
  ebuild.sh, line 940:   Called src_compile
  gammu-1.07.00.ebuild, line 43:   Called die

!!! make failed
!!! If you need support, post the topmost build error, and the call stack if relevant.


# emerge --info
Portage 2.1.1_pre2-r8 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-gentoo-r1 i686)
=================================================================
                       System Settings
=================================================================
System uname: 2.6.17-gentoo-r1 i686 AMD Athlon(tm) XP 3000+
Gentoo Base System version 1.12.1
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r2
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-detect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms sign strict"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/matze/gentoo/overlays/sci /home/matze/gentoo/overlays/de /home/matze/gentoo/overlays/zzam"
SYNC="cvs://zzam@cvs.gentoo.org:/var/cvsroot"
USE="x86 3dnow 3dnowext X a52 aac acl alsa apache2 apm artswrappersuid audacious avi berkdb bitmap-fonts bluetooth bzip2 cap caps cddb cdparanoia cli crypt cups dbus dlloader doc dri dts dvb dvd dvdr eds emboss encode fbcon ffmpeg font-server foomaticdb fortran fuse gcj gdbm gif gimpprint glut gpm gstreamer gtk gtk2 hal imap imlib ipv6 isdnlog java jpeg jpeg2k kde kdexdeltas libg++ libwww lirc logitech-mouse mad mikmod mmx mmxext mng motif mp3 mpeg mplayer musicbrainz mysql ncurses nls nogecko-sdk nptl nptlonly nvram ogg opengl oss pam pcre pdf pdflib perl png ppds pppd python qt qt3 qt4 quotes readline reflection samba session sms sndfile softmmu spell spl sqlite sse ssl svg taglib tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vdr visualization vorbis win32codecs wma wmf xinerama xml xorg xrandr xslt xv zlib zvbi elibc_glibc input_devices_mouse input_devices_keyboard kernel_linux linguas_de lirc_devices_all userland_GNU video_cards_v4l video_cards_vesa video_cards_vbdev video_cards_nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Matthias Schwarzott gentoo-dev 2006-07-13 09:58:05 UTC
This bug can be solved by changing the existing as-needed patch (gammu-1.07.00-as-needed.patch):

It is needed to move the $(LDLIBS) from the beginning of line 18 to its end.


Btw. Deleting -Wall from the Makefiles will decrease output by 1000th of warning-lines when using gcc-4.1.1.
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2006-07-13 13:51:23 UTC
I'm confused. You say I need to modify line 18 of the as-needed.patch but your errors are referring to "Linking gammu-shared" command, which is at line 27.
The line 27 cannot be wrong since the only option after the libraries is the -o outfile (not something that would break linkage with --as-needed).

Btw, I did build it successfully using LDFLAGS=-Wl,-O1,--as-needed and gcc-3.4.6, so I guess it fails only on gcc-4.1?
Comment 4 Matthias Schwarzott gentoo-dev 2006-07-13 14:03:28 UTC
I am trying to emerge gammu with these use-flags USE="bluetooth -debug -irda -mysql"

The error message clearly states that ./common/libGammu.so is linked wrong (more precise: is not linked with -lbluetooth but using its functions)

But as a library is allowed to have undefined symbols the error occurs when linking against this lib.

moving the LDLIBS to the end of the line corrects the linking order (the to be linked object files before the referenced libs).

At least for final linking this order is the only allowed - seems to work the same way when linking shared objects.
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2006-07-13 14:33:08 UTC
I identified failing makefile command by the "Linking gammu-shared" line on top of the captured output (please notice the echos above every change made by as-needed.patch). If the failing make command were the one modified at the line 18 of the patch, it would have been "Linking libGammu.so.0.0", but I reckon you made a mistake when you copy-pasted the output.

Anyway, I've fixed it in cvs. 
It still builds successfully on my gcc (yes, first I've set the USE flags to match yours).
Comment 6 Matthias Schwarzott gentoo-dev 2006-07-13 14:50:38 UTC
That is the thing I mean which makes it complicate.

The lib is linked wrong, but the error does not show here.


It first shows when linking something against the built lib.