Boost logo

Boost :

Subject: Re: [boost] [context] test on Mac OS X requested
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2011-02-08 03:34:01


Am 08.02.2011 02:59, schrieb Daniel Larimer:
>
> On Feb 7, 2011, at 12:09 PM, Oliver Kowalke wrote:
>
>> I've uploaded boost.context 0.6.4 - unfortunately I've no Mac OS X installation and I hope someone can test the lib on the Mac platform:
>>
>> ucontext_t:
>> bjam toolset=gcc --debug-building
>>
>> fcontext_t on i386:
>> bjam toolset=gcc architecture=x86 instruction-set=i686 address-model=32 context-impl=asm --debug-building
>>
>> fcontext_t on x86_64:
>> bjam toolset=gcc architecture=x86 instruction-set=yorksfield address-model=64 context-impl=asm --debug-building
>>
>> thx,
>> Oliver
>
>
> I am still having problems with bjam, but from what I can tell these are the commands that should build your example by hand. Perhaps there is something I am missing about the commands I need to pass to gcc.
>
> I get the same results with: g++ -o link example/link.cpp src/asm/fcontext_x86_64_sysv_macho_gas.S src/protected_stack_posix.cpp -I../..
>
> gcc -c -o fctx.o src/asm/fcontext_x86_64_sysv_macho_gas.S
> g++ -c -o protected_stack_posix.o src/protected_stack_posix.cpp -I../..
> g++ -o link example/link.cpp protected_stack_posix.o fctx.o -I../..
>
> Undefined symbols:
> "_make_fcontext", referenced from:
> boost::contexts::context<boost::contexts::protected_stack>::context(void (*)(void*), boost::contexts::context<boost::contexts::protected_stack>&, void*, boost::rv<boost::contexts::protected_stack>&)in ccW4I8zo.o
> "_swap_fcontext", referenced from:
> boost::contexts::context<boost::contexts::protected_stack>::jump_to(boost::contexts::context<boost::contexts::protected_stack>&)in ccW4I8zo.o
> "_get_fcontext", referenced from:
> boost::contexts::context<boost::contexts::protected_stack>::context(void (*)(void*), boost::contexts::context<boost::contexts::protected_stack>&, void*, boost::rv<boost::contexts::protected_stack>&)in ccW4I8zo.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status

strange on my linux x86_64 system I get it compiled without linker errors:

g++ -o link example/link.cpp src/asm/fcontext_x86_64_sysv_elf_gas.S
src/protected_stack_posix.cpp -I ../../

I found in the INet following:
'Mac OS S requires yout to prefix all your libc method name with "_".
Most code sample in Unix world don't have this constraint.'

May this be the reason? Especially because I don't declare fcontext-t
functions (make_fcontext(), swap_fcontext() etc.) with a leading underscore.

Sorry - I've no experience with Mac OS X. Maybe someone can help?

Oliver


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