Opened 13 years ago

Last modified 13 years ago

#3430 new Bugs

Build boost.regex shared-link 1.40 under mingw 3.4

Reported by: Oleg Tsarev <zabivator@…> Owned by: Vladimir Prus
Milestone: Boost 1.41.0 Component: build
Version: Boost 1.40.0 Severity: Problem
Keywords: bjam Cc:

Description

I try build boost.regex under mingw 3.4 (include in Qt SDK) I add mingw to PATH enviroment variable, than run: bootstrap.bat bjam.exe --build_type=complete --toolset=gcc --with-regex --with-program_options variant=release link=shared runtime-link=shared stage

bjam build static lib version of boost.regex. It i use msvc2008 console tool, and use toolset "msvc-9.0" shared version build correct.

It's like on bug. Thank you!

Attachments (3)

build.boost.log (26.4 KB ) - added by zabivator@… 13 years ago.
regex_failed.zip (122.1 KB ) - added by crisb 13 years ago.
output of bjam toolset=gcc link=shared on mingw gcc 4.4.0 (win7)
regex_stack.txt (3.3 KB ) - added by crisb 13 years ago.
stack trace from running regex_regress

Download all attachments as: .zip

Change History (22)

comment:1 by Oleg Tsarev <zabivator@…>, 13 years ago

"It i use msvc2008 console tool, and use toolset "msvc-9.0" shared version build correct. " Of course, "when i use"

comment:2 by John Maddock, 13 years ago

Component: regexbuild
Owner: changed from John Maddock to Vladimir Prus

As this is a Boost.Build issue, I'm reassinging.

comment:3 by Vladimir Prus, 13 years ago

Could you please add the --debug-building option to bjam command line and report the output? You don't need to clean anything, just run this command. Please attach the output, as it will be too long for comment.

by zabivator@…, 13 years ago

Attachment: build.boost.log added

comment:4 by zabivator@…, 13 years ago

I run bjam.exe --build_type=complete --toolset=gcc --with-regex variant=release link=shared --debug-building runtime-link=shared stage As result i found libboost..... (static version) build log in attach

comment:5 by Vladimir Prus, 13 years ago

John, I see <toolset>gcc-mingw:<link>static in requirements for boost-regex. Is this still necessary or I can remove it (as well as similar requirement for cygwin)?

comment:6 by John Maddock, 13 years ago

I believe static linking is a necessary requirement yes. Last time I checked the shared libraries segfaulted on that platform, there seems to be an issue with gcc here :-(

John.

comment:7 by Vladimir Prus, 13 years ago

Then, there's no bug here?

comment:8 by anonymous, 13 years ago

I edit libs/regex/build/Jamfile.v2 and built shared version of boost.regex. How can i test it? Boost have regeression test, than boost have tools for run all tests. How?

comment:9 by anonymous, 13 years ago

*than boost have tools Of course "then boost have tools"

comment:10 by Vladimir Prus, 13 years ago

Running "bjam link=shared" in libs/regex/test directory should be enough. Let me know what results you get.

comment:11 by Vladimir Prus, 13 years ago

Oleg, did you manage to run the tests, and if so, what are the results.

Unless it's definitely established that shared build of boost.regex indeed works, I plan to close this issue as not an issue.

Thanks, Volodya

by crisb, 13 years ago

Attachment: regex_failed.zip added

output of bjam toolset=gcc link=shared on mingw gcc 4.4.0 (win7)

comment:12 by crisb, 13 years ago

output from

bjam toolset=gcc link=shared

with boost 1.40.0, having first enabled shared build on mingw (using mingw gcc 4.4.0).

output attached.

comment:13 by Vladimir Prus, 13 years ago

John, could you check if the errors in the attached log look like the errors you were working around by forcing link=static?

Thanks, Volodya

comment:14 by anonymous, 13 years ago

No these are something new I believe - it looks like the Mingw guys have fixed a few issues, but that throwing exceptions across dll-boundaries is still a no-go. Unless there's some magic build option we're missing?

John.

comment:15 by crisb, 13 years ago

is this really about throwing exceptions across boundaries? some of these tests arent meant to throw any exceptions at all, yet throw a bad_cast exception. is this not now some other problem?

by the looks of it g++ 4.4.0 should work with throwing exceptions across dll boundaries. it automatically uses -shared=libgcc when running g++ in order to support this.

by crisb, 13 years ago

Attachment: regex_stack.txt added

stack trace from running regex_regress

comment:16 by John Maddock, 13 years ago

Thanks for the stack trace, however, now I'm more confused than ever :-(

Note that:

  • We don't have this issue with gcc on any other platform.
  • The issue goes away as soon as you static link.
  • The exception being thrown is a result of a std::out_of_range trying to be thrown and failing... looks like the std lib is holed somewhere.

Which all screams gcc-bug I'm afraid.

I've also spent several hours now trying and failing to get a working up-to-date mingw install on my Vista machine, and have now given up... sorry but unless someone can actually tell me what the problem is, I'm inclined to shrug and move on at this point. Anyone know if the manual install instructions here - http://www.mingw.org/wiki/Getting_Started - are supposed to work on Vista?

The only thing I can think of to try, is defining BOOST_REGEX_NO_EXTERNAL_TEMPLATES in boost/regex/user.hpp and rebuild *everything* and see if that helps.

John.

comment:17 by crisb, 13 years ago

BOOST_REGEX_NO_EXTERNAL_TEMPLATES did indeed help! All tests passed. Thanks! What does this mean then? ;)

about your other problem - I managed to install on Win7 with no troubles whatsoever following those instructions.

comment:18 by John Maddock, 13 years ago

BOOST_REGEX_NO_EXTERNAL_TEMPLATES did indeed help! All tests passed. 
Thanks! What does this mean then? ;)

It means it might work, or it might not!

Normally the regex library instantiates the most commonly used templates in the library - as this speeds up compilation times no end - as well as reducing binary sizes. Defining BOOST_REGEX_NO_EXTERNAL_TEMPLATES disables this, so the same templates end up getting instantiated in both the dll and the application. Frankly if this doesn't work though, then I do wonder whether there isn't some hidden bug in gcc relating to sharing template instances across dll-boundaries :-(

I will try and investigate some more though.

about your other problem - I managed to install on Win7 
with no troubles whatsoever following those instructions.

Sigh... for me not only does gcc crash and burn when I try and compile a hello-world app... it actually managed to bring down my whole machine :-(

Cheers, John.

comment:19 by John Maddock, 13 years ago

Volodya,

Is there any way we can enable shared lib builds only for mingw-gcc >= 4.4 ?

Thanks, John.

Note: See TracTickets for help on using tickets.