Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#9774 closed Bugs (fixed)

[libs/coroutine] Undefined symbols for architecture i386: _make_fcontext / _jump_fcontext

Reported by: class101 <ad@…> Owned by: olli
Milestone: To Be Determined Component: context
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: ad@…

Description

This bug also affects 1.55, libs/couroutine is the only module I can't build for a target-os=darwin with clang-darwin-4.2.1

Command used:

b2 -j1 -d2 -q toolset=clang-darwin variant=release abi=sysv address-model=32_64 binary-format=mach-o link=static,shared pch=off strip=on target-os=darwin threading=multi threadapi=pthread cxxflags="-w -arch i386 -arch x86_64" linkflags="-w -arch i386 -arch x86_64 -lstdc++" --stagedir=stage32_64 --with-coroutine

Returns:

    "X:/libs/gcc-clang-3.4-x86_64-apple-darwin10/bin/clang.exe" -w -arch i386 -arch x86_64 -lstdc++ -w -arch i386 -arch x86_64 -lstdc++  -o "bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\add
ress-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\libboost_coroutine-clang-darwin42-mt-1_56.dylib" -single_module -dynamiclib -install_name "libboost_co
routine-clang-darwin42-mt-1_56.dylib" "bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-mu
lti\detail\coroutine_context.o" "bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\ex
ceptions.o" "bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\protected_stack_alloca
tor_posix.o" "bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\standard_stack_alloca
tor.o" "bin.v2\libs\chrono\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\libboost_chrono-clang-darwin42
-mt-1_56.dylib" "bin.v2\libs\thread\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\libboost_thread_pthre
ad-clang-darwin42-mt-1_56.dylib" "bin.v2\libs\system\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\libb
oost_system-clang-darwin42-mt-1_56.dylib" "bin.v2\libs\context\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-
multi\libboost_context-clang-darwin42-mt-1_56.dylib"

Undefined symbols for architecture i386:
  "_make_fcontext", referenced from:
      boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(long), boost::coroutines::stack_context const&) in bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-
32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\detail\coroutine_context.o
      boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(long), boost::coroutines::stack_context const&) in bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-
32_64\binary-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\detail\coroutine_context.o
  "_jump_fcontext", referenced from:
      boost::coroutines::detail::coroutine_context::jump(boost::coroutines::detail::coroutine_context&, long, bool) in bin.v2\libs\coroutine\build\clang-darwin-4.2.1\release\abi-sysv\address-model-32_64\binar
y-format-mach-o\pch-off\strip-on\target-os-darwin\threadapi-pthread\threading-multi\detail\coroutine_context.o
ld: symbol(s) not found for architecture i386
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)

Off-Topic: You mention to report to boost-track successfull builds but I don't know where is this so please note that I have tested to remove the untested.cpp from the libs\context\build\Jamfile.v2 for address-model=32_64 binary-format=mach-o and it worked fine!

Change History (19)

comment:1 by class101 <ad@…>, 9 years ago

To note that it affects the shared lib only, the static lib is properly generated for both arch i386/x86_64 in libboost_coroutine-clang-darwin42-mt-1_56.a

comment:2 by olli, 9 years ago

Could you try the version from branch develop, please?

comment:3 by class101 <ad@…>, 9 years ago

Hello olli, I have followowed the instruction to get the modularboost from git working based on this article [1] I'm already on the branche develop right ?

[1] https://svn.boost.org/trac/boost/wiki/TryModBoost

comment:4 by class101 <ad@…>, 9 years ago

Nvm I got your last changes I did a pull of develop and then a submodules update

The changes you have made litterally fixed all my problems, Good job !!!

Success builds:

target: x86_64-w64-mingw32-seh => OK

SET PATH=X:\libs\gcc-4.8.2-x86_64-w64-mingw32-seh\bin;%PATH%
b2 -j10 -d0 toolset=gcc variant=release abi=ms address-model=64 link=static,shared strip=on target-os=windows threading=multi threadapi=win32 cxxflags=-w linkflags=-w --stagedir=stage64 --without-python --without-mpi

target: i686-w64-mingw32-dw4 => OK

SET PATH=X:\libs\gcc-4.8.2-i686-w64-mingw32-dw4\bin;%PATH%
b2 -j10 -d0 toolset=gcc variant=release abi=ms address-model=32 link=static,shared strip=on target-os=windows threading=multi threadapi=win32 cxxflags=-w linkflags=-w --stagedir=stage32 --without-python --without-mpi

target: x86_64-unknown-linux-gnu => OK

SET PATH=X:\libs\gcc-4.8.2-x86_64-unknown-linux\bin;%PATH%
b2 -j10 -d0 toolset=gcc variant=release abi=sysv address-model=64 binary-format=elf link=static,shared pch=off strip=on target-os=linux threading=multi threadapi=pthread cxxflags="-w -m64" linkflags="-w -m64" --stagedir=stage64 --without-python --without-mpi

target: i686-unknown-linux-gnu => OK (now passes)

SET PATH=X:\libs\gcc-4.8.2-x86_64-unknown-linux\bin;%PATH%
b2 -j10 -d0 toolset=gcc variant=release abi=sysv address-model=32 binary-format=elf link=static,shared pch=off strip=on target-os=linux threading=multi threadapi=pthread cxxflags="-w -m32" linkflags="-w -m32" --stagedir=stage32 --without-python --without-mpi

target: x86_64-apple-darwin10 (no-multiarch) => OK (now passes)

SET PATH=X:\libs\gcc-clang-3.4-x86_64-apple-darwin10\bin;%PATH%
b2 -j10 -d0 toolset=clang-darwin variant=release abi=sysv address-model=64 binary-format=mach-o link=static,shared pch=off strip=on target-os=darwin threading=multi threadapi=pthread cxxflags="-w -arch x86_64" linkflags="-w -arch x86_64 -lstdc++" --stagedir=stage64 --without-python --without-mpi

target: i686-apple-darwin10 (no-multiarch) => OK (now passes)

SET PATH=X:\libs\gcc-clang-3.4-x86_64-apple-darwin10\bin;%PATH%
b2 -j10 -d0 toolset=clang-darwin variant=release abi=sysv address-model=32 binary-format=mach-o link=static,shared pch=off strip=on target-os=darwin threading=multi threadapi=pthread cxxflags="-w -arch i386" linkflags="-w -arch i386 -lstdc++" --stagedir=stage32 --without-python --without-mpi

target: x86_64-apple-darwin10 (MULTIARCH) => OK (now passes)

SET PATH=X:\libs\gcc-clang-3.4-x86_64-apple-darwin10\bin;%PATH%
b2 -j10 -d0 toolset=clang-darwin variant=release abi=sysv address-model=32_64 binary-format=mach-o link=static,shared pch=off strip=on target-os=darwin threading=multi threadapi=pthread cxxflags="-w -arch i386 -arch x86_64" linkflags="-w -arch i386 -arch x86_64 -lstdc++" --stagedir=stage32_64 --without-python --without-mpi

[1] the windows toolchains : https://drive.google.com/folderview?id=0B4dcRcayW88VNmRtZDEybEZoLTQ&usp=sharing

comment:5 by olli, 9 years ago

Resolution: fixed
Status: newclosed

OK, thx

comment:6 by class101 <ad@…>, 9 years ago

Resolution: fixed
Status: closedreopened

Tested today with the same parameters as my original ticket and it is failing

Fails only for 32_64, is ok for 64 or 32 only arch

On

Revision: db370aae7542bdaa1a7fe3a13a918eccc3b49727
Author: Automated Commit <automated@calamity.org.uk>
Date: 04/04/2014 09:00:06
Message:
Update fusion from develop.
----
Modified: libs/fusion

Params:

b2 -j1 -d2 -q toolset=clang-darwin variant=release abi=sysv address-model=32_64 binary-format=mach-o link=static,shared pch=off target-os=darwin threadapi=pthread cxxflags="-w -O2 -arch i386 -arch x86_64" linkflags="-w -arch i386 -arch x86_64 -lstdc++" --with-coroutine

comment:7 by class101 <ad@…>, 9 years ago

More readable params

b2 -j1 -d2 -q toolset=clang-darwin \
              variant=release      \
              abi=sysv             \
              address-model=32_64  \
              binary-format=mach-o \
              link=static,shared   \
              pch=off              \
              target-os=darwin     \
              threadapi=pthread    \
              cxxflags="-w -O2 -arch i386 -arch x86_64" linkflags="-w -arch i386 -arch x86_64 -lstdc++"
              --with-coroutine

comment:8 by olli, 9 years ago

can you post the error and the output of b2 cmd like:

  • symlinks supported : yes (cached)
  • 32-bit : no (cached)
  • 64-bit : yes (cached)
  • arm : no (cached)
  • mips1 : no (cached)
  • power : no (cached)
  • sparc : no (cached)
  • x86 : yes (cached)

and the output if you call your b2 cmdline with additional option --debug-building

comment:10 by class101 <ad@…>, 9 years ago

In case it is of any help

The last libboost_coroutine-clang-darwin42-mt-1_56.dylib I have been able to generate was from 26 March 2014 4:37PM CET/CEST and if I look the revision it is corresponding to this one

Revision: dfee167c036a78139eafa37227081537d019fee1
Author: Automated Commit <automated@calamity.org.uk>
Date: 26/03/2014 15:00:06
Message:
Update multiprecision from develop.
----
Modified: libs/multiprecision


So technically the regression comes from a changes made after, let me know if I can be of any small help

comment:11 by olli, 9 years ago

did you fetch the latest version of boost.context?

comment:12 by class101 <ad@…>, 9 years ago

yes (at least I think)

this is was the last log is about in libs/context

Revision: cd49a86006e967e40820828faa4649c31d2811bc
Author: Oliver Kowalke <oliver.kowalke@gmx.de>
Date: 30/03/2014 19:41:04
Message:
Revert "change labels for i386/mach-o/darwi"

This reverts commit c338020df9cf480e4012e588dffbe6f1e662c145.
----
Modified: src/asm/jump_i386_sysv_macho_gas.S
Modified: src/asm/make_i386_sysv_macho_gas.S

comment:13 by class101 <ad@…>, 9 years ago

I can give more infos

I reverted context + coroutine before the 26th , still failing I revert tools/build to 9732c695d1160c2a35c8dc7634de5ff02a7e82f2 , it works

so the issue lies in a boost/build change from 26 to now

comment:14 by Steven Watanabe, 9 years ago

It was broken by https://github.com/boostorg/build/commit/5c1a97b92854e35ca35c68365babe418d44979ed. Passing cxxflags to the assembler is wrong and will not work for most toolsets. cflags appears to be correct according to the docs, even though it's still weird.

comment:15 by class101 <ad@…>, 9 years ago

yes with elimination I was able to find out it was from this revision the failure

Revision: 5c1a97b92854e35ca35c68365babe418d44979ed
Author: Steven Watanabe <steven@providere-consulting.com>
Date: 28/03/2014 23:45:40
Message:
cxxflags should not apply to C files.  Fixes #9815.
----
Modified: src/tools/borland.jam
Modified: src/tools/clang-darwin.jam
Modified: src/tools/intel-darwin.jam
Added: test/feature_cxxflags.py
Modified: test/test_all.py

comment:16 by olli, 9 years ago

means that this ticket can be closed?

comment:17 by class101 <ad@…>, 9 years ago

Imo yes, it is just a configuration change on boost.build I missed, I fixed it here on the command line by duplicating what I have put in cxxflags to cflags. thx steven for helping out

comment:18 by olli, 9 years ago

Resolution: fixed
Status: reopenedclosed

comment:19 by olli, 8 years ago

Component: coroutinecontext
Note: See TracTickets for help on using tickets.