Are ports supposed to build and run on 10-CURRENT?

Dimitry Andric dim at FreeBSD.org
Wed Jun 26 09:00:43 UTC 2013


On 2013-06-26 01:55, Michael Gmelin wrote:
...
> The problem is that static initialization happens in the expected
> order (same translation unit), but termination does *not* happen in the
> reverse order of initialization, which - according to the C++ standard
> section 3.6.3 should be guaranteed:
>
> "If the completion of the constructor or dynamic initialization of an
> object with static storage duration is sequenced before that of
> another, the completion of the destructor of the second is sequenced
> before the initiation of the destructor of the first."
>
> The following conditions have to be met in order to show the problem:
>
> 1. Two static objects defined in the translation unit containing main
> 2. Definition of one of the underlying objects is in a separate
>     source which is used to build a shared library
> 3. Both, the translation unit containing main an the one forming the
>     shared library are compiled using -fPIC (or -fpic).

Strange, if you compile the main program without -fPIC, the testcase
works correctly.  Normally, there should never be a need to compile a
normal executable with -fPIC, but it should not break anything either.

I am not sure what causes this, but I will investigate.  For now, the
workaround is to compile only shared objects with -fPIC.

-Dimitry


More information about the freebsd-ports mailing list