boostorg / context

305 stars 150 forks source link

1.85.0 Beta 1 RC 1 does not build on Mac OS X with gcc #255

Closed mclow closed 8 months ago

mclow commented 8 months ago

Copied from the ML (thanks to Matt Borland for the report)

I have successfully built the libraries on M1 Mac running macOS Sonoma 14.3.1 with Clang 17.0.6 using cxxstd=11,14,17,20,23.

On the same platform using homebrew gcc-13 13.2.0 I get build failures with boost.fiber and boost.coroutine.

b2 has the following error:

error: No best alternative for libs/context/build/asm_sources with aapcs 64 arm off mach-o any_io_executor std fcontext off iso 17 off 64 arm on off full shared speed MACOSX on on off off 3.11 abi address-model architecture binary-format toolset on off shared native off darwin on pthread multi 13 gcc release off hidden off on no match: aapcs 32 arm elf multi clang no match: aapcs 32 arm elf multi gcc no match: aapcs 32 arm elf multi qcc no match: aapcs 32 arm mach-o multi clang no match: aapcs 32 arm mach-o multi darwin no match: aapcs 32 arm pe multi msvc no match: aapcs 64 arm elf multi clang no match: aapcs 64 arm elf multi gcc no match: aapcs 64 arm mach-o multi clang no match: aapcs 64 arm mach-o multi darwin no match: aapcs 64 arm pe multi msvc no match: sysv 64 loongarch elf multi gcc no match: o32 32 mips elf multi clang no match: o32 32 mips elf multi gcc no match: n64 64 mips elf multi clang no match: n64 64 mips elf multi gcc no match: sysv 32 power elf multi clang no match: sysv 32 power elf multi gcc no match: sysv 32 power mach-o multi clang no match: sysv 32 power mach-o multi gcc no match: sysv 32 power mach-o multi darwin no match: sysv 32 power xcoff multi clang no match: sysv 32 power xcoff multi gcc no match: sysv 64 power elf multi clang no match: sysv 64 power elf multi gcc no match: sysv 64 power mach-o multi clang no match: sysv 64 power mach-o multi gcc no match: sysv 64 power mach-o multi darwin no match: sysv 64 power xcoff multi clang no match: sysv 64 power xcoff multi gcc no match: sysv 32_64 power mach-o multi no match: sysv 64 riscv elf multi clang no match: sysv 64 riscv elf multi gcc no match: sysv 64 s390x elf multi gcc no match: sysv 64 s390x elf multi clang no match: sysv 32 x86 elf multi clang no match: sysv 32 x86 elf multi gcc no match: sysv 32 x86 elf multi intel no match: sysv 32 x86 mach-o multi clang no match: sysv 32 x86 mach-o multi darwin no match: ms 32 x86 pe multi clang no match: ms 32 x86 pe multi clang-win no match: ms 32 x86 pe multi gcc no match: ms 32 x86 pe multi intel no match: ms 32 x86 pe multi msvc no match: ms 32 x86 pe multi embarcadero no match: ms 32 x86 pe multi borland no match: sysv 64 x86 elf multi clang no match: sysv 64 x86 elf multi gcc no match: sysv 64 x86 elf multi intel no match: sysv 64 x86 mach-o multi clang no match: sysv 64 x86 mach-o multi gcc no match: sysv 64 x86 mach-o multi darwin no match: sysv 64 x86 mach-o multi intel no match: ms 64 x86 pe multi clang no match: ms 64 x86 pe multi clang-win no match: ms 64 x86 pe multi gcc no match: ms 64 x86 pe multi intel no match: ms 64 x86 pe multi msvc no match: ms 64 x86 pe multi embarcadero no match: x32 32 x86 elf multi clang no match: x32 32 x86 elf multi gcc no match: x32 32 x86 elf multi intel no match: sysv 32_64 x86 mach-o multi no match: sysv arm+x86 mach-o multi

Boost.Fiber fails with:

gcc.link.dll bin.v2/libs/fiber/build/gcc-13/release/cxxstd-17-iso/threading-multi/visibility-hidden/libboost_fiber.dylib ld: warning: -single_module is obsolete ld: warning: ignoring duplicate libraries: '-lgcc' ld: Undefined symbols: _jump_fcontext, referenced from: ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS_6fibers23stack_allocator_wrapperESt5_BindIFMNS5_18dispatcher_contextEFS4_OS4_EPS8_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE in context.o ZN5boost6fibers19context_initializer10initializeENS_13intrusive_ptrINS0_4algo9algorithmEEEONS0_23stack_allocator_wrapperE.isra.0 in context.o ZN5boost6fibers19context_initializer10initializeENS_13intrusive_ptrINS0_4algo9algorithmEEEONS0_23stack_allocator_wrapperE.isra.0 in context.o ZN5boost6fibers5fiber4joinEv in fiber.o ZN5boost6fibers5fiber6detachEv in fiber.o ZN5boost6fibers9schedulerD1Ev in scheduler.o ZN5boost6fibers9schedulerD1Ev in scheduler.o ... _make_fcontext, referenced from: __ZN5boost6fibers19context_initializer10initializeENS_13intrusive_ptrINS0_4algo9algorithmEEEONS0_23stack_allocator_wrapperE.isra.0 in context.o _ontop_fcontext, referenced from: ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS_6fibers23stack_allocator_wrapperESt5_BindIFMNS5_18dispatcher_contextEFS4_OS4_EPS8_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE in context.o ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS_6fibers23stack_allocator_wrapperESt5_BindIFMNS5_18dispatcher_contextEFS4_OS4_EPS8_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE in context.o ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS_6fibers23stack_allocator_wrapperESt5_BindIFMNS5_18dispatcher_contextEFS4_OS4_EPS8_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE in context.o ZN5boost7context6detail11fiber_ontopINS0_5fiberEZNS_6fibers7context15suspend_with_ccEvEUlOS3_E_EENS1_10transfertES8 in context.o ZN5boost7context6detail11fiber_ontopINS0_5fiberEZNS_6fibers7context6resumeEvEUlOS3_E_EENS1_10transfertES8 in context.o __ZN5boost7context6detail11fiber_ontopINS0_5fiberEZNS_6fibers7context6resumeERSt11unique_lockINS4_6detail13spinlock_ttasEEEUlOS3_E_EENS1_10transfertESD in context.o __ZN5boost6fibers7contextD1Ev in context.o ... collect2: error: ld returned 1 exit status

and Boost.Coroutine fails with:

gcc.link.dll bin.v2/libs/coroutine/build/gcc-13/release/cxxstd-17-iso/threading-multi/visibility-hidden/libboost_coroutine.dylib ld: warning: -single_module is obsolete ld: warning: ignoring duplicate libraries: '-lgcc' ld: Undefined symbols: _jump_fcontext, referenced from: ZN5boost10coroutines6detail17coroutine_context4jumpERS2_Pv in coroutine_context.o _make_fcontext, referenced from: __ZN5boost10coroutines6detail17coroutine_contextC2EPFvNS_7context6detail10transfer_tEERKNS1_12preallocatedE in coroutine_context.o ZN5boost10coroutines6detail17coroutine_contextC1EPFvNS_7context6detail10transfer_tEERKNS1_12preallocatedE in coroutine_context.o collect2: error: ld returned 1 exit status

Here is a gist with the complete build log:

https://gist.github.com/mborland/781bf2740c30a2af93d1cdcbcb132337

pdimov commented 8 months ago
error: No best alternative for libs/context/build/asm_sources with <abi>aapcs <address-model>64 <architecture>arm
<asynch-exceptions>off <binary-format>mach-o <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std
<context-impl>fcontext <coverage>off <cxxstd-dialect>iso <cxxstd>17 <debug-symbols>off
<deduced-address-model>64 <deduced-architecture>arm <exception-handling>on <extern-c-nothrow>off
<inlining>full <link>shared <optimization>speed <os>MACOSX <pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off <python>3.11 <relevant>abi <relevant>address-model <relevant>architecture
<relevant>binary-format <relevant>toolset <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native
<strip>off <target-os>darwin <testing.execute>on <threadapi>pthread <threading>multi <toolset-gcc:version>13
<toolset>gcc <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on

    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>elf <threading>multi <toolset>qcc
    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>aapcs <address-model>32 <architecture>arm <binary-format>pe <threading>multi <toolset>msvc
    no match: <abi>aapcs <address-model>64 <architecture>arm <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>aapcs <address-model>64 <architecture>arm <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>aapcs <address-model>64 <architecture>arm <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>aapcs <address-model>64 <architecture>arm <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>aapcs <address-model>64 <architecture>arm <binary-format>pe <threading>multi <toolset>msvc
    no match: <abi>sysv <address-model>64 <architecture>loongarch <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>o32 <address-model>32 <architecture>mips <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>o32 <address-model>32 <architecture>mips <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>n64 <address-model>64 <architecture>mips <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>n64 <address-model>64 <architecture>mips <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>mach-o <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>xcoff <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>power <binary-format>xcoff <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>mach-o <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>xcoff <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>power <binary-format>xcoff <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>32_64 <architecture>power <binary-format>mach-o <threading>multi
    no match: <abi>sysv <address-model>64 <architecture>riscv <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>riscv <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>s390x <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>s390x <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>intel
    no match: <abi>sysv <address-model>32 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>32 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>clang
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>clang-win
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>gcc
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>intel
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>msvc
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>embarcadero
    no match: <abi>ms <address-model>32 <architecture>x86 <binary-format>pe <threading>multi <toolset>borland
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>elf <threading>multi <toolset>intel
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>clang
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>gcc
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>darwin
    no match: <abi>sysv <address-model>64 <architecture>x86 <binary-format>mach-o <threading>multi <toolset>intel
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>clang
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>clang-win
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>gcc
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>intel
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>msvc
    no match: <abi>ms <address-model>64 <architecture>x86 <binary-format>pe <threading>multi <toolset>embarcadero
    no match: <abi>x32 <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>clang
    no match: <abi>x32 <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>gcc
    no match: <abi>x32 <address-model>32 <architecture>x86 <binary-format>elf <threading>multi <toolset>intel
    no match: <abi>sysv <address-model>32_64 <architecture>x86 <binary-format>mach-o <threading>multi
    no match: <abi>sysv <architecture>arm+x86 <binary-format>mach-o <threading>multi
pdimov commented 8 months ago

That's actually a problem in Context, and the fix is fairly trivial. This section from build/Jamfile:

https://github.com/boostorg/context/blob/77de3d527c62b639d7a6ca98c86b231f9f33eb58/build/Jamfile.v2#L210-L231

is missing a <toolset>gcc alternative.

Or, another way to fix it is to just remove the <toolset> conditions from most places, including this one.

mclow commented 8 months ago

Here is a gist with the complete build log:

https://gist.github.com/mborland/781bf2740c30a2af93d1cdcbcb132337

olk commented 8 months ago

untested because I don't own a Mac OS running on AMR64