[PATCH] yp_get_default_domain fix for Linux
#1
Thumbs Up 
Hi,

I've recently tried to compile xbmc-9.04 on my gentoo system only to discover, that it failed when linking the final binary with the following error:

g++ -O2 -O2 -g -D_DEBUG -Wall -g -D_DEBUG -Wall -o xbmc.bin -Wl,--whole-archive guilib/guilib.a guilib/common/gui_common.a guilib/tinyXML/tinyxml.a xbmc/xbmc.a xbmc/cdrip/cdrip.a xbmc/cores/cores.a xbmc/cores/DllLoader/dllloader.a xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/util/exports_utils.a xbmc/cores/dvdplayer/DVDPlayer.a xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.a xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.a xbmc/cores/dvdplayer/DVDCodecs/Overlay/Overlay.a xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxers.a xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitles.a xbmc/cores/paplayer/paplayer.a xbmc/cores/AudioRenderers/audiorenderers.a xbmc/cores/VideoRenderers/VideoRenderer.a xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a xbmc/cores/ExternalPlayer/ExternalPlayer.a xbmc/FileSystem/filesystem.a xbmc/FileSystem/MusicDatabaseDirectory/musicdatabasedirectory.a xbmc/FileSystem/VideoDatabaseDirectory/videodatabasedirectory.a xbmc/karaoke/karaoke.a xbmc/lib/libcmyth/libcmyth.a xbmc/lib/libhts/libhts.a xbmc/lib/libPython/python.a xbmc/lib/libPython/xbmcmodule/xbmcmodule.a xbmc/lib/libRTMP/librtmp.a xbmc/lib/libscrobbler/scrobbler.a xbmc/lib/libRTV/librtv-i486-linux.a xbmc/lib/libshout/libshout-i486-linux.a xbmc/lib/libUPnP/libupnp-i486-linux.a xbmc/lib/libXBMS/libxbms-i486-linux.a xbmc/lib/libXDAAP/libxdaap-i486-linux.a xbmc/lib/libGoAhead/libGoAhead-i486-linux.a xbmc/lib/sqLite/sqllite.a xbmc/lib/UnrarXLib/UnrarXLib.a xbmc/linux/linux.a xbmc/screensavers/screensaver.a xbmc/settings/settings.a xbmc/utils/utils.a xbmc/visualizations/visualization.a xbmc/xbox/xbox.a xbmc/lib/libsmb/libsmbclient-i486-linux.a -Wl,--no-whole-archive -lXrandr -lavahi-client -lavahi-common -lfaac -lpulse -lhal-storage -ldbus-1 -lcurl -lXinerama -lXmu -lXt -ljasper -lenca -lresolv -ldl -lSDL_mixer -lSDL_image -lSDL -lcdio -llzo2 -lpcre -ljpeg -lpng12 -lrt -lasound -lmysqlclient -lsqlite3 -lfribidi -lbz2 -lfontconfig -lfreetype -lvorbis -logg -lmad -lGLU -lGLEW -lGL -rdynamic
xbmc/lib/libsmb/libsmbclient-i486-linux.a(access.o): In function `string_match':
access.cSad.text+0x5c7): undefined reference to `yp_get_default_domain'


After some investigation it turned out, that the yp_get_default_domain function is present in the libnsl library instead of libc. I have written a patch for the configure.in which adds the checks for this function and fixes this issue:

--- a/configure.in 2009-04-19 08:00:34.000000000 +0200
+++ b/configure.in 2009-05-28 21:52:06.000000000 +0200
@@ -269,6 +269,10 @@
AC_MSG_ERROR($missing_library))
fi

+# Need to link with -lnsl if it contains yp_get_default_domain
+AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
+AC_CHECK_FUNCS(yp_get_default_domain)
+
# PulseAudio
if test "$host_vendor" = "apple" ; then
use_pulse="no"


Please integrate it into the source if you find it useful.
Reply
#2
Mind filing a new ticket at http://trac.xbmc.org for this issue? Thanks.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
You doing something funky on gentoo? I can't reproduce...
Reply
#4
althekiller Wrote:You doing something funky on gentoo? I can't reproduce...

I run a ~x86 system if you consider this funky Wink. My glibc version is 2.10.1, gcc-4.3.3 and I use paludis. Unfortunately I don't have direct access to my system this week so I will post exact details when I get home. I am building XBMC from the 9.04 tarball on sourceforge.
Reply
#5
Try with the 9.04.1-repack tarball when you get back at the system.
Reply
#6
althekiller Wrote:Try with the 9.04.1-repack tarball when you get back at the system.

The problem persists with the repack tarball. A bit more info about my system:

Portage 2.1.6.13 (default/linux/x86/2008.0/desktop, gcc-4.3.3, glibc-2.10.1-r0, 2.6.29-gentoo-r4-ix i686)
=================================================================
System uname: Linux-2.6.29-gentoo-r4-ix-i686-Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 10 Jun 2009 20:15:01 +0000
app-shells/bash: 4.0_p24
dev-lang/python: 2.4.4-r13, 2.5.4-r2, 2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake: 2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc: 0.4.3-r3
sys-apps/sandbox: 2.0
sys-devel/autoconf: 2.13, 2.63-r1
sys-devel/automake: 1.5, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils: 2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool: 2.2.6a
virtual/os-headers: 2.6.29

Use flags (paludis format):

*/* sse sse2 mmx
*/* xattr caps -alsa -midi -acl
*/* -ldap -fam avahi samba -esd pulseaudio -tcpd
*/* -openmp minimal
*/* -gnome -kde
*/* visibility -examples
*/* -crypt -cups -consolekit

# This pulls in consolekit and we don't want that
x11-apps/xinit -hal

# Needed for gtk+ ->libmp4v2 -> xbmc dependency
x11-libs/cairo X

# It's always good to have debug
*/* debug

sys-apps/pciutils -zlib
sys-apps/dbus X

*/* flac

# These two packages need alsa to work
media-libs/libsdl X pulseaudio alsa
media-tv/xbmc alsa

media-libs/smpeg X

# Needed for alsa-utils to build
# debug enabled needed for xbmc not to crash -> INVESTIGATE
media-libs/alsa-lib midi debug

media-sound/pulseaudio X alsa -bluetooth

# libmikmod doesn't support Pulseaudio
media-libs/libmikmod alsa

# We don't want everything to link with xorg
*/* -X -cairo -qt -qt3 -qt4 -gtk xinerama xcb

# Python and perl are for wusses Wink
*/* -python -perl

# We don't give a f***k about SWPATs
*/* idea

# No spelling on a HTPC needed
*/* -spell

# What for ?
*/* -cracklib -sha512

*/* libffi

*/* LINGUAS: -* pl
*/* VIDEO_CARDS: -* intel
*/* INPUT_DEVICES: -* evdev
Reply
#7
Created a Trac ticket #6802.
Reply
#8
i have got the same problem and the patch solve it.
i use the svn version of xbmc (revision 21383) on a gentoo 64bits with nomultilib profile and gcc 4.4.0
Reply

Logout Mark Read Team Forum Stats Members Help
[PATCH] yp_get_default_domain fix for Linux0