mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
configure: use the -Bsymbolic-functions linker flag if supported
This feature turns intra library calls into direct function calls and thus makes them a little faster. The downside is that this causes problems for e.g. LD_PRELOAD based tools. Thus add a configure option to turn it off.
This commit is contained in:
parent
525776df79
commit
3457bc7149
1 changed files with 19 additions and 0 deletions
19
configure.ac
19
configure.ac
|
@ -337,6 +337,22 @@ AC_COMPILE_IFELSE(
|
|||
])
|
||||
AM_CONDITIONAL(HAVE_LINUX_JOYSTICK_HEADERS, test "x$HAVE_LINUX_JOYSTICK_HEADERS" = "xyes")
|
||||
|
||||
dnl Check for -Bsymbolic-functions linker flag used to avoid
|
||||
dnl intra-library PLT jumps, if available.
|
||||
AC_ARG_ENABLE(Bsymbolic,
|
||||
[AC_HELP_STRING([--disable-Bsymbolic],
|
||||
[avoid linking with -Bsymbolic])],,
|
||||
[SAVED_LDFLAGS="${LDFLAGS}"
|
||||
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
|
||||
LDFLAGS=-Wl,-Bsymbolic-functions
|
||||
AC_TRY_LINK([], [int main (void) { return 0; }],
|
||||
AC_MSG_RESULT(yes)
|
||||
enable_Bsymbolic=yes,
|
||||
AC_MSG_RESULT(no)
|
||||
enable_Bsymbolic=no)
|
||||
LDFLAGS="${SAVED_LDFLAGS}"])
|
||||
|
||||
|
||||
dnl *** set variables based on configure arguments ***
|
||||
|
||||
dnl set license and copyright notice
|
||||
|
@ -870,6 +886,9 @@ AC_SUBST(GST_LIBS)
|
|||
dnl LDFLAGS really should only contain flags, not libs - they get added before
|
||||
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
|
||||
GST_ALL_LDFLAGS="-no-undefined"
|
||||
if test "x${enable_Bsymbolic}" == "xyes"; then
|
||||
GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
|
||||
fi
|
||||
AC_SUBST(GST_ALL_LDFLAGS)
|
||||
|
||||
dnl GST_LIB_LDFLAGS
|
||||
|
|
Loading…
Reference in a new issue