GNOME Bugzilla – Bug 759713
-Bsymbolic configure check doesn't work on FreeBSD.
Last modified: 2018-01-20 13:10:30 UTC
Created attachment 317713 [details] [review] Update -Bysymbolic check with the glib version The current test for -Bsymbolic in configure doesn't work on FreeBSD. Our default compiler is clang. I checked that with the patch the check works with both gcc and clang. A quick check showed that the following projects also use this code, gst-plugins-base, gst-rtsp-server and orc. So this patch should be applied too. I think I check all the gstreamer projects, but a double check would be great. -------------- checking for -Bsymbolic-functions linker flag... no configure:26401: checking for -Bsymbolic-functions linker flag configure:26415: cc -o conftest -O2 -pipe -O2 -Wno-format -fstack-protector -fno-strict-aliasing -I/usr/local/include -Wl,-Bsymbolic-functions conftest.c >&5 conftest.c:92:17: error: function definition is not allowed here int main (void) { return 0; } ^ 1 error generated. configure:26415: $? = 1 configure: failed program --------------
Comment on attachment 317713 [details] [review] Update -Bysymbolic check with the glib version Makes sense, I'll also apply that to the other modules. Thanks! (No need to provide new patches, this one should apply cleanly to all modules without modifications)
Merged into all modules
Accoding to http://www.gnu.org/software/autoconf/manual/autoconf-2.62/html_node/Quotation-Rule-Of-Thumb.html AC_TRY_LINK is obsolete and we should keep using AC_LINK_IFELSE. E.g. AC_ARG_ENABLE(Bsymbolic, [AS_HELP_STRING([--disable-Bsymbolic], [avoid linking with -Bsymbolic])],, [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}" AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) LDFLAGS=-Wl,-Bsymbolic-functions LIBS= AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ AC_MSG_RESULT(yes) enable_Bsymbolic=yes], [ AC_MSG_RESULT(no) enable_Bsymbolic=no]) LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"]) Could you show the whole generated conftest.c? I've tried CC=clang ./autogen.sh ... and I don't see any issue.
It probably depends on the version of clang, if you use the clang linker or the GNU ones, etc. We now have exactly the same check as glib, I think that's a good thing on its own already :) If you want to improve the check, please also provide a patch to the GLib people.
What should happen here now?
The original issue has been solved, so let's close this bug. Let's not worry about deprecated autoconf macros and focus on the Meson port ;)