if you're using --as-needed, DONT FILE BUGS IN BUGZILLA.
latexer what's our stance on the LDFLAGS --as-needed silliness?
latexer can we rudely close tickets of users using it that have problems? (:
SpanKY ??
SpanKY users are putting '--as-needed' into their LDFLAGS !?
gustavoz --as-needed? --ass-delivered!
SpanKY if a user was enough of a tool to put --as-needed into their LDFLAGS you can mark it INVALID

Unfortunately, i cannot post a benchmark. Apps seem to load a bit faster. And as long as they work, i will stick with them.Someone care to actually post some benchmarks? "Seems faster" could just be placebo.
Who are "people"?dirtyepic wrote:since some people can't listen.
if you're using --as-needed, DONT FILE BUGS IN BUGZILLA.
latexer what's our stance on the LDFLAGS --as-needed silliness?
latexer can we rudely close tickets of users using it that have problems? (:
SpanKY ??
SpanKY users are putting '--as-needed' into their LDFLAGS !?
gustavoz --as-needed? --ass-delivered!
SpanKY if a user was enough of a tool to put --as-needed into their LDFLAGS you can mark it INVALID
don't get me wrong, i'll experimenting with it too. but anything you break is your responsibility.
/lib/libpthread.so.0: undefined reference to `_dl_allocate_tls_init@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_dl_make_stack_executable@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `__libc_stack_end@GLIBC_2.1'
/lib/libpthread.so.0: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_dl_deallocate_tls@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_dl_allocate_tls@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_dl_get_tls_static_info@GLIBC_PRIVATE'
undefined reference to `_Unwind_DeleteException@GCC_3.0'
undefined reference to `_Unwind_Resume@GCC_3.0'
undefined reference to `_Unwind_RaiseException@GCC_3.0'
undefined reference to `_Unwind_GetRegionStart@GCC_3.0'
undefined reference to `_Unwind_GetDataRelBase@GCC_3.0'
undefined reference to `_Unwind_SetGR@GCC_3.0'
undefined reference to `_Unwind_GetLanguageSpecificData@GCC_3.0'
undefined reference to `_Unwind_Resume_or_Rethrow@GCC_3.3'
undefined reference to `_Unwind_GetIP@GCC_3.0'
undefined reference to `_Unwind_GetTextRelBase@GCC_3.0'
undefined reference to `_Unwind_SetIP@GCC_3.0'
/lib/libdl.so.2: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libdl.so.2: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
/lib/libdl.so.2: undefined reference to `_dl_rtld_di_serinfo@GLIBC_PRIVATE'

Thanks for explaining, i feel a bit responsible for it as It was my post that likely caused itdirtyepic wrote:sorry, that was pretty rude of me. i got a little testy sitting in #gentoo-bugs and watching five consecutive --as-needed bugs scroll by.
I am not yet brave anough to try thatdirtyepic wrote:just a heads up for any brave souls out there testing the latest binutils-2.16.90.0.1 that's hard masked in portage, the --as-needed flag is stripping more than it should, causing a fair number of builds to break with undefined references. earlier versions of binutils in portage are fine.
the bug is here: http://sources.redhat.com/bugzilla/show_bug.cgi?id=815

I guess i got such a breakage. I compiled glibc-2.3.5 with the binutils-2.16.90.0.1 and --as-needed and it failed. Compiled without --as-needed and only -Wl,-O1 and -Wl,--sort-common it compiled just fine, and it seems to work, no application has failed me yet(on the newer glibc).just a heads up for any brave souls out there testing the latest binutils-2.16.90.0.1 that's hard masked in portage, the --as-needed flag is stripping more than it should, causing a fair number of builds to break with undefined references. earlier versions of binutils in portage are fine.
Code: Select all
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
Nice idea.haven wrote:Is it worth compiling a list of packages that benefit from this vs packages that break with this ? And where would be the best place to do this ?
A simple script to exploit this list could be (excuse the simplicity as I'm not a coder):This just uses a flat file "/etc/portage/package_as_needed" to check for packages that work when compiled with "-Wl,--as-needed" and chooses the appropriate method.Code: Select all
#!/bin/bash source /etc/make.conf match=$(grep "^$1$" "/etc/portage/package_as_needed" ) if [[ "$match" = "$1" ]] then echo "emerging using -Wl,--as-needed" LDFLAGS="${LDFLAGS} -Wl,-O1 -Wl,--as-needed" /usr/bin/emerge $1 else echo "emerging using defaults" /usr/bin/emerge $1 fi exit 0
From what I read, those applications that have a plugin architecture are doomed to fail with this optimisation (i.e. apache) whilst many desktop apps that are fairly self contained can be optimised quite heavily.
NB the other LDFLAG optimisations came from http://forums.gentoo.org/viewtopic.php?t=67777
Code: Select all
LDFLAGS="${LDFLAGS} -Wl,-O1 -Wl,--as-needed -W1,--sort-common" /usr/bin/emerge $1

Code: Select all
LDFLAGS="-Wl,-O2"
LDFLAGS="${LDFLAGS} -Wl,--as-needed"
LDFLAGS="${LDFLAGS} -Wl,--sort-common"
LDFLAGS="${LDFLAGS} -Wl,--relax" Code: Select all
LDFLAGS="-Wl,-O2 -Wl,--sort-common -s -Wl,--strip-debug -Wl,--enable-new-dtags"
LDFLAGS="${LDFLAGS} -Wl,--as-needed"
LDFLAGS="${LDFLAGS} -Wl,--relax"you did not read anything. The first post clearly states a whole bunch of things that dont work.Lucacri wrote:(sorry for my bad english but I'm italian)
I read it but I can't find the answer!! I'm doing a emerge -e system, don't let me waste timeTell me if I need to stop it and reemerge without that ldflag!
Almost all the packages i use are gtk2 and not gtk1. Is there a problem with gtk1 packages in general which I should mention in the first post?Cadorna wrote:for system i don't use --as-needed, only for world packages, and I have too issues with gtk1 apps like xmms, just removed --as-needed for those packages and evertything is working great
I've installed a machine with dual boot for a client that wants to test linux, and I did it with a KDE enviroment almost, just a few apps that are not qt, like audacity (wxgtk), xmms (gtk1), gftp (with gtk2), gimp (gtk2), firefox(gtk2), and one or 2 more apps with gtk1 that i don't remember right now. Again "system" it's not compiled with --as-needed (i don't think it worthy), only world apps, and they compiled and worked great, except for the gtk1 apps, those didn't compile, jus unset --as-needed for those and compiled and are working great, so maybe to mention that (not saying that gtk1 apps won't compile, just let know that maybe users will have problems compiling them) would be very usefull.infirit wrote:Almost all the packages i use are gtk2 and not gtk1. Is there a problem with gtk1 packages in general which I should mention in the first post?
Code: Select all
Teutzz teutzz # emerge info
Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0, 2.6.11-morph6 i686)
=================================================================
System uname: 2.6.11-morph6 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.6.12
ccache version 2.4 [enabled]
dev-lang/python: 2.3.5
sys-apps/sandbox: 1.2.8
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils: 2.15.92.0.2-r8
sys-devel/libtool: 1.5.18
virtual/os-headers: 2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-tbird -pipe -fomit-frame-pointer -ftracer -fprefetch-loop-arrays -falign-functions=64 -momit-leaf-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/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-tbird -pipe -fomit-frame-pointer -ftracer -fprefetch-loop-arrays -falign-functions=64 -momit-leaf-frame-pointer -fvisibility-inlines-hidden"
DISTDIR="/home/teutz/Documents/sys/linux/sys/Gentoo/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.iasi.roedu.net/pub/mirrors/gentoo.org http://ftp.iasi.roedu.net/pub/mirrors/gentoo.org http://ftp.lug.ro/gentoo ftp://ftp.lug.ro/gentoo"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/teutz/temp/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/bmg-main /usr/local/overlays/bmg-main.alternative"
SYNC="rsync://rsync.ro.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X alsa avi bitmap-fonts cddb commercial dga divx4linux dlloader esd ffmpeg font-server gif gtk gtk2 hal imlib imlib2 ithreads jpeg kde kdeenablefinal kexec live mad mmx mmx2 mmxext mozilla mp3 mpeg ncurses nomalloccheck nomotif nptl nptlonly nvidia opengl pic png qt quicktime real sdl slang ssl tcpd theora tiff truetype truetype-fonts type1-fonts usb userlocales vcd win32codecs xanim xine xmms xprint xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc"
Unset: ASFLAGS, CTARGET, LINGUAS