This is what the error msg looks like: * Apache2 has detected a syntax error in your configuration files: /usr/sbin/apache2: symbol lookup error: /usr/lib/libaprutil-0.so.0: undefined symbol: gdbm_errno Just re-emerging apr and apr-util without as-needed wasn't enough. I had to do the same with apache. Portage 2.1_pre7-r3 (default-linux/x86/2005.1, gcc-3.4.6, glibc-2.3.5-r3, 2.6.15-gentoo-r7 i686) ================================================================= System uname: 2.6.15-gentoo-r7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.12.0_pre16 dev-lang/python: 2.3.5, 2.4.2-r1 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-mtune=pentium4 -march=pentium4 -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-mtune=pentium4 -march=pentium4 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--alphabetical" FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict" GENTOO_MIRRORS="http://ftp.du.se/pub/os/gentoo http://trumpetti.atm.tut.fi/gentoo/ http://ds.thn.htu.se/linux/gentoo http://mirror.pudas.net/gentoo http://mirror.uni-c.dk/pub/gentoo/" LC_ALL="en_GB.UTF-8" LDFLAGS="-Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/gentoo-webapps-overlay/experimental /usr/local/gentoo-webapps-overlay/production-ready /usr/local/gentoo-general-overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 7zip X a52 acpi alsa apm avi bcmath berkdb bitmap-fonts bzlib cdr crypt cups dri dvd dvdr eds emboss encode fam ffmpeg flac foomaticdb fortran ftp gdbm gif gnome gnutls gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg jpeg2k kde libg++ libwww lzo mad mikmod mmx motif mp3 mpeg ncurses network nls nptl nptlonly ogg oggvorbis opengl oss pam pdflib perl png pppd python qt quicktime readline samba sdl spell sse sse2 ssl tcpd theora truetype truetype-fonts type1-fonts udev unicode vorbis xinerama xml xml2 xmms xv zlib elibc_glibc kernel_linux userland_GNU" Unset: ASFLAGS, CTARGET, LANG, LINGUAS
Need to look into this at some point. Attaching the URL that might help fix it.
same here.
Apache and apr-util rebuild and then start fine with the gdbm USE flag turned off but with LDFLAGS="-Wl,--as-needed".
(In reply to comment #3) > Apache and apr-util rebuild and then start fine with the gdbm USE flag turned > off but with LDFLAGS="-Wl,--as-needed". OK, so it only breaks when you emerge dev-libs/apr-util with USE="gdbm" and --as-needed?
no jacub, i tried to compiled without as-needed apr and aprutils, and apache with that flag. fails. only apache must filter it (or better...fix the linking).
The numerous unresolved symbols in libaprutil-0.so are easy to fix (i will attach a patch). It is a required step toward building apache with --as-needed, since this flag (with recent binutils) prevents linking against an incomplete library. But then there is a much more serious issue: none of the apache modules are linked to any of the libs they use. They instead rely on apache2 providing all the symbols they need. Usually, apache2 is linked to all the libraries used by at least one module, and loading works fine. But if apache is built with --as-needed, some of this libs (the ones apache2 doesn't directly use - libcrypto, libssl and libz here) are dropped, and you get unresolved symbols errors at runtime, when some of the modules are loaded. Fixing that would be, imho, a rather tedious work, for a very minor benefit, and thus filter-ldflags has my vote for this one.
Created attachment 86390 [details, diff] files/apr-util-0.9.12-as-needed.patch
Created attachment 86391 [details, diff] apr-util-0.9.12-ebuild.patch
--as-needed filtered in apache, apr, and apr-util closing.
filtered?? please CC diego and ask him. he told: never filter that linking flag. this is not a solution, this is a bypass.
(In reply to comment #10) > filtered?? please CC diego and ask him. > he told: never filter that linking flag. > > this is not a solution, this is a bypass. Did you really read Comment #6 ?
sure. --as-needed fix is always boring and long, as comment #6 complains.
If deigo (or someone else) wants to figure out all the intradependencies of apache, apr, apr-util, and every single apache module in the tree, and provide patches to make it all work nicely with --as-needed, then I will apply those patches. Right now, --as-needed is a flag in the minority and the effort to make apache work with it is more effort then it is worth. Read again: apache does not link against all the libraries it uses - it relies on apr and/or apr-util exporting many of the symbols, even though apr and apr-util may not use those libraries. Modules to apache have the same relationship to apache and apr and apr-util. It's rather complex. apr and apr-util used to be bundled with apache itself, only recently has it been able to be seperated out. There is still lots of intradependence and linking that needs to be cleaned up.
this is not FIXED, CCing Flameeyes. Please leave the filtering in place until it is correctly fixed.
later versions >=net-www/apache-2.2.0 are fixed
The filter-flags command still exists in apache-tools -> I assume it was just forgotten to be removed?
it is also present in apache-2.eclass line 452, is there a problem with it?