Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8266: context library don't compile for Mac OSX universal binary
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-10 00:46:41
#8266: context library don't compile for Mac OSX universal binary
---------------------------------------------------+------------------------
Reporter: Serguei E. Leontiev <leo@â¦> | Owner: olli
Type: Bugs | Status: new
Milestone: To Be Determined | Component: context
Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords: mac osx universal binary
---------------------------------------------------+------------------------
Comment (by Serguei E. Leontiev <leo@â¦>):
Replying to [comment:2 olli]:
> please post the '''complete''' output of command in libs/context/example
(for instance):
> b2 toolset= ... --debug-building
> '''I highly recommend to provide regression tests for 32bit Mac OS X on
boost-trunk! '''
I don't have 32bit Mac OS X. I add line "using darwin : : c++ -arch ... :
: ;" to file "tools/build/v2/user-config.jam" before each build. See
attachment "b2-trunk-x86-32_64-example.log" (25 Kbyte).
Before patch:[[BR]]
./bootstrap.sh --with-libraries=context --with-libraries=chrono[[BR]]
For both, modern Xcode 4.6, and old Xcode 3.6.2
user-config.jam: -arch i386[[BR]]
./b2 architecture=x86 address-model=32[[BR]]
OK
user-config.jam: -arch x86_64[[BR]]
./b2 architecture=x86 address-model=64[[BR]]
OK
user-config.jam: -arch i386 -arch x86_64[[BR]]
./b2 architecture=x86 address-model=32_64[[BR]]
Fail: #error "platform not supported"
user-config.jam: -arch ppc[[BR]]
./b2 architecture=power address-model=32[[BR]]
Fail: #error "platform not supported"
For old Xcode 3.2.6 only (Mac OS X 10.6.8 with Rosetta)
user-config.jam: -arch i386 -arch ppc[[BR]]
./b2 architecture=combined address-model=32[[BR]]
Fail: #error "platform not supported"
user-config.jam: -arch i386 -arch x86_64 -arch ppc[[BR]]
./b2 architecture=combined address-model=32[[BR]]
Fail: #error "platform not supported"
IMHO support universal binary has 2 level:
1. Mandatory level, only support Intel code for Xcode 4.x for development
new 64-bit applications and support 32-bit x86 application 38298;
2. Impossible level, support both PowerPC and Intel code for Xcode 3.6
38339.
"patch-libs-context-130308-0.diff" addressed only for Intel code for Xcode
4.x. After patch:
user-config.jam: -arch i386 -arch x86_64[[BR]]
./b2 architecture=x86 address-model=32_64[[BR]]
OK
Examples seems working for both i386 and x86_64 architecture:
{{{
leom-3:example leo$ arch -x86_64
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/exit
size: 0x58
main: call start_fcontext( & fcm, fc1, 0)
f1: entered
f1: call jump_fcontext( fc1, fc2, 0)
f2: entered
f2: call jump_fcontext( fc2, fc1, 0)
f1: return
leom-3:example leo$ arch -i386
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/exit
size: 0x28
main: call start_fcontext( & fcm, fc1, 0)
f1: entered
f1: call jump_fcontext( fc1, fc2, 0)
f2: entered
f2: call jump_fcontext( fc2, fc1, 0)
f1: return
leom-3:example leo$ arch -x86_64
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/jump
main: call start_fcontext( & fcm, fc1, 0)
f1: entered
f1: call jump_fcontext( fc1, fc2, 0)
f2: entered
f2: call jump_fcontext( fc2, fc1, 0)
f1: return
main: done
leom-3:example leo$ arch -i386
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/jump
main: call start_fcontext( & fcm, fc1, 0)
f1: entered
f1: call jump_fcontext( fc1, fc2, 0)
f2: entered
f2: call jump_fcontext( fc2, fc1, 0)
f1: return
main: done
leom-3:example leo$ arch -x86_64
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/transfer
2 + 7 == 9
5 + 6 == 11
main: done
leom-3:example leo$ arch -i386
../../../bin.v2/libs/context/example/darwin-4.2.1/debug/address-model-
32_64/architecture-x86/link-static/transfer
2 + 7 == 9
5 + 6 == 11
main: done
}}}
Regression test also not detect errors:
{{{
leom-3:test leo$ arch -i386
../../../bin.v2/libs/context/test/test_context.test/darwin-4.2.1/debug
/address-model-32_64/architecture-x86/link-static/test_context
Running 8 test cases...
*** No errors detected
leom-3:test leo$ arch -x86_64
../../../bin.v2/libs/context/test/test_context.test/darwin-4.2.1/debug
/address-model-32_64/architecture-x86/link-static/test_context
Running 8 test cases...
*** No errors detected
}}}
For support PowerPC and universal binary with PowerPC also needed:
1. Convert "{jump,make}_ppc{32,64}_sysv_elf_gas.S" to
"{jump,make}_ppc{32,64}_sysv_macho_gas.S", i.e. convert syntax of
comments, external symbol name decoration, syntax of register name and
assembler expression;
2. Compare Apple Mac OSX and IBM AIX documents about calling conventions,
FPU and AltiVec usage;
But MacPorts users, may be, voted just disable "context" library for PPC.
Sorry for my best English
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8266#comment:6> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC