Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 335944 - dev-libs/apr fails to build with /bin/sh != /bin/bash
Summary: dev-libs/apr fails to build with /bin/sh != /bin/bash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 14:19 UTC by Patrick Lauer
Modified: 2010-09-19 09:15 UTC (History)
4 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 Patrick Lauer gentoo-dev 2010-09-04 14:19:17 UTC
#  svn 
svn: symbol lookup error: /usr/lib64/libsvn_subr-1.so.0: undefined symbol: apr_month_snames

while rebuilding dev-vcs/subversion:

cd subversion/svnsync && /bin/sh /var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/libtool --tag=CC --silent --mode=link x86_64-pc-linux-gnu-gcc  -O2 -march=k8 -pipe -ggdb   -pthread     -Wl,-O1 -Wl,--as-needed    -L/usr/lib64 -L/usr/lib64/qt4   -L/usr/lib64  -rpath /usr/lib64 -o svnsync  main.o ../../subversion/libsvn_ra/libsvn_ra-1.la ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la /usr/lib64/libapr-1.la -lneon   
cd subversion/svnversion && /bin/sh /var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/libtool --tag=CC --silent --mode=link x86_64-pc-linux-gnu-gcc  -O2 -march=k8 -pipe -ggdb   -pthread     -Wl,-O1 -Wl,--as-needed    -L/usr/lib64 -L/usr/lib64/qt4   -L/usr/lib64  -rpath /usr/lib64 -o svnversion  main.o ../../subversion/libsvn_wc/libsvn_wc-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la /usr/lib64/libaprutil-1.la /usr/lib64/libapr-1.la 
main.o: In function `main':
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:138: undefined reference to `apr_allocator_create'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:141: undefined reference to `apr_allocator_max_free_set'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:144: undefined reference to `apr_allocator_owner_set'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:170: undefined reference to `apr_getopt_long'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:225: undefined reference to `apr_pool_destroy'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:234: undefined reference to `apr_pool_destroy'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/svnversion/main.c:257: undefined reference to `apr_pool_destroy'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `apr_file_flush'
../../subversion/libsvn_wc/.libs/libsvn_wc-1.so: undefined reference to `apr_hash_get'
[snip]

/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `apr_poll'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `apr_time_exp_lt'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `apr_dir_make_recursive'
/var/tmp/portage/dev-vcs/subversion-1.6.12/work/subversion-1.6.12/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `apr_xlate_open'
collect2: ld returned 1 exit status
make: *** [subversion/svnsync/svnsync] Error 1
emake failed
 * ERROR: dev-vcs/subversion-1.6.12 failed:

Tried rebuilding apr, apr-util. No change. 

Portage 2.2_rc75 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.35-gentoo-r5-x86_64-AMD_Phenom-tm-_9950_Quad-Core_Processor-with-gentoo-2.0.1
Timestamp of tree: Unknown
ccache version 2.4 [disabled]
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/portage /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=k8 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg collision-protect distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/home/pal/code/gentoo-x86/"
PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage/layman/qting-edge /home/pal/code/kde"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa amd64 apache2 berkdb bluetooth branding bzip2 cairo cdio cdparanoia cdr cli consolekit cracklib crypt cups curl cxx dbus device-mapper dga directfb dri dts dv dvd dvdr emboss encode exif extensions extras fam firefox flac fortran ftp fts3 gd gdbm ggi gif gnutls gpm iconv ipv6 ithreads jack jpeg jpeg2k kde kpathsea ladspa lcms libnotify lzo mad md5sum mikmod mmx mmxext mng modules mp2 mp3 mp4 mpeg mudflap multilib musepack nas ncurses networkmanager nls nptl nptlonly nsplugin objc ogg openal opengl openmp pam pango pcre pdf perl png pnm policykit postfix ppds pppd python qemu qt3 qt3support qt4 quicktime rar readline reflection rtc sasl sdl secure-delete semantic-desktop session slang speex spell spl sqlite sse sse2 ssl startup-notification svg sysfs tcpd tga theora threads tiff tk truetype udev unicode usb v4l2 vorbis webkit x264 xcb xml xmp xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vga radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Ross Smith 2010-09-04 14:24:30 UTC
Hello, thank you for taking the time to fill out this bug report.  I think we will need some more info to get working on this.   could you give us some info about anything that changed about your system near the same time that you started seeing this issue?   Likewise,  have you tried using lafilefixer or revdep-rebuild?
Comment 2 Patrick Lauer gentoo-dev 2010-09-04 14:32:17 UTC
This seems to be related to #317527 as I had non-bash /bin/sh set.
Switching to /bin/sh == /bin/bash fixes it, which is pretty amazing fail
Comment 3 Patrick Lauer gentoo-dev 2010-09-04 14:36:05 UTC
(In reply to comment #2)
> Switching to /bin/sh == /bin/bash fixes it, which is pretty amazing fail
> 
To be more precise: emerge -1 apr apr-util subversion "fixed" it
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2010-09-04 16:02:51 UTC
I can't find anywhere in the bug if you are using supported shell (bash, or dash) or not. Pretty much NEEDINFO until that's provided, and INVALID if it's something else than those two.
Comment 5 Xake 2010-09-07 21:02:02 UTC
dash messes upp dev-libs/apr and its internal linking, to be honest if you build apr with dash you will end up with a libapr-1.so that has not one single symbol.
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2010-09-08 04:59:11 UTC
only /bin/bash is supported by the apache team.
Comment 7 Xake 2010-09-08 07:38:26 UTC
Please, then export CONFIG_SHELL="/bin/bash" in src_configure before you run econf.

The problem seems to be that when ./configure is run under bash (which emerge seems to do) it for some reason chooses SHELL=/bin/sh, while if ./configure is run under dash it chooses SHELL=/bin/bash (which works).
By setting CONFIG_SHELL="/bin/bash" you force the buildsystem to choose the shell you support.
Comment 8 Patrick Lauer gentoo-dev 2010-09-08 08:28:55 UTC
Err, what. You must not expect /bin/sh to be bash. That's plain wrong.

As xake suggested ... force it to use /bin/bash then, _if_ you need bash. 
Comment 9 Xake 2010-09-08 10:14:18 UTC
You could also emulate what buildconf (their bootstrap-script does):
First: remove all your seds, then change your:

eautoreconf
elibtoolize (why you run this two times to begin with?)

and change it too:

elibtoolize
sed s:top_builddir:apr_builddir:g -i build/libtool.m4
eautoheader
eautoconf

This is an example, actual implementation should need to be different.

As that seems to be how the system libtool should be used with apr (it will not use any other stage libtool unless you pass things to ./configure).
Comment 10 Benedikt Böhm (RETIRED) gentoo-dev 2010-09-19 09:03:35 UTC
(In reply to comment #7)
> Please, then export CONFIG_SHELL="/bin/bash" in src_configure before you run
> econf.

done

(In reply to comment #8)
> You must not expect /bin/sh to be bash.

i cannot find where that is documented.

(In reply to comment #9)
> As that seems to be how the system libtool should be used with apr

please discuss apache/apr libtool issues in bug 204485. i won't touch that shit now ...
Comment 11 Patrick Lauer gentoo-dev 2010-09-19 09:15:37 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > You must not expect /bin/sh to be bash.
> 
> i cannot find where that is documented.

That is just common sense. The only thing you can really expect from /bin/sh is the posix sh dialect. Any features beyond that (like bash arrays) might work by accident, but are not guaranteed. If you wish to use such extensions you should always call that shell directly and not hope for the best.

As an analogy - compiling C with a C++ compiler. Might work, but it's not a good idea.