C++ compile error on Sun

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jane

    C++ compile error on Sun

    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(stdex cept.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ios.o )
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ostre am.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(strst ream.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(char. o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(charb y.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(local e.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(vendo r.o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(wchar .o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(2yi5k EpmEtUw_3Zz13e2 .o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(jcV0X 6KpyqkcGcWTIEOi .o)
    /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(8kues 3QDCWMzncWm35iB .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
  • Victor Bazarov

    #2
    Re: C++ compile error on Sun

    "Jane" <jane.liang@all tel.net> wrote...[color=blue]
    > 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?[/color]

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

    Victor



    Comment

    • Thomas Matthews

      #3
      Re: C++ compile error on Sun

      Jane wrote:
      [color=blue]
      > 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(stdex cept.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ios.o )
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(ostre am.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(strst ream.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(char. o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(charb y.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(local e.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(vendo r.o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(wchar .o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(2yi5k EpmEtUw_3Zz13e2 .o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(jcV0X 6KpyqkcGcWTIEOi .o)
      > /vobs/Solaris_tools/FD60/SUNWspro/WS6/lib/libCstd.a(8kues 3QDCWMzncWm35iB .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[/color]

      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:

      C++ Faq: http://www.parashift.com/c++-faq-lite
      C Faq: http://www.eskimo.com/~scs/c-faq/top.html
      alt.comp.lang.l earn.c-c++ faq:

      Other sites:
      http://www.josuttis.com -- C++ STL Library book

      Comment

      Working...