Boost logo

Boost :

Subject: Re: [boost] [context review] Several Questions
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2011-03-22 03:17:26


> Usually with Bjam the user doesn't take care of this option as Bjam
> include it when compiling objects for a shared library.
> Please could you show where you missed the -fPIC option?

Artyom compiled the libs with bjam (-fPIC is required for shared libs on AMD64) and the example he compiled by hand (see its last posts for the commandline) without -fPIC and he get a segfault in the executable as function get_fcontext() (which is implemented in assembler).
If -fPIC is added to Artyoms commandline the example works.
If I compile the examples with bjam (as I did until now) I see -fPIC applied by bjam automatically:

bjam toolset=gcc architecture=x86 instruction-set=yorksfield address-model=64 context-impl=asm -d 2

A look into 'X86_64 ABI - System V Application Binary Interface
':

'References from within the executable file to
a function defined in a shared object will normally be resolved by the link editor
to the address of the procedure linkage table entry for that function within the
executable file.'

I've to investigate why it doesn't work.

Oliver

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

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