C++ compile error on Sun

J

Jane

Hi,

We compile a test program for a home make lib suite on Sun, Linux, SGI
platform, all the others are fine. We got the following error message
on Sun only:

The following argument files were compiled -K pic ::
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(stdexcept.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ios.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ostream.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(strstream.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(char.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(charby.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(locale.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(vendor.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(wchar.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(2yi5kEpmEtUw_3Zz13e2.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(jcV0X6KpyqkcGcWTIEOi.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(8kues3QDCWMzncWm35iB.o)
/vobs/Solari
ild: global offset table too big for addressing mode of -K pic
compiled files; these should be recompiled with-K PIC or with neither
option
*** Error code 1


The compiler is Sun Workshop 6.

Any one has an idea?

Thanks!

Jane
 
V

Victor Bazarov

Jane said:
We compile a test program for a home make lib suite on Sun, Linux, SGI
platform, all the others are fine. We got the following error message
on Sun only:

The following argument files were compiled -K pic ::
[...]
ild: global offset table too big for addressing mode of -K pic
compiled files; these should be recompiled with-K PIC or with neither
option
*** Error code 1


The compiler is Sun Workshop 6.

Any one has an idea?

Sun Workshop Technical Support probably does. Have you tried reaching
them? If yes, what's the result? If not, why not?

Victor
 
T

Thomas Matthews

Jane said:
Hi,

We compile a test program for a home make lib suite on Sun, Linux, SGI
platform, all the others are fine. We got the following error message
on Sun only:

The following argument files were compiled -K pic ::
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(stdexcept.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ios.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ostream.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(strstream.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(char.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(charby.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(locale.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(vendor.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(wchar.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(2yi5kEpmEtUw_3Zz13e2.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(jcV0X6KpyqkcGcWTIEOi.o)
/vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(8kues3QDCWMzncWm35iB.o)
/vobs/Solari
ild: global offset table too big for addressing mode of -K pic
compiled files; these should be recompiled with-K PIC or with neither
option
*** Error code 1


The compiler is Sun Workshop 6.

Any one has an idea?

Thanks!

Jane

BTW, this is specific to the Sun compiler and best discussed in
a newsgroup about the Sun compiler or OS. See the FAQ and
Welcome.txt links below.

The key here is the term "PIC" which is an abbreviation for
Position Independent Code. PIC code contains instructions
that fetch data, store data, and branch based on an offset
value and not an absolute location. Each processor has a
limit for how big an offset can be.

Your linker / loader is complaining that the amount of code
exceeds the limit for those relative offsets and can't be
Position Independent Code.

Here are some solutions:
1. Remove the PIC requirement.
2. Split the code into shared libraries (or dynamic link
libraries) which the OS will load on demand.
3. Devise your own method for dynamic loading and executing
of code.

The experts in a Sun newsgroup would give you some better
advice. I thought I would explain a PIC for the general
populus.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,125
Latest member
VinayKumar Nevatia_
Top