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 642504 - [mingw/cygwin build] correctly export plugin description
[mingw/cygwin build] correctly export plugin description
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal normal
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-16 20:10 UTC by Mark Nauwelaerts
Modified: 2011-05-09 09:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure.ac: export plugin description more platform independent (874 bytes, patch)
2011-02-16 20:10 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2011-02-16 20:10:52 UTC
Created attachment 181047 [details] [review]
configure.ac: export plugin description more platform independent

[obviously applies not only to core]

GST_PLUGIN_LDFLAGS contains 
-export-symbols-regex '^[_]*gst_plugin_desc$'

However, on cygwin or a mingw32 (cross-compile) build, e.g. libgstcoreelements.exp contents is (or rather should be) as follows:
gst_plugin_desc DATA

That is, with the above regular expression (terminating $) it ends up empty.
In case of Cygwin, that seems to lead to falling back to exporting all non-static symbols, but on (at least some) mingw setups that leads to no exported symbols (at least not gst_plugin_desc), and so plugin .dll's are not recognized as such.

A minor tweak to the regular expression (as attached) handles the above .exp case without breaking (afaik) other build cases (note in particular that e.g.
GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*"
contains no such termination restriction).
Comment 1 Tim-Philipp Müller 2011-02-17 16:33:17 UTC
> GST_PLUGIN_LDFLAGS contains 
> -export-symbols-regex '^[_]*gst_plugin_desc$'
>
> However, on cygwin or a mingw32 (cross-compile) build, e.g.
> libgstcoreelements.exp contents is (or rather should be) as follows:
> gst_plugin_desc DATA
> 
> That is, with the above regular expression (terminating $) it ends up empty.
> In case of Cygwin, that seems to lead to falling back to exporting all
> non-static symbols, but on (at least some) mingw setups that leads to no
> exported symbols (at least not gst_plugin_desc), and so plugin .dll's are not
> recognized as such.

This looks like a bug elsewhere to me (libtool?). It's a regex for the *symbols* to be exported. The 'DATA' bit isn't part of the symbol, is it?

The [_]* bit at the front looks unnecessary to me and is likely a copy'n'paste mistake. The terminator seems correct to me.

I don't necessarily *mind* the patch - it's likely harmless, since no one will use symbols like gst_plugin_descwhatever in code (and if they do, who cares if that gets exported), but it still looks more like a bug to me.


> note in particular that e.g.
> GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*"
> contains no such termination restriction).

Well, of course not, since we really want to export everything that starts with gst or _gst and ends in whatever. Wheras for plugins we really just want to export the symbol called 'gst_plugin_desc' and nothing else.
Comment 2 Mark Nauwelaerts 2011-02-17 22:11:47 UTC
May or may not be a bug.  On the one hand, libtool is quite specific in its efforts to get the "DATA" part there [*].  On the other hand, do not know about "specs" clearly stating against which the regexp is matched (with DATA appended the regexp allows filtering on DATA or non-DATA symbols, in as far as that is useful).

[*] libtool: link: /usr/bin/i586-mingw32msvc-nm -B  .libs/libgstcoreelements_la-gstcapsfilter.o .libs/libgstcoreelements_la-gstelements.o .libs/libgstcoreelements_la-gstfakesrc.o .libs/libgstcoreelements_la-gstfakesink.o .libs/libgstcoreelements_la-gstfdsrc.o .libs/libgstcoreelements_la-gstfdsink.o .libs/libgstcoreelements_la-gstfilesink.o .libs/libgstcoreelements_la-gstfilesrc.o .libs/libgstcoreelements_la-gstidentity.o .libs/libgstcoreelements_la-gstinputselector.o .libs/libgstcoreelements_la-gstoutputselector.o .libs/libgstcoreelements_la-gstmultiqueue.o .libs/libgstcoreelements_la-gstqueue.o .libs/libgstcoreelements_la-gstqueue2.o .libs/libgstcoreelements_la-gsttee.o .libs/libgstcoreelements_la-gsttypefindelement.o .libs/libgstcoreelements_la-gstvalve.o   | sed -n -e 's/^.*[      ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][      ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/' | /bin/sed -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > .libs/libgstcoreelements.exp
Comment 3 Mark Nauwelaerts 2011-02-28 19:32:05 UTC
core:

commit ce52df3d72e8233399b3c5d0236234b82290ed7e
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 18:43:41 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----

-base:

commit 53c02dff3ffb8d728078a9b82c5bda20f6e9fb87
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 18:52:47 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----

-good:

commit ac6535560eaad91fe1eed4c1de7d159e66dfd2f7
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 19:13:41 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----

-ugly:

commit 466d0054c6ea01ed2ed8e2e6f469654d0f6896bd
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 19:27:21 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----

-ffmpeg:

commit 68e51f2a15907121bbd821b092796f443411a73c
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Thu Jan 27 22:22:22 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----
-bad:

commit ef7cad4176bfb429dda5c1b2923353a732b466fe
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 19:58:41 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----
gnonlin:

commit 87920a645058addc2a9e1eb1dcb466fb981dc8d4
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 20:26:33 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.

----
-gl:

commit 0048055ac97f3dada2aba526ab5ea1e7f76c1dff
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Feb 28 20:29:08 2011 +0100

    configure.ac: export plugin description more platform independent
    
    Fixes #642504.