Boost logo

Boost Users :

Subject: Re: [Boost-users] Static linking/GCC 4.3.2 on Linux (-fPIC missing?)
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-03-06 11:56:56


Anteru wrote:

> Hi,
>
> I've been using Boost 1.37 so far on Linux, and linked some libraries
> statically into a shared library. That is, I have a .so (Foo.so), which
> statically links in Boost.Filesystem (among others).
>
> Yesterday I tried to compile Boost 1.38 for Linux, everything worked
> fine, but as soon as it got to linking my .so, GCC stops as
> Boost.Filesystem has not been compiled with -fPIC. I don't remember I
> had to set -fPIC on 1.37 though.
>
> Setting cxxflags=-fPIC obviously solves the problem (along with a
> recompile of Boost), so my question is: Is this a regression? Did I miss
> something?

Static libraries were always built without -fPIC and I don't think there
was any change in this area.

> The environment is Linux with GCC 4.3.2, on x64.

Any chance you just recently upgraded to an x64 system? On x64, it's all or nothing,
you cannot mix PIC and non-PIC code.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net