This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Building libstdc++ non-shared with -fpic ?


> > Now if you try to build a shared library, which uses code of a 
> > static libstdc++, this will lead to problems, because the
> > static libstdc++ will contain code which is NOT position 
> > independent. 
> 
> No, it won't lead to problems - at least not if these two library
> copies had the same source code, and where compiled by the same
> compiler release. You can certainly combine non-PIC code into a shared
> library, at least on Linux.

How is this possible ?
That would imply that you are able to build shared libraries, which
use code which is not position independent, so why would it be necessary
at all to use the -fPIC compiler switch to create a shared library ?

(Why should it be possible that some of the code has do be PIC and
 some of it doesn't need to be PIC ? 
 I think the all or nothing principle should apply:
 All PIC -> shared library possible
 Not all PIC -> shared library impossible
)

so long
  Ingo

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]