Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GLIBC + CFLAG -Os
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
RobertDavid
Apprentice
Apprentice


Joined: 08 Aug 2005
Posts: 271
Location: Czech Republic

PostPosted: Sun Mar 05, 2006 12:32 am    Post subject: GLIBC + CFLAG -Os Reply with quote

Ïs it possible to compile glibc with -Os optimalization?? I have -Os set up but glibc allways compile -O2... My reason is that I have notebook P3 600 with slow hdd,,

Or what are the best cflags for glibc to have small size (and enough optimized)...
_________________
Arch & Fluxbox & 2.6.24-rc-zen!!!!
robertek.brevnov.net
Back to top
View user's profile Send private message
kfiaciarka
Veteran
Veteran


Joined: 20 May 2005
Posts: 1498
Location: Dobre Miasto, Poland

PostPosted: Sun Mar 12, 2006 4:46 am    Post subject: Reply with quote

Yes it is possible. My glibc is compliled with -Os flag and works fine. Glibc is essential for gentoo so simple cflags are better :)
Back to top
View user's profile Send private message
alex6z
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2005
Posts: 119

PostPosted: Sun Mar 12, 2006 5:01 am    Post subject: Reply with quote

glibc will refuse to build with -O0. maybe it's a protection to prevent it from failing.
Back to top
View user's profile Send private message
Dr.Black.85
n00b
n00b


Joined: 19 Dec 2005
Posts: 55
Location: Czech Republic

PostPosted: Sun Mar 12, 2006 12:58 pm    Post subject: Reply with quote

If you're taling about -O optimization flag, could you tell me if -O3 is stable? Since I will have a new computer will a large hdd so I don't care that much about size.

And btw, would these setting in CFLAGS be correct for an A64 3800+ Manchaster dualcore for x86?
-mcpu=athlon-xp -msse2 -msse3 -O3 -pipe -fomit-frame-pointer

Oops: this one:
-march=athlon-xp -msse2 -msse3 -O3 -pipe -fomit-frame-pointer
_________________
How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54402
Location: 56N 3W

PostPosted: Sun Mar 12, 2006 1:07 pm    Post subject: Reply with quote

Dr.Black.85,

I have all ~x86 and -O3 all I can say is worksforme.
Most ebuilds that break with -O3 will filter it out, so it won't be used.

You may want to fiddle with your MAKEOPTS="-j2" setting in /etc/make.conf. You may find that higher numbers allow shorter elapsed times for compiles. It sets the numbr of makes that run concurrently. Too high a number will lead to slow downs. Trial and error is harmless. Again, its filtered for things that parallel makes break.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Dr.Black.85
n00b
n00b


Joined: 19 Dec 2005
Posts: 55
Location: Czech Republic

PostPosted: Sun Mar 12, 2006 1:13 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I have all ~x86 and -O3 all I can say is worksforme.
Most ebuilds that break with -O3 will filter it out, so it won't be used.


So if I understand it correctly -O3 is safe for all x86 tested packages? I plan to use 32bit environment instead of AMD64 because for my use it won't be an advantage at the time.

I guess makeopts="j3" would do the job, but it's only a "guess".
_________________
How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol"
Back to top
View user's profile Send private message
RobertDavid
Apprentice
Apprentice


Joined: 08 Aug 2005
Posts: 271
Location: Czech Republic

PostPosted: Sun Mar 12, 2006 1:54 pm    Post subject: Reply with quote

kfiaciarka: are you realy know that your glibc compiles -Os???? because I have -Os set up but only some packages compiles Os,

Packages that doesnt compile Os but O2
1) gcc
2) glibc
3) firefox (I just repair that in eclass)
4) maybe libstdc++ (dont remember)

Does -Os break gcc and glibc, when they have set up internaly to compile O2???
I think that glibc is one of the most used packages so on slow HDD and older CPU with less cache is good to have it -Os...
_________________
Arch & Fluxbox & 2.6.24-rc-zen!!!!
robertek.brevnov.net
Back to top
View user's profile Send private message
alex6z
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2005
Posts: 119

PostPosted: Sun Mar 12, 2006 2:05 pm    Post subject: Reply with quote

glibc is only a little over 1MB when loaded into memory if I remember right.

b7e0c000-b7f0f000 r-xp 00000000 03:06 712178 /lib/libc-2.3.5.so
b7f0f000-b7f10000 r--p 00102000 03:06 712178 /lib/libc-2.3.5.so
b7f10000-b7f13000 rw-p 00103000 03:06 712178 /lib/libc-2.3.5.so

Looks like the executable portion is about 0x00100000 bytes long.
Back to top
View user's profile Send private message
thechris
Veteran
Veteran


Joined: 12 Oct 2003
Posts: 1203

PostPosted: Mon Mar 13, 2006 8:58 am    Post subject: Reply with quote

Dr.Black.85 wrote:
If you're taling about -O optimization flag, could you tell me if -O3 is stable? Since I will have a new computer will a large hdd so I don't care that much about size.

And btw, would these setting in CFLAGS be correct for an A64 3800+ Manchaster dualcore for x86?
-mcpu=athlon-xp -msse2 -msse3 -O3 -pipe -fomit-frame-pointer

Oops: this one:
-march=athlon-xp -msse2 -msse3 -O3 -pipe -fomit-frame-pointer


there is a -march=k8 that works in either 32bit or 64bit gcc. the compiler will know which one makes sense from your CHOST.

with enough ram, glibc will be read to ram once. if glibc is used often, it'll stay in a page in ram and never see the disk again. if glibc isn't used much, then let it stay on the disk.

as for asking glibc to reside fully in cache, its possible but unlikely. and i'd rather have things aligned so as not to be split across cache lines.
_________________
HW problems. It's a VIA thing.
Back to top
View user's profile Send private message
Dr.Black.85
n00b
n00b


Joined: 19 Dec 2005
Posts: 55
Location: Czech Republic

PostPosted: Mon Mar 13, 2006 9:26 am    Post subject: Reply with quote

thechris wrote:
there is a -march=k8 that works in either 32bit or 64bit gcc. the compiler will know which one makes sense from your CHOST.


Thanks. So using -march=k8 and CHOST="i686-pc-linux-gnu" would do it. Am I correct? I just want to be absolutetly sure of what I'm going to do today. I'll use the 2006.0x86 minimal CD so I guess that it even won't be possible to install in 64bit :roll:
_________________
How will you notice that you spend too much time programming?
When you're surprised that your document writer isn't marking lines unfinished by semicolon with "cannot find symbol"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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