Skip to contentSkip to conversation

Glibc 2.2.4-2 No Optimizations = No Compliation

parisc-linux Carlos O'Donell Jr. 2 participants 5 messages Oct 11, 2001

lore
Share & tools
lore
#0 lore raw

pa-list,

I was working on glibc once again last night.

With the hopes of compiling the library with less optimizations and tracing through some saner PARISC assembly.

I've noticed that glibc-2.2.4/config.h.in (eventually becomes config.h) throws an error if glibc is compiled wihtout optimizations.

"#error glibc cannot be compiled without optimizations"

Why?

I've trolled the glibc lists, and the faq, hunted through gcc manuals and referance documentation... to no avail.

As of last year, Drepper made -02 the stable glibc compilation standard.

I've compiled glibc with -O1 and it looks like saner assembly. I have yet to do a full trace through again.

I would like to compile with -O0, but I'm not quite sure of the ramifications.

Any reasons why I can't? Any ideas?

c.

Note: This is only for the sake of debugging :)

#1 lore raw
Quoted 2 lines · Carlos O'Donell Jr.

With the hopes of compiling the library with less optimizations and tracing through some saner PARISC assembly.

I dunno... I oftn find optimised easier to read.

Quoted 5 lines

I've noticed that glibc-2.2.4/config.h.in (eventually becomes config.h) throws an error if glibc is compiled wihtout optimizations.

"#error glibc cannot be compiled without optimizations"

I don't know. But I guess glibc needs to inline something, and this doesn't happen below -O1.

Signature · 1 line
Revolutions do not require corporate support.
#2 lore raw
Quoted 3 lines

I dunno... I oftn find optimised easier to read.

Really?
How about unrolled loops? ;)

In this case with GCC 3.0 being so fresh, there might be some issues with -O2... so I'd like to see what happend at -O0. I've patched, and I'm currently recompiling with -O0... so we'll see.

Quoted 4 lines

I don't know. But I guess glibc needs to inline something, and this doesn't happen below -O1.

True. But that really shouldn't make much difference since AFAIK inlining doesn't happen until -O2, but config.h just says... "You must have atleast -O1"

Those inlines, if they aren't there, would cause the build to fail... and I still haven't seen any indication of this.

We shall see. If -O0 still segfaults, I'll trace that asm and see what I can see... damn this all sounds so much like voodoo magic.

c.

#3 lore raw
Quoted 2 lines · Carlos O'Donell Jr.

Really?
How about unrolled loops? ;)

Sometimes. More importantly, gcc stops doing stupid things with -O1, particulalry shifting registers backwards and forwards with no net effect.

Quoted 3 lines

True. But that really shouldn't make much difference since AFAIK inlining doesn't happen until -O2, but config.h just says... "You must have atleast -O1"

Not the case. gcc will inline functions marked as such at -O1. At -O3, it decides for itself to inline some things.

Signature · 1 line
Revolutions do not require corporate support.
#4 lore raw
Quoted 4 lines

Sometimes. More importantly, gcc stops doing stupid things with -O1, particulalry shifting registers backwards and forwards with no net effect.

I've not seen such mischieviously deviant behaviour from gcc :}

Quoted 4 lines

Not the case. gcc will inline functions marked as such at -O1. At -O3, it decides for itself to inline some things.

Ok.

Compiled with -O0 and I get undefined referancs to try_lock... curse those inlined functions.

Back to -O1 and some debugging.

c.