Opened 11 years ago

Closed 11 years ago

#5508 closed Bugs (fixed)

shared libs with PIC not correctly build on MIPS

Reported by: Oliver Kowalke <oliver.kowalke@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: build
Version: Boost 1.47.0 Severity: Showstopper
Keywords: MIPS PIC Cc: oliver.kowalke@…

Description

shared libraries build with bjam/boost.build on MIPS using position-independed code do not work correctly/generating segmentation fault. Compiling the library 'by hand' doesn't issue an error.

build libboost_fn with bjam: bjam toolset=gcc link=shared variant=debug cxxflags="-fPIC" --with-fn stage

build test app: g++ -g ./test.cpp -I./ -L./stage/lib -lboost_fn -Wl,-rpath=./stage/lib -lrt

./a.out with segementation fault at fn1.S: 'lw $t9, %call16(exit)($gp)'

build libbost_fn by hand: g++ -fPIC -g -I./ -c -Wall fn1.S g++ -shared -Wl,-soname,libboost_fn, -o libboost_fn fn1.o -lc

build test app: g++ -g ./test.cpp -I./ -L./ -lboost_fn -Wl,-rpath=./ -lrt

./a.out works and returns with exit code 2.

It seams to be a bug in bjam/boost.build.

Attachments (4)

fn1.hpp (69 bytes ) - added by Oliver Kowalke <oliver.kowalke@…> 11 years ago.
header of test library
fn1.S (281 bytes ) - added by Oliver Kowalke <oliver.kowalke@…> 11 years ago.
implementation for test library
test.cpp (76 bytes ) - added by Oliver Kowalke <oliver.kowalke@…> 11 years ago.
test binary
fn1.2.S (346 bytes ) - added by Oliver Kowalke <oliver.kowalke@…> 11 years ago.
corrected version of fn1.S

Download all attachments as: .zip

Change History (8)

by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

Attachment: fn1.hpp added

header of test library

by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

Attachment: fn1.S added

implementation for test library

by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

Attachment: test.cpp added

test binary

comment:1 by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

correct command line for building libboost_fn:

g++ -shared -Wl,-soname,libboost_fn.so -o libboost_fn.so ./fn1.o -lc

by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

Attachment: fn1.2.S added

corrected version of fn1.S

comment:2 by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

Cc: oliver.kowalke@… added

comment:3 by Oliver Kowalke <oliver.kowalke@…>, 11 years ago

I guess that the object file for fn1.S is not compiled with -fPIC if build with bjam/boost.build

comment:4 by Vladimir Prus, 11 years ago

Resolution: fixed
Status: newclosed

(In [71622]) Set -fPIC for assembler complications, if necessary.

Fixes #5508.

Note: See TracTickets for help on using tickets.