Closed hanetzer closed 6 years ago
I suspect that this is not a Boost.Thread issue ;-) it is about pthread library.
@viboes I don't know, but the library 'libpthreadGC2.a' is hardcoded in at least one place in the boost distro tarball, being tools/build/src/engine/boehm_gc/threadlibs.c
around line 48 or so.
@viboes seriously? This is a buildfile issue on your guys's end, you hardcode the check for libpthreadGC2.a in https://github.com/boostorg/thread/blob/develop/build/Jamfile.v2#L214 This is NOT invalid.
Sorry, you message was not clear enough.
Please, create a bug issue for Boost.Build. Boost.Thread has nothing to do how Boost?Build links with external libraries :(
@viboes well can you point me at the proper location to file said bug? boostorg/build? or on that svn/trac thing I've found boost bugs on?
I believe Boost.Build accepts issues on github
I've take a look at the Jamfile and I see something that can be related
if <toolset>gcc in $(properties)
{
libname = lib$(libname)GC2.a ;
}
I'm not sure how cross-compiling should work on Boost.Thread. Any help welcome.
what command are you using?
Is this related https://sourceware.org/ml/pthreads-win32/2011/msg00027.html?
Would https://github.com/boostorg/thread/pull/160 help?
@hanetzer did you try to compile Boost.Thread using threadapi=win32
on the command line?
@karzhenkov yes, it will compile with threadapi=win32
, but ideally I should be able to take advantage of mingw-w64's pthread libraries.
Could you tell me which command do you use and what are the values of
With witch library would you like to link and how would you like to tell it to Boost.Thread?
@viboes the problem is not about cross-compiling. With mingw-w64 on Windows (when it is both a host and a target) result is the same. The only difference is default threadapi
, but this is the issue #160.
The line containing "...GC2.a" in Jamfile exists since 2007. I guess that the mingw has changed significantly in the meantime. The "mingw-w64" and original "mingw" are related but different projects. The original "mingw" has almost no activity since 2013.
@karzhenkov exactly. The libpthreadGC2 library is from an external project which according to some folks on irc.oftc.net/#mingw-w64 is only capable of 32-bit operation, and minw-w64's runtime provides its own pthread library, which is usually installed by default for most distro's mingw packages (which are more often than not is mingw-w64, and not the original, legacy mingw).
Could one of you provide a patch for mingw-w64?
Hi, I received the following at 03:06 but it seems it was removed.
@viboes
compile command line: b2 --user-config=/tmp/portage/dev-libs/boost-1.65.0-r1/work/boost_1_65_0-abi_x86_32.x86/user-config.jam gentoorelease -j16 -q -d+2 -sICU_PATH=/usr --without-mpi --without-context --without-coroutine --without-fiber pch=off --boost-build=/usr/share/boost-build --prefix=/tmp/portage/dev-libs/boost-1.65.0-r1/image/usr --layout=system threading=multi link=shared -sNO_BZIP2=1 target-os=windows --without-python
user-config.jam:
using gcc : 6.4 : i686-w64-mingw32-g++ :
build.log: https://bpaste.net/show/0f4ad2771c83
if you need any other info, please let me know.
Could you try --without-log and report the build.log?
@viboes actually that was a different command line, I was mistaken on it.
Ok. I propose to remove this comment and the preceding 3.
A PR fixing this issue is welcome.
@viboes I personally have nothing in the way of skills in this area. I would gladly fix it myself, but it is beyond me atm. I'm just a consumer of the library and not a direct developer using it. I just know that there is a more 'native' mingw-w64 pthreads library which is already there, and does not require an external, unmaintained package.
@hanetzer you can start by commenting out this line https://github.com/boostorg/thread/blob/e848363029b0267c8b1de98b64026f7ab044680d/build/Jamfile.v2#L270 and solving this compile errors
Do not pay attention to this message:
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
you will link by using linkflags=-pthread
or modifying Boost.Build src/tools/gcc.jam#L377
@Kojoley oof. that's an ugly amount of issues to fix up. I'll go ahead and give it the good ol' college try, may need to have some talks with the fine folks in the #mingw-w64 irc chan on that.
If someone has time to spend on this platform, please provide a PR.
As above. The mingw-w64 runtime can produce a set of pthread dlls and import libraries (usr/bin/libwinpthread-1.dll, usr/lib/libpthread.a, usr/lib/libpthread.dll.a, usr/lib/libwinpthread.a, and usr/lib/libwinpthread.dll.a) which can be used just like the linux ones, whereas I have no idea where libpthreadGC2.a even comes from.