Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-06-05 06:57:10


Okay, thanks for all the (conflicting?) information!

These questions remain:

Is it acceptable for boost to build everything with -fPIC on platforms where
it matters? (BTW, we are not supporting old broken compilers like egcs-1.1)

If the answer is YES, we can allow shared and static versions of any library
to
share object files. If the answer is NO, we must apply some target
requirements based on target type. The question goes to the fundamental
design of the build system, and whether shared and static libraries must be
considered distinct top-level targets, or simply some kind of build variants
of the same top-level target.

Please think about this question in the context of your non-GCC compiler
also. Analogous issues may exist.

Thanks,
Dave

----- Original Message -----
From: "Greg Chicares" <chicares_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, June 05, 2001 1:09 AM
Subject: Re: [boost] Build system/GCC questions

> David Abrahams wrote:
> >
> > I am trying to understand how best to support shared libraries
> > in the build system. Several people have mentioned to me that
> > under GCC, DLL source files should be compiled with -fPIC.
>
> Not on mingw, where a DLL is built this way:
>
>
ftp://ftp.nanotech.wisc.edu/pub/khan/gnu-win32/mingw32/snapshots/gcc-2.95.2-
1/README
>
> Building a DLL:
> $ gcc -c foo.c
> $ gcc -shared -Wl,--implib,libfoo.a -o foo.dll foo.o
>
> I just seached the mingw mailing list archives and found
> no evidence of anyone using -fPIC.
>
> According to the gcc online manual
>
> http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2
>
> -shared
> Produce a shared object which can then be linked with
> other objects to form an executable. Not all systems
> support this option. You must also specify `-fpic' or
> `-fPIC' on some systems when you specify this option.
>
> -fpic
>
> Position-independent code requires special support,
> and therefore works only on certain machines. For the
> 386, GCC supports PIC for System V but not for the Sun
> 386i. Code generated for the IBM RS/6000 is always
> position-independent.
>
> It appears that -fpic and -fPIC may be different, but I
> can't say for sure. I've never experimented with this
> so take what follows with a grain of salt--I'm just
> reporting what I gleaned from a web search.
>
> From the cygwin mailing list
>
> http://www.cygwin.com/ml/cygwin/1999-06/msg00329.html
>
> > To recap, DO NOT use -fPIC/pic with egcs-1.1 if you
> > don't want bad code.
> >
> That was the sollution! Thank you very much.
>
> I found a patch, dated several months before that message,
> that would have caused -fpic to be ignored, but I guess
> it wasn't applied.
>
> Also, I found a message on a BeOS list:
>
> http://www.bespecific.com/dialog/bedevtalk/archive/981102/00000061.htm
>
> that suggests -fpic has a 10% speed penalty, although
> the followups dispute it.
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk