Boost logo

Boost Users :

Subject: Re: [Boost-users] building on OS X with custom gcc version
From: Damien (damien_at_[hidden])
Date: 2018-07-12 03:02:28


On 2018-06-25 10:48 AM, Steven Watanabe via Boost-users wrote:
> AMDG
>
> On 06/25/2018 10:31 AM, Damien via Boost-users wrote:
>> On Jun 24, 2018, at 7:02 PM, Steven Watanabe via Boost-users
>> <boost-users_at_[hidden]> wrote:
>>>>> <snip>
>>>>> Okay.  I see what's going on here.  Boost.Context
>>>>> only supports darwin and clang on OSX.
>>>>>
>>>>> You can work around the issue by finding this
>>>>> in libs/context/build/Jamfile.v2:
>>>>>
>>>>> # X86_64/SYSV/MACH-O
>>>>> alias asm_sources
>>>>>    : asm/make_x86_64_sysv_macho_gas.S
>>>>>      asm/jump_x86_64_sysv_macho_gas.S
>>>>>      asm/ontop_x86_64_sysv_macho_gas.S
>>>>>    : <abi>sysv
>>>>>      <address-model>64
>>>>>      <architecture>x86
>>>>>      <binary-format>mach-o
>>>>>      <toolset>clang
>>>>>    ;
>>>>>
>>>>> and making a copy, replacing clang with gcc.
>>>> This didn’t work, unfortunately the errors are the same as before.
>>> I assumed that you were building for x86_64.  If you're building
>>> for a different platform, then you'd need to find the alias for
>>> that architecture, instead.
>> Actually I'd like to understand what we did wrong.  Just to be clear
>> because terminology can be different, that's a full 64-bit build for
>> 64-bit Intel architecture, correct?
> Right. Hmm. The easiest way to debug this is to use
> --with-context --debug-building
> which will show the build properties.
> (--debug-building generates a lot of output, so it's
> better to restrict it to Boost.Context only, hence
> --with-context).
>
> In particular, check the values of <abi> and <binary-format>
> for the asm_sources target. <architecture> and <address-model>
> should be correct, especially since you're passing
> address-model explicitly, but it wouldn't hurt to check them
> as well.
>
>>   That is what we were after. Our
>> build command for a gcc release build was:
>>
>> ./b2 --toolset=gcc-8.1 address-model=64 --stagedir=./stage64release
>> --build-dir=./build64release --layout=system --without-mpi
>> variant=release link=shared threading=multi runtime-link=shared install
>> --prefix=./osx64release/indep --exec-prefix=./osx64release/bin
>> --libdir=./osx64release/lib --includedir=./osx64release/include
>>
>> user-config.jam entry is:
>>
>> # gcc 8
>> using gcc
>>     : 8.1
>>     : "/usr/local/bin/g++-8"
>>     ;
>>
We revisited this, and we got it to work building 1.67 with a Brew
installed gcc 8.  I thought I'd record it on the mailing list for anyone
else who might need it.  This is on OSX 10.13.5.  It needs a new asm
entry as above, under

# X86_64/SYSV/MACH-O

alias asm_sources
 Â Â  : asm/make_x86_64_sysv_macho_gas.S
 Â Â Â Â  asm/jump_x86_64_sysv_macho_gas.S
 Â Â Â Â  asm/ontop_x86_64_sysv_macho_gas.S
 Â Â  : <abi>sysv
 Â Â Â Â  <address-model>64
 Â Â Â Â  <architecture>x86
 Â Â Â Â  <binary-format>mach-o
 Â Â Â Â  <toolset>gcc
 Â Â  ;

and we modified the user-config.jam to contain

# gcc 8
using gcc
 Â Â Â  : 8.1
 Â Â Â  : "/usr/local/opt/gcc8/bin/g++-8"
 Â Â Â  : <cxxflags>"-std=c++14 -isystem /usr/local/opt/gcc8/include/c++/8.1.0"
 Â Â Â  ;

Debug b2 command was:
./b2 --toolset=gcc-8.1 address-model=64 --stagedir=./stage64debug
--build-dir=./build64debug --layout=system --without-mpi variant=debug
link=shared threading=multi runtime-link=shared install
--prefix=./osx64debug/indep --exec-prefix=./osx64debug/bin
--libdir=./osx64debug/lib --includedir=./osx64debug/include

Release is:
./b2 --toolset=gcc-8.1 address-model=64 --stagedir=./stage64release
--build-dir=./build64release --layout=system --without-mpi
variant=release link=shared threading=multi runtime-link=shared install
--prefix=./osx64release/indep --exec-prefix=./osx64release/bin
--libdir=./osx64release/lib --includedir=./osx64release/include

Damien



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net