Compiling with Sun compilers from SC5.0 onward.

Alexandre Oliva oliva at
Wed Apr 11 01:28:12 GMT 2001

On Apr 10, 2001, Jeremy Allison <jeremy at> wrote:

> Would it work to change the order of the pic tests to
> -KPIC then -Kpic?

Most likely.

> What effect would this have on other platforms ?

It would prevent the few optimizations that can be obtained with -Kpic
over -KPIC.  Basically, lower-case pic often means ``assume the
library fits into some platform-specific size limitations.''  Such
limitations are often related with the number of entries in the Global
Offset Table.  Using lower-case PIC often tells the compiler it's safe
to assume an offset within the GOT fits in the immediate operand of a
move instruction, or in the displacement of a register+offset
addressing mode.  If such assumptions can't be made, the compiler must
assume the offset may not fit, and generate larger instruction

So, using upper-case -[fK]PIC is always safe, but it will often
generate bigger and less efficient code.

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

More information about the samba-technical mailing list