Boost logo

Boost-Build :

Subject: Re: [Boost-build] Problem with pragma intrinsic(_InterlockedCompareExchange)
From: Jürgen Hunold (jhunold_at_[hidden])
Date: 2014-08-19 01:45:45


Hi Volodya, Hi Adam,

Am Dienstag, 19. August 2014, 09:28:21 schrieb Vladimir Prus:
> On 08/19/2014 08:44 AM, Adam Beneschan wrote:
> > I'm not an old hand at building Boost (I did install 1.55 on a different
> > machine), so sorry if this is a trivial question.
> >
> > I'm trying to build 1.56 on a Windows 8 system, using mingw and gcc.

You are omitting the most important information:

- which mingw (mingw.org or mingw-w64)
- which gcc version.

> > bootstrap.bat mingw
> > b2 toolset=gcc --build-type=complete stage
> >
> > This results in a number of occurrences of this message:
> >
> > ./boost/thread/win32/thread_primitives.hpp:180:0: warning: ignoring
> > #pragma intrinsic [-Wunknown-pragmas]>
> > #pragma intrinsic(_InterlockedCompareExchange)

This sounds like an older mingw.org gcc. Personally, I consider mingw.org
broken.

> > I can't link any program that needs -lboost_thread; it complains about
> > undefined references to _InterlockedCompareExchange.

Please attach the error messages next time. Or add a pastebin link.
Could you please go to libs\thread\test and run b2 there? If the units test
compile and link, then there is something wrong with your setup. You can then
extract the commandlines by running b2 -d+2 or b2 -a -n to see where they
differ.

> > Is this just a matter of adding __stdcall to the declaration of
> > _InterlockedCompareExchange in thread_primitives.hpp, or is a different
> > fix needed?

It works here. Using mingw-w64 with gcc-4.9.0.

> > Assuming I either fix the source myself or get a patch, how would I
> > rebuild without rebuilding all of Boost from scratch? Sorry if this
> > seems like a dumb question, but so far I've just followed instructions
> > without really knowing anything about b2, and I'm hoping not to have to
> > do another four-and-a-half-hour build.

> you would just run the same "b2" command you used, and it will rebuild the
> things that needs rebuilding.

Correct. But I fear you need a different mingw.

> I cannot comment on the best source-level fix though - Boost.Thread
> maintainers would have to answer that.

Current mingw-w64 mingw works out of the box. Just running the regression test
myself.

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold  ! 
* voice: ++49 4257 300       ! Fährstraße 1
* fax  : ++49 4257 300       ! 31609 Balge/Sebbenhausen
* jhunold_at_gmx.eu             ! Germany

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk