Hi, While trying to compile all Fedora packages against winpthreads [1] we found out that gstreamer fails to build with this linker error:
CCLD libgstreamer-0.10.la .libs/libgstreamer_0.10_la-gstsystemclock.o: In function `gst_system_clock_get_resolution': /builddir/build/BUILD/gstreamer-0.10.36/build_win32/gst/../../gst/gstsystemclock.c:550: undefined reference to `clock_getres' .libs/libgstreamer_0.10_la-gstsystemclock.o: In function `gst_system_clock_get_internal_time': /builddir/build/BUILD/gstreamer-0.10.36/build_win32/gst/../../gst/gstsystemclock.c:524: undefined reference to `clock_gettime' .libs/libgstreamer_0.10_la-gstutils.o: In function `gst_util_get_timestamp': /builddir/build/BUILD/gstreamer-0.10.36/build_win32/gst/../../gst/gstutils.c:3940: undefined reference to `clock_gettime' I took a closer look at this and here's what happens: The gstreamer configure script tests whether the #define's _POSIX_TIMERS and CLOCK_REALTIME are set. This test succeeds as these are both set in winpthreads' pthread_time.h. Therefore the build system makes the assumption that symbols like clock_getres and clock_gettime are available. The documentation about these clock_* symbols tells us that these symbols are POSIX specific and are part of libc (for glibc <= 2.17 the linker flag -lrt must be used) In mingw-w64 these symbols are exported in winpthreads, thus -lpthread need to be part of the linker flags. Gstreamer isn't aware that -lpthread needs to be part of the linker flags for these clock_* symbols and therefore the build fails. I could find any documentation that these clock_* symbols may be part of the pthread library so I think that in mingw-w64 these symbols shouldn't be exported in winpthreads. A more suitable place for these symbols would be the mingw-w64-crt so that each compiled binary can have access to these symbols. What are your opinions about this? Regards, Erik van Pienbroek [1]: http://sourceforge.net/mailarchive/message.php?msg_id=30821407 ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
