Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LDFLAG --as-needed / Speeding up of GNOME or KDE
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 8, 9, 10, 11  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
infirit
l33t
l33t


Joined: 11 Jan 2003
Posts: 778
Location: Hoofddorp / The Netherlands

PostPosted: Mon Nov 14, 2005 10:03 pm    Post subject: Reply with quote

Grr, what's with these forums these days, I keep loosing my watched threads :evil:

Anyway, I will be updating the first post to include the packages from above and some of my own.
_________________
EASY TO INSTALL = Difficult to install, but instruction manual has pictures.
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
infirit
l33t
l33t


Joined: 11 Jan 2003
Posts: 778
Location: Hoofddorp / The Netherlands

PostPosted: Mon Nov 14, 2005 10:15 pm    Post subject: Reply with quote

Gergan Penkov wrote:
media-libs/imlib -Wl,-O1
gnome-base/orbit-0.5.17 -Wl,-O1
gnome-base/gnome-libs -Wl,-O1
Lats time i tried imlib and gnome-libs it worked fine with --as-meeded. The bad guy was orbit. Could you retry with a non --as-needed orbit?

The other have been added to the original post.

Thanks
_________________
EASY TO INSTALL = Difficult to install, but instruction manual has pictures.
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
infirit
l33t
l33t


Joined: 11 Jan 2003
Posts: 778
Location: Hoofddorp / The Netherlands

PostPosted: Mon Nov 14, 2005 10:21 pm    Post subject: Reply with quote

enderandrew wrote:
What packages is this safe for, or do most people use this for most things and only exclude the packages listed in the first thread?

I have it on by default and filter the packages from the original post. Whenever you see errors like undefined refference to *something* this is most likely caused by --as-needed.
_________________
EASY TO INSTALL = Difficult to install, but instruction manual has pictures.
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
Gergan Penkov
Veteran
Veteran


Joined: 17 Jul 2004
Posts: 1464
Location: das kleinste Kuhdorf Deutschlands :)

PostPosted: Tue Nov 15, 2005 1:04 am    Post subject: Reply with quote

Hi I'll try if they recompile them now, the problem with this is that some versions compile just fine and others don't, for example I see that you have thunderbird-1.0.2 in the list, but 1.5x are just fine with the flag. I could post my full package.ldflags if someone wants it, but it seems that everyone should try it on their own :))
imlib compiles but has problems with finding gtk1, so i'm not sure if it will function correctly after that.
_________________
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Back to top
View user's profile Send private message
alligator421
Apprentice
Apprentice


Joined: 30 Jul 2003
Posts: 191

PostPosted: Mon Dec 05, 2005 7:07 pm    Post subject: Reply with quote

Code:
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"


With the upgrade to gcc 3.4.4, I recompiled all my system and world packages.
linker had trouble with following packages that were not in the list :
Code:

kde-base/kdepim-3.5.0
app-misc/gfontview-0.5.0-r6
media-sound/id3v2-0.1.11
games-puzzle/codebreaker-1.2.1-r1
media-libs/netpbm-10.29

package media-libs/libpng-1.2.8-r1 is in the list but I had no problem compiling and linking media-libs/libpng-1.2.8
Back to top
View user's profile Send private message
Vla
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 135
Location: Somewhere in the middle

PostPosted: Wed Dec 07, 2005 2:01 pm    Post subject: Reply with quote

I have a problem compiling kdelibs-3.5.0 right now.
Quote:


/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: BFD 2.16.1 assertion fail /home/portage/portage/binutils-2.16.1-r1/work/binutils-2.16.1/bfd/elflink.c:2335
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
make[4]: *** [kde-config] Error 1
make[4]: Leaving directory `/home/portage/portage/kdelibs-3.5.0/work/kdelibs-3.5.0/kdecore'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/portage/portage/kdelibs-3.5.0/work/kdelibs-3.5.0/kdecore'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/portage/portage/kdelibs-3.5.0/work/kdelibs-3.5.0/kdecore'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/portage/portage/kdelibs-3.5.0/work/kdelibs-3.5.0'
make: *** [all] Error 2

This is shown in more lines than I can count.
Here's my info:

Code:
Portage 2.0.53 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r3, 2.6.14-nitro2 i686)
=================================================================
System uname: 2.6.14-nitro2 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.12.0_pre11
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.17
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-r1
sys-devel/libtool:   1.5.20-r1
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon-xp -fno-ident -fomit-frame-pointer -momit-leaf-frame-pointer "
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/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 -pipe -march=athlon-xp -fno-ident -fomit-frame-pointer -momit-leaf-frame-pointer  -fvisibility-inlines-hidden"
DISTDIR="/mnt/wintemp/distfiles"
FEATURES="autoconfig candy ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.gentoo.mesh-solutions.com/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ "
LC_ALL="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/portage"
PORTDIR="/home/portage2/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acpi alsa apm arts artswrappersuid audiofile avi bash-completion berkdb bitmap-fonts bzip2 cd cdb cdda cddb cdr ck-plus crypt css cups curl dbus divx4linux dlloader dvd dvdr dvdread eds emboss encode exif expat fam fat ffmpeg firefox flac foomaticdb ftp gdbm gif glut glx gmp gpg gpm gtk gtk2 hal idn imlib ithreads jpeg kde kdeenablefinal kdexdeltas lcms libg++ libwww linguas_de mad mikmod mmx mmx2 mng motif mozilla mp3 mpeg mplayer msn ncurses nptl nptlonly ntfs nvidia ogg oggvorbis opengl oss pam pcre pdflib perl pic png pthreads python qt quicktime readline real samba sdl sqlite sse ssl svga tcpd threads tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vorbis win32codecs x86 xine xml xml2 xv xvid xvidix zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG


Maybe I should do an emerge -e system before emerge -e world with the new cflags?
libpng failed, too, so i added it to portage.ldflags.
Quote:
Back to top
View user's profile Send private message
infirit
l33t
l33t


Joined: 11 Jan 2003
Posts: 778
Location: Hoofddorp / The Netherlands

PostPosted: Wed Dec 07, 2005 9:35 pm    Post subject: Reply with quote

Vla wrote:
I have a problem compiling kdelibs-3.5.0 right now.

Does it work without using --as-needed? To me this looks more like a gcc/binutils problem.
_________________
EASY TO INSTALL = Difficult to install, but instruction manual has pictures.
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
Vla
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 135
Location: Somewhere in the middle

PostPosted: Thu Dec 08, 2005 11:11 am    Post subject: Reply with quote

Kdelibs seems to compile only without --as-need.
By the way: libfam shows similar errors but does not failure anyway.
Thanks!

Editations in bold ;)
Back to top
View user's profile Send private message
Vla
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 135
Location: Somewhere in the middle

PostPosted: Thu Dec 08, 2005 12:28 pm    Post subject: Reply with quote

But what I do not understand why it uses a binutils in the portage tempdir and not the system one?
Quote:
home/portage/portage/binutils-2.16.1-r1/work/binutils-2.16.1/bfd/elflink.c:2335
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Sun Dec 11, 2005 1:15 am    Post subject: Reply with quote

media-video/avidemux-2.0.42-r1 fails silently. Compiles fine w/o --as-needed.
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Sun Dec 11, 2005 1:20 am    Post subject: Reply with quote

Vla wrote:
But what I do not understand why it uses a binutils in the portage tempdir and not the system one?

Quote:
home/portage/portage/binutils-2.16.1-r1/work/binutils-2.16.1/bfd/elflink.c:2335

Would be wierd if the package shipped it's own binutils, so I think it's just compiling something bfd related or something.
Back to top
View user's profile Send private message
Vla
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 135
Location: Somewhere in the middle

PostPosted: Mon Dec 12, 2005 2:53 pm    Post subject: Reply with quote

Somehing in my system was broken, because I was upgrading to gcc 3.4.4 also.
Purging gcc 3.3.4 after emerge -e system and deleting the binutils in the workdir fixed all my problems.
Everything compiled fine with --as-needed apart from the ebuilds I collected in this thread and put into packages.ldflags.
Thanks!

As example konqueror and konsole are linked against just 2 libs.
I don't know if it speeds up things that much, maybe...
Back to top
View user's profile Send private message
ktech
Guru
Guru


Joined: 12 Apr 2003
Posts: 340

PostPosted: Wed Jan 04, 2006 3:21 pm    Post subject: Reply with quote

I have compiled konsole with this in make.conf:

Code:
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-Bdirect"


Before recompiling, konsole was linking to 40 libraries.

Ater recompiling, konsole link to only 2 libraries. And it works ok, but I have done some measurements and it's not faster at startup. It's the same or perhaps even a bit slower (talking about miliseconds).

So I did this:

With --as-needed:

Code:
ktech@Evanescence ~ $ LD_DEBUG=statistics konsole -e sh -c exit
       888:
       888:     runtime linker statistics:
       888:       total startup time in dynamic loader: 197259203 clock cycles
       888:                 time needed for relocation: 182634607 clock cycles (92.5%)
       888:                      number of relocations: 22251
       888:           number of relocations from cache: 61833
       888:             number of relative relocations: 39642
       888:                time needed to load objects: 14283564 clock cycles (7.2%)
       888:
       888:     runtime linker statistics:
       888:                final number of relocations: 27449
       888:     final number of relocations from cache: 61879


So that numbers change between sucesive runs, because of the caches, and the like, but "total startup time in dynamic loader" seems to be greater than before. This has no sense, right?

So is this really having a speed-up or is it a placebo effect at all?

Thanks.
Back to top
View user's profile Send private message
Vla
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 135
Location: Somewhere in the middle

PostPosted: Wed Jan 04, 2006 6:10 pm    Post subject: Reply with quote

Without --as-needed but with -Bdirect and prelink my statistic looks like this:
Quote:
25773:
25773: runtime linker statistics:
25773: total startup time in dynamic loader: 8143103 clock cycles
25773: time needed for relocation: 2123209 clock cycles (26.0%)
25773: number of relocations: 0
25773: number of relocations from cache: 2734
25773: number of relative relocations: 0
25773: time needed to load objects: 5420772 clock cycles (66.5%)
25773:
25773: runtime linker statistics:
25773: final number of relocations: 277
25773: final number of relocations from cache: 2745


Tried compiling konsole with your LDFLAGS which gave me a broken binary with gcc 4.1 and patched glibc for -Bdirect.
Back to top
View user's profile Send private message
ktech
Guru
Guru


Joined: 12 Apr 2003
Posts: 340

PostPosted: Wed Jan 04, 2006 8:37 pm    Post subject: Reply with quote

hey man...

my numbers and yours don't have anything in common.

How strange... I wonder if there's something wrong. By the way, I'm using hidden symbol visibility...
Back to top
View user's profile Send private message
Varuna
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jun 2004
Posts: 97
Location: Connecticut, United States

PostPosted: Thu Jan 05, 2006 3:39 am    Post subject: Reply with quote

ktech wrote:
I have compiled konsole with this in make.conf:

Code:
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-Bdirect"


Before recompiling, konsole was linking to 40 libraries.

Ater recompiling, konsole link to only 2 libraries. And it works ok, but I have done some measurements and it's not faster at startup. It's the same or perhaps even a bit slower (talking about miliseconds).
I experimented with the same settings (O1, sort-common, Bdirect globally and enable-new-ldflags for kde stuff, which includes as-needed; full symbol visibility in kde stuff and inlines-hidden globally (except Qt which didn't compile with it); fno-enforce-eh-specs or whatever it's called and fno-ident with otherwise reasonable/non-bloating cflags; full prelinking; dma-enabled hard drive) a few days ago, just to see what would happen, and had the same uninspiring results. as-needed seemed to make revdep-rebuild take much longer than previously. Startup time didn't seem significantly affected by setting the Bdirect environmental variable or not. Some of these changes do seem to make the binaries smaller.
Back to top
View user's profile Send private message
ktech
Guru
Guru


Joined: 12 Apr 2003
Posts: 340

PostPosted: Thu Jan 05, 2006 3:43 am    Post subject: Reply with quote

So now I don't know what LDflags to use... Any of you knows of a good "benchmark" to test this combinations of LDflags?

I use this, even when I know it's a VERY bad proof:

Code:

ktech@Evanescence ~ $ time konsole -e sh -c exit

real    0m0.331s
user    0m0.172s
sys     0m0.052s
Back to top
View user's profile Send private message
ktech
Guru
Guru


Joined: 12 Apr 2003
Posts: 340

PostPosted: Thu Jan 05, 2006 5:23 pm    Post subject: Reply with quote

I have compiled amarok-svn with --as-needed and all works, but radio streaming. When I'm hearing radio streams, it pauses and freezes a lot. Recompiling without --as-needed makes it run well, so I think we can add it to the "not working" list.
Back to top
View user's profile Send private message
Gergan Penkov
Veteran
Veteran


Joined: 17 Jul 2004
Posts: 1464
Location: das kleinste Kuhdorf Deutschlands :)

PostPosted: Fri Jan 06, 2006 2:59 pm    Post subject: Reply with quote

Well I'm not sure if it will help much the kde users, because of some special ways in which kde loads some libraries and plugins, but with gnome I have real speed-up - ooffice-2.0 starts here in 5 sec (first time), system-monitor, gedit and so on just pop up, although the pc is athlonXP-2000+ :)
_________________
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Back to top
View user's profile Send private message
leloxias
n00b
n00b


Joined: 06 Nov 2005
Posts: 5

PostPosted: Sat Jan 07, 2006 10:49 pm    Post subject: Reply with quote

It seems that --as-needed breaks emerge --depclean.

Now, emerge --depclean wants to delete a lot of programs.

Is it possible or am I wrong ?
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Sat Jan 07, 2006 11:23 pm    Post subject: Reply with quote

Unless it has made python behave in a very peculiar way, I don't know how --as-needed would or could affect emerge's dep resolving.
I'm not very familiar with _exactly_ how emerge does it's magic, though, so I could be wrong.
You could try running regenworld and see if that changes anything.
Back to top
View user's profile Send private message
leloxias
n00b
n00b


Joined: 06 Nov 2005
Posts: 5

PostPosted: Wed Jan 11, 2006 11:05 am    Post subject: Reply with quote

fctk wrote:
i read this: https://forums.gentoo.org/viewtopic-t-280748.html and i installed smoked's script in /etc/portage/bashrc. then i created /etc/portage/package.ldflags and i put there the following line:
Code:
=sci-misc/boinc-4.72 -Wl,--no-as-needed

that won't work. the working line is:
Code:
sci-misc/boinc -Wl,--no-as-needed

but in this way i can't specify the version. is there a way to accomplish that?


Can anyone put this script on this topic please with the ldflags features ?

Thanks a lot
Back to top
View user's profile Send private message
infirit
l33t
l33t


Joined: 11 Jan 2003
Posts: 778
Location: Hoofddorp / The Netherlands

PostPosted: Wed Jan 11, 2006 12:32 pm    Post subject: Reply with quote

leloxias wrote:
Can anyone put this script on this topic please with the ldflags features ?

Thanks a lot

The script is linked in the section "per package LD/CFLAGS".
_________________
EASY TO INSTALL = Difficult to install, but instruction manual has pictures.
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 850
Location: PL

PostPosted: Tue Jan 24, 2006 8:19 am    Post subject: Reply with quote

Quote:
Before recompiling, konsole was linking to 40 libraries.
Ater recompiling, konsole link to only 2 libraries.
i did that as well.
actually it had no effect (but the ldflags were used in compilation)

why?
_________________
~amd64
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
ktech
Guru
Guru


Joined: 12 Apr 2003
Posts: 340

PostPosted: Tue Jan 24, 2006 8:21 am    Post subject: Reply with quote

yoshi314 wrote:
Quote:
Before recompiling, konsole was linking to 40 libraries.
Ater recompiling, konsole link to only 2 libraries.
i did that as well.

before - ~40libs
with your ldflags - ~20libs

ummm....why are my results different?


I don't know, but numbers are like that in a lot of kde apps. Konsole links to only 2 libraries and it works like a charm.

If you need some info, please tell me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2, 3 ... 8, 9, 10, 11  Next
Page 9 of 11

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum