After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617145 - Compile mplex element with with --enable-runtime-pseudo-reloc-v2 on Windows
Compile mplex element with with --enable-runtime-pseudo-reloc-v2 on Windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal blocker
: 0.10.19
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-29 00:49 UTC by LRN
Modified: 2010-05-25 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Compile mplex element with --enable-runtime-pseudo-reloc-v2 on Windows (2.13 KB, patch)
2010-04-29 00:51 UTC, LRN
none Details | Review
Compile mplex element with --enable-runtime-pseudo-reloc-v2 on Windows (10.13 KB, patch)
2010-05-01 02:16 UTC, LRN
reviewed Details | Review
Alternative light version - adds MPLEX_LDFLAGS (1.23 KB, patch)
2010-05-01 19:11 UTC, LRN
none Details | Review
Alternative light version - adds MPLEX_LDFLAGS variable (fixed) (1.81 KB, patch)
2010-05-07 12:44 UTC, LRN
committed Details | Review

Description LRN 2010-04-29 00:49:03 UTC
From MinGW GCC 4.5.0 README "Known Issues" section:
* When linking C++ modules with shared libstdc++ (the default), the
   linker may warn about activating auto-import. The workaround is to
   add one of the following flags:
   a) -Wl,--enable-runtime-pseudo-reloc-v2
      The warning is still printed, but is now harmless.
   b) -Wl,--enable-auto-import
      Actually does what the warning suggests.
   c) -static-libstdc++
      Avoids creating the issue in the first place.
   d) none of the above.
      You may get a 0xc0000005 error at runtime.

This is exactly what is happening to me - mplex conftest crashes with 0xC0000005 when compiled with GCC 4.5.0
Comment 1 LRN 2010-04-29 00:51:09 UTC
Created attachment 159838 [details] [review]
Compile mplex element with --enable-runtime-pseudo-reloc-v2 on Windows

This patch is by no means feature-complete. It lacks a check for g++ version (should only use --enable-runtime-pseudo-reloc-v2 with g++ >= 4.4.0 or so), but i don't know how to implement that in autoconf.
Comment 2 LRN 2010-05-01 02:16:16 UTC
Created attachment 160038 [details] [review]
Compile mplex element with --enable-runtime-pseudo-reloc-v2 on Windows

Added a check for g++ version
Comment 3 LRN 2010-05-01 19:11:24 UTC
Created attachment 160109 [details] [review]
Alternative light version - adds MPLEX_LDFLAGS

With MPLEX_LDFLAGS available, user can set it when calling configure script, i.e. it is up to user to do or not to do MPLEX_LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2"

This is an alternative to patch 160038
Comment 4 LRN 2010-05-07 12:44:27 UTC
Created attachment 160505 [details] [review]
Alternative light version - adds MPLEX_LDFLAGS variable (fixed)
Comment 5 Tim-Philipp Müller 2010-05-07 13:02:21 UTC
Marking as blocker so we look at it before the release.
Comment 6 Tim-Philipp Müller 2010-05-12 00:27:31 UTC
I think I prefer the non-light version. Things should just work out of the box, so we should detect when this is needed and add it. The compiler/version detection seems a bit convoluted though, couldn't we just do something like:

AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
#if !defined(__GNUC__) || !defined(__MINGW32__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
#error "Not MingW GCC or older than version 4.5"
#endif
]])], [
  EXTRA_MPLEX_LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2"
], [
  EXTRA_MPLEX_LDFLAGS=""
])
AC_LANG_POP([C++])

?

Also, could you by any chance give us a link or two that points to some background about why this is needed exactly?
Comment 7 LRN 2010-05-12 07:02:43 UTC
Ah, well, your test looks nicer than mine :)
I'm still not sure about "4.5 or later" thing. In theory we should i should have hit this issue long time ago, but i never did. I guess this only happens with g++ that links against shared libstdc++ (ffmpeg had this problem earlier, roughly at 4.3.0, for different reasons - see below), which became default in 4.5

As for background... maybe this - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40905 and http://lists-archives.org/mingw-users/16849-mingw-gcc-4-5-0-released.html
Comment 8 Tim-Philipp Müller 2010-05-21 19:36:16 UTC
So this is really a compiler/linker bug?
Comment 9 Benjamin Otte (Company) 2010-05-22 10:05:52 UTC
Otherwise it wouldn't be in the "known issues" section of the release notes, or?
Comment 10 Tim-Philipp Müller 2010-05-25 14:54:20 UTC
"Known issue" doesn't necessarily indicate whether it's considered a bug, or WONTFIX or SUCKSTOBEYOU. I don't think we should be hacking around compiler/linker bugs in our configure though, so I'll just commit the minimal patch after all I think:


commit 71b8d4b5cefafbffdef9541b10f84625de58f94f
Author: Руслан Ижбулатов <lrn1986@gmail.com>
Date:   Fri May 7 16:42:12 2010 +0400

    mplex: add MPLEX_LDFLAGS variable
    
    So mingw32 users can hack around a compiler/linker bug.
    
    Fixes #617145