Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Are we missing some easy optimizations (LDFLAGS)?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Wed Dec 29, 2004 5:06 am    Post subject: Reply with quote

I noticed a substantial reduction in startup time for firefox using LDFLAGS="-Wl,-O1"

I tried LDFLAGS="-Wl,-O1,-Wl,--enable-new-dtags" and no programs compile. The error is
Code:
checking for C compiler default output... configure: error: C compiler cannot create executables

This is with gcc-3.4.3
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Wed Dec 29, 2004 8:01 am    Post subject: Reply with quote

Ok. All seems to have gone well in my chrooted install. Now to install Grub 8)
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
placeholder
Advocate
Advocate


Joined: 07 Feb 2004
Posts: 2500

PostPosted: Wed Dec 29, 2004 8:47 am    Post subject: Reply with quote

I have been using these flags since the start of this thread and I have not any problems with my programs. :D
Back to top
View user's profile Send private message
growse
Apprentice
Apprentice


Joined: 24 Jan 2003
Posts: 154
Location: Sunny UK

PostPosted: Wed Dec 29, 2004 6:25 pm    Post subject: Reply with quote

Just to check, if i do an emerge -e world, that includes the system packages as well? i'm trying this on my server.
_________________
Getting there....
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Wed Dec 29, 2004 7:28 pm    Post subject: Reply with quote

growse wrote:
Just to check, if i do an emerge -e world, that includes the system packages as well? i'm trying this on my server.


yep. world encompasses every package on your computer.
Back to top
View user's profile Send private message
jrw6
n00b
n00b


Joined: 23 Nov 2004
Posts: 1

PostPosted: Sat Jan 01, 2005 10:07 pm    Post subject: Reply with quote

I added the following to my /etc/make.conf:
Code:
LDFLAGS="-Wl,-O1"

then I started "emerge -e world". I've got to the following error while compiling gnome-vfs, which I can't figure out or solve:
Code:
/bin/sh ../libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -pthread -DORBIT2=1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/libxml2       -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    -DORBIT2=1 -pthread -I/usr/include/libbonobo-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0   -DXDG_PREFIX=_gnome_vfs_xdg -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DG_DISABLE_DEPRECATED -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" -DPREFIX=\"/usr\" -DGNOMEVFS_LOCALEDIR=\"/usr/share/locale\" -DSYSCONFDIR=\"/etc\" -DG_LOG_DOMAIN=\"libgnomevfs\"     -O2 -march=athlon-xp -fomit-frame-pointer -c -o gnome-vfs-inet-connection.lo `test -f 'gnome-vfs-inet-connection.c' || echo './'`gnome-vfs-inet-connection.c
In file included from /usr/include/libbonobo-2.0/bonobo/bonobo-object.h:17,
                 from /usr/include/libbonobo-2.0/bonobo/bonobo-types.h:16,
                 from /usr/include/libbonobo-2.0/libbonobo.h:18,
                 from gnome-vfs-daemon-method.c:24:
/usr/include/libbonobo-2.0/bonobo/Bonobo.h:6334: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.

then a little later:
Code:
 i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -pthread -DORBIT2=1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DORBIT2=1 -pthread -I/usr/include/libbonobo-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0 -DXDG_PREFIX=_gnome_vfs_xdg -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DG_DISABLE_DEPRECATED -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" -DPREFIX=\"/usr\" -DGNOMEVFS_LOCALEDIR=\"/usr/share/locale\" -DSYSCONFDIR=\"/etc\" -DG_LOG_DOMAIN=\"libgnomevfs\" -O2 -march=athlon-xp -fomit-frame-pointer -c gnome-vfs-init.c -MT gnome-vfs-init.lo -MD -MP -MF .deps/gnome-vfs-init.TPlo  -fPIC -DPIC -o .libs/gnome-vfs-init.o
In file included from /usr/include/libbonobo-2.0/bonobo/bonobo-object.h:17,
                 from /usr/include/libbonobo-2.0/bonobo/bonobo-types.h:16,
                 from /usr/include/libbonobo-2.0/libbonobo.h:18,
                 from gnome-vfs-client.c:3:
/usr/include/libbonobo-2.0/bonobo/Bonobo.h:6334: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
In file included from /usr/include/libbonobo-2.0/bonobo/bonobo-object.h:17,
                 from gnome-vfs-client.h:4,
                 from gnome-vfs-init.c:31:
/usr/include/libbonobo-2.0/bonobo/Bonobo.h:6334: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make[3]: *** [gnome-vfs-cancellation.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [gnome-vfs-client.lo] Error 1
make[3]: *** [gnome-vfs-init.lo] Error 1
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/gnome-vfs-2.8.3-r1/work/gnome-vfs-2.8.3/libgnomevfs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gnome-vfs-2.8.3-r1/work/gnome-vfs-2.8.3'
make: *** [all] Error 2


Anyone know how to solve this?

edit: I re-emeged libbonobo, and that solved this. Sadly doing so destroyed my progress on "emerge -e world" so I have to start it again now.
Back to top
View user's profile Send private message
suede
n00b
n00b


Joined: 19 Jan 2004
Posts: 17

PostPosted: Sun Jan 02, 2005 3:44 am    Post subject: Reply with quote

OK, one last time..

is it -Wl (small L)
or -W1 (as in half-way between zero and two)

I've just read the entire thread and half the posters have used l and the other half used 1!
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Sun Jan 02, 2005 4:10 am    Post subject: Reply with quote

suede wrote:
OK, one last time..

is it -Wl (small L)
or -W1 (as in half-way between zero and two)

I've just read the entire thread and half the posters have used l and the other half used 1!


Well if you tried it with a 1, it would spit out an error saying its not a valid flag. If you tried it with a zero it would also spit out and error and not compile.

Its:

"(Minus)(Capital W)(Lowercase L)(comma)(Minus)(Capital O)(Number 1)"

Or just cp this into make.conf:
Code:

LDFLAGS="-Wl,-O1"
Back to top
View user's profile Send private message
charlieg
Advocate
Advocate


Joined: 30 Jul 2002
Posts: 2149
Location: Manchester UK

PostPosted: Sun Jan 02, 2005 10:23 am    Post subject: Reply with quote

Well, after trying this, something has gone kaboom on my system. I can no longer compile anything, at all. It complains that, essentially, gcc can not compile anything. Switching to an older version of gcc does not help either.
_________________
Want Free games?
Free Gamer - open source games list & commentary

Open source web-enabled rich UI platform: Vexi
Back to top
View user's profile Send private message
planetsheinker
Guru
Guru


Joined: 26 Feb 2004
Posts: 403
Location: Israel

PostPosted: Sun Jan 02, 2005 4:21 pm    Post subject: Reply with quote

Added this LDFLAGS="-Wl,-O1" to /etc/make.conf
and recomiled Thunderbird.
Before it took 7-10 sec to start and now it took 7 sec to start for the first time and 3!!!!! sec to start any time after that, I guess it takes a long time to cashe the binary.
This is great, going to do an "emerge -e system", and post the results when it's done:-)
Back to top
View user's profile Send private message
irf2003
Veteran
Veteran


Joined: 10 Sep 2003
Posts: 1078

PostPosted: Sun Jan 02, 2005 5:22 pm    Post subject: Reply with quote

Pwnz3r wrote:
I have been using these flags since the start of this thread and I have not any problems with my programs. :D

@Pwnz3r,
just for the records, could you be more specific as to what loader flags are being referred to?
TIA
happy gentooing
Back to top
View user's profile Send private message
planetsheinker
Guru
Guru


Joined: 26 Feb 2004
Posts: 403
Location: Israel

PostPosted: Mon Jan 03, 2005 3:59 pm    Post subject: Reply with quote

planetsheinker wrote:
Added this LDFLAGS="-Wl,-O1" to /etc/make.conf
and recomiled Thunderbird.
Before it took 7-10 sec to start and now it took 7 sec to start for the first time and 3!!!!! sec to start any time after that, I guess it takes a long time to cashe the binary.
This is great, going to do an "emerge -e system", and post the results when it's done:-)

Replayng to myself :-)
"emerge -e system" spited some error, but just as I was going to post it (e.g copy/paste), the power whent down :-(
Is there some log file that the error might have been loged?
Back to top
View user's profile Send private message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Mon Jan 03, 2005 6:14 pm    Post subject: Reply with quote

I feel compelled to reply, since I started this topic.

To those having problems (charlieg and planetsheinker), can you be more descriptive in what has gone wrong so people can assist you?

charlieg: I haven't heard of anyone breaking their system yet with LDFLAGS="-Wl,-O1". I don't know about any of the other flags. The worst that I've heard happen is a package won't compile.

planetsheinker: You'll have to rerun the emerge again for the failed package to get the error message. You can however get an idea by going to /var/tmp/portage/ and looking in the package directory. When a package fails, I believe it keeps a /work/ directory open? I might be wrong, but if you go into that /work/ directory, and type "make" it should reproduce the error.
Back to top
View user's profile Send private message
rawoul
n00b
n00b


Joined: 27 Dec 2003
Posts: 65

PostPosted: Mon Jan 03, 2005 7:02 pm    Post subject: Reply with quote

I recompiled all my system with LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s" and everything works fines \o/. I don't think i can feel a difference in speed though ...
Back to top
View user's profile Send private message
hotwok
n00b
n00b


Joined: 13 Jan 2004
Posts: 48
Location: Sweden

PostPosted: Wed Jan 05, 2005 5:28 pm    Post subject: Reply with quote

Is there any way to see what LDFLAGS a binary was compiled with?
Back to top
View user's profile Send private message
gkmac
Guru
Guru


Joined: 19 Jan 2003
Posts: 333
Location: West Sussex, UK

PostPosted: Wed Jan 05, 2005 5:55 pm    Post subject: Reply with quote

hotwok wrote:
Is there any way to see what LDFLAGS a binary was compiled with?
I don't know if there is an "official command" to do this, but try something like...
Code:
cat /var/db/pkg/app-arch/gzip-1.3.5-r5/LDFLAGS
Back to top
View user's profile Send private message
hotwok
n00b
n00b


Joined: 13 Jan 2004
Posts: 48
Location: Sweden

PostPosted: Wed Jan 05, 2005 6:29 pm    Post subject: Reply with quote

gkmac wrote:
hotwok wrote:
Is there any way to see what LDFLAGS a binary was compiled with?
I don't know if there is an "official command" to do this, but try something like...
Code:
cat /var/db/pkg/app-arch/gzip-1.3.5-r5/LDFLAGS


thanks. i recompiled KDE and XFCE4 with the ldflags -Wl,-O1 and i think i notice a shorter startup time for XFCE4 but im not sure, it could be placebo :)
Back to top
View user's profile Send private message
malloc
l33t
l33t


Joined: 19 Sep 2003
Posts: 762

PostPosted: Wed Jan 05, 2005 6:50 pm    Post subject: Reply with quote

hotwok wrote:
gkmac wrote:
hotwok wrote:
Is there any way to see what LDFLAGS a binary was compiled with?
I don't know if there is an "official command" to do this, but try something like...
Code:
cat /var/db/pkg/app-arch/gzip-1.3.5-r5/LDFLAGS


thanks. i recompiled KDE and XFCE4 with the ldflags -Wl,-O1 and i think i notice a shorter startup time for XFCE4 but im not sure, it could be placebo :)

It's not a placebo, xfce4 does start faster after re-compiling it with -Wl,-O1
_________________
--> Linux ### 2.6.11-ck2 #1 Sat Mar 12 20:21:30 WET 2005 i686 GNU/Linux <--
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Wed Jan 05, 2005 9:47 pm    Post subject: Reply with quote

I tried to recompile some apps with LDFLAGS, and startup times are slightly faster. Now recompiling whole system with LDFLAGS="-Wl,-O1" ;)
Back to top
View user's profile Send private message
blueSceaDa
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2005
Posts: 90

PostPosted: Thu Jan 06, 2005 3:44 pm    Post subject: Reply with quote

I don't know if I should put this LDFLAGS now or not, because it still didnt come out, if it really got no drawbacks.

And someone said it could really mess up security.

so can I use them without having to be worried ?
_________________
Athlon XP 2500+ @ ~2100MHz; GeForce FX 5600 256MB; 3x256MB RAM; ASUS A7N8X-X
echo 'LDFLAGS="-Wl,-O1"' >> /etc/make.conf - no problems here
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Thu Jan 06, 2005 11:12 pm    Post subject: Reply with quote

Wee! I feel compelled to reply since I got my new install up and running (had a few easily solved Grub issues). I've bootstrapped and done the entire install as ~x86 with LDFLAGS="-Wl,-O1" and all is fine. Maybe it's just placebo...maybe it's just the faster hard disk, but things seem a lot snappier. :D
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
loki99
Advocate
Advocate


Joined: 10 Oct 2003
Posts: 2056
Location: Vienna, €urope

PostPosted: Thu Jan 06, 2005 11:46 pm    Post subject: Reply with quote

just wondering! can i use LDFLAGS and prelinking or do they exclude each other?
Back to top
View user's profile Send private message
blueSceaDa
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2005
Posts: 90

PostPosted: Fri Jan 07, 2005 12:20 am    Post subject: Reply with quote

codergeek42 wrote:
Wee! I feel compelled to reply since I got my new install up and running (had a few easily solved Grub issues). I've bootstrapped and done the entire install as ~x86 with LDFLAGS="-Wl,-O1" and all is fine. Maybe it's just placebo...maybe it's just the faster hard disk, but things seem a lot snappier. :D


nice to hear 8)
Can you post here if any strange issues occur ? thx !
_________________
Athlon XP 2500+ @ ~2100MHz; GeForce FX 5600 256MB; 3x256MB RAM; ASUS A7N8X-X
echo 'LDFLAGS="-Wl,-O1"' >> /etc/make.conf - no problems here
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Fri Jan 07, 2005 1:07 am    Post subject: Reply with quote

loki99 wrote:
just wondering! can i use LDFLAGS and prelinking or do they exclude each other?
If I understand correctly, using these LDFLAGS basically does what prelinking does, but in a safer way (not modyfing the binaries, just changing the way they're linked to shared libraries).
blueSceaDa wrote:
Can you post here if any strange issues occur ? thx !
Deal 8)
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Fri Jan 07, 2005 1:48 am    Post subject: Reply with quote

i've heard that and i've heard they are two seperate things. anyways, it doesn't stop you from prelinking, i just don't know if it has an additional benefit to it.

BTW, --enable-new-dtags is enabled in newer binutils by default
https://bugs.gentoo.org/show_bug.cgi?id=65002#c7
_________________
by design, by neglect
for a fact or just for effect
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 5 of 8

 
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