Boost logo

Boost-Build :

Subject: [Boost-build] bug by generating shared lib with PIC
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2011-04-27 14:53:14


I've encountered a strange behaviour of generating shared
libs (PIC) on MIPS platform. I've a boost lib containing assembler
calling a function (exit()) from the C-lib:

lw $t9, %call16(exit)($gp)

If I compile the lib with: bjam toolset=gcc link=shared variant=debug
cxxflags="-fPIC" --with-my_lib stage
and use it by a test app: g++ -g test.cpp -I./ -L./stage/lib
-lboost_my_lib -Wl,-rpath=./stage lib -lrt
the line above (calling exit())generates an segfault.

If I compile the library by 'hand' the code works (no segfault):
gcc -fPIC -g -I./ my_lib.cpp
gcc -fPIC -g -I./ some_code.S
gcc -shared -Wl,-soname, -o
my_lib.o some_code.o -lc
gcc -g ./test.cpp -I./ -L./ -Wl,-rpath=./ -lboost_my_lib -lrt

It seams that doesn't apply the -fPIC option to the compiler
invocation for the assembler file.
If the lib is linked statically to the test app it works (asm: 'j exit',
instead using global pointer register).

Could you verify this?! Bugfix?


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at