GNOME Bugzilla – Bug 737030
Build error with clang on OSX
Last modified: 2015-06-10 11:53:34 UTC
I'm experiencing build errors in OSX like the following: $ make V=1 /usr/bin/perl ./extract.pl testrtpool.c ../../../docs/manual/advanced-threads.xml Extracting testrtpool.c block a from ../../../docs/manual/advanced-threads.xml Extracting testrtpool.c block b from ../../../docs/manual/advanced-threads.xml Extracting testrtpool.c block c from ../../../docs/manual/advanced-threads.xml Writing testrtpool.c block a Writing testrtpool.c block b Writing testrtpool.c block c /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../libs -I../../.. -I../../../libs -I../../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs -g -DGST_DISABLE_DEPRECATED -Werror -D_THREAD_SAFE -pthread -g -O2 -MT testrtpool-testrtpool.o -MD -MP -MF .deps/testrtpool-testrtpool.Tpo -c -o testrtpool-testrtpool.o `test -f 'testrtpool.c' || echo './'`testrtpool.c mv -f .deps/testrtpool-testrtpool.Tpo .deps/testrtpool-testrtpool.Po /bin/sh ../../../libtool --tag=CC --mode=link gcc -I../../../libs -I../../.. -I../../../libs -I../../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs -g -DGST_DISABLE_DEPRECATED -Werror -D_THREAD_SAFE -pthread -g -O2 -o testrtpool testrtpool-testrtpool.o ../../../gst/libgstreamer-1.0.la -L/usr/local/Cellar/glib/2.40.0_1/lib -L/usr/local/opt/gettext/lib -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -ldl libtool: link: gcc -I../../../libs -I../../.. -I../../../libs -I../../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs -g -DGST_DISABLE_DEPRECATED -Werror -D_THREAD_SAFE -pthread -g -O2 -o .libs/testrtpool testrtpool-testrtpool.o ../../../gst/.libs/libgstreamer-1.0.dylib -L/usr/local/Cellar/glib/2.40.0_1/lib -L/usr/local/opt/gettext/lib -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -ldl -pthread clang: error: argument unused during compilation: '-pthread' clang: error: argument unused during compilation: '-pthread' make[1]: *** [testrtpool] Error 1 make: *** [all] Error 2 I've tried to fix myself but I couldn't come up with the right fix. Seems that the root cause is at darwin case in http://cgit.freedesktop.org/gstreamer/gstreamer/tree/m4/ax_pthread.m4 which add '-pthread'. Some related info at http://savannah.gnu.org/patch/?8186 and http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=history;f=m4/ax_pthread.m4 Maybe just our committed macro has to be updated.
I've tried with the latest ax_pthread.m4 but the issue it's still not fixed with it.
Created attachment 286725 [details] config.log generated with latest ax_pthread.m4 This is the config log generated with the ax_pthread.mp4 updated with latest upstream revision. I've tried commenting the darwin case at [1] and it has built without error so some relationship with that one. [1] http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob;f=m4/ax_pthread.m4;h=d383ad5c6d6a5061370800bb1dc89b7a334c0638;hb=HEAD#l163
This was updated btw: commit 93d3ffc34c2f24b252243dbbccd604d63cbe6319 Author: Arun Raghavan <git@arunraghavan.net> Date: Wed Nov 26 21:38:29 2014 +0530 m4: Add ax_pthread.m4 We'll share this between gstreamer (which uses a slightly older version of ax_pthread.m4) and gst-plugins-bad (which uses an even older acx_pthread.m4). There's also bug #747954 . Is this the same as bug #747954 ?
And there's yet another bug too :) *** This bug has been marked as a duplicate of bug 747730 ***