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 747730 - osx: fails to build tests/examples/streams/rtpool-test
osx: fails to build tests/examples/streams/rtpool-test
Status: RESOLVED DUPLICATE of bug 747954
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 737030 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-04-12 10:01 UTC by Julien Isorce
Modified: 2015-06-13 23:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
examples: fix rtpool-test build on osx with clang (1.46 KB, patch)
2015-04-12 10:07 UTC, Julien Isorce
none Details | Review

Description Julien Isorce 2015-04-12 10:01:50 UTC
It fails with "clang: error: argument unused during compilation: -pthread" because -pthread option is only accepted by the compiler, not the linker. Also see http://stackoverflow.com/questions/17841140/os-x-clang-pthread .
clangs --help | grep pthread: "-pthread   Support POSIX threads in generated code"

PTHREAD_LIBS does not contain -pthread, only PTHREAD_CFLAGS contains -pthread.
But the problem is that automake passes rtpool_test_CFLAGS to the linker:

rtpool_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rtpool_test_CFLAGS) \
        $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@

rtpool-test$(EXEEXT): $(rtpool_test_OBJECTS) $(rtpool_test_DEPENDENCIES) $(EXTRA_rtpool_test_DEPENDENCIES)
        @rm -f rtpool-test$(EXEEXT)
        $(AM_V_CCLD)$(rtpool_test_LINK) $(rtpool_test_OBJECTS) $(rtpool_test_LDADD) $(LIBS)

So in the end -pthread is passed to the linker which result to an error.
We could argue to just remove -Werror but maybe it's better to find a way to avoid forwarding -pthread to the linker, see following patch.
Comment 1 Julien Isorce 2015-04-12 10:07:21 UTC
Created attachment 301407 [details] [review]
examples: fix rtpool-test build on osx with clang

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

In generated Makefile it now looks like:
rtpool-test$(EXEEXT): $(rtpool_test_OBJECTS) $(rtpool_test_DEPENDENCIES) $(EXTRA_rtpool_test_DEPENDENCIES)
        @rm -f rtpool-test$(EXEEXT)
        $(AM_V_GEN)$(rtpool_test_LINK) $(rtpool_test_OBJECTS) $(rtpool_test_LDADD) $(LIBS)
Comment 2 Sebastian Dröge (slomo) 2015-04-16 11:54:25 UTC
This sounds like a bug in automake, it should not pass CFLAGS to the linker at all (or CPPFLAGS for that matter). I'd prefer to rather fix automake than working around this all over the place in our code.
Comment 4 Tim-Philipp Müller 2015-06-10 11:53:35 UTC
*** Bug 737030 has been marked as a duplicate of this bug. ***
Comment 5 Tim-Philipp Müller 2015-06-10 12:07:30 UTC
Duplicate of bug #747954?
Comment 6 Julien Isorce 2015-06-10 12:43:28 UTC
Yes (initially I thought it should be fixed separately.)
Comment 7 Tim-Philipp Müller 2015-06-13 23:41:32 UTC

*** This bug has been marked as a duplicate of bug 747954 ***