Commit 718e1e05 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Ensure that shared objects have no unresolved symbols.

This will catch broken plugins at build-time rather than run-time.
parent 0856d3ae
...@@ -891,6 +891,10 @@ CFLAGS="${CFLAGS_save}" ...@@ -891,6 +891,10 @@ CFLAGS="${CFLAGS_save}"
RDC_PROG_CC_WFLAGS([all extra no-unused-parameter sign-compare undef pointer-arith bad-function-cast cast-align write-strings old-style-definition missing-prototypes packed volatile-register-var]) RDC_PROG_CC_WFLAGS([all extra no-unused-parameter sign-compare undef pointer-arith bad-function-cast cast-align write-strings old-style-definition missing-prototypes packed volatile-register-var])
RDC_PROG_CC_FLAGS_IFELSE([-pipe]) RDC_PROG_CC_FLAGS_IFELSE([-pipe])
dnl This helps detect broken plugins with undefined symbols
dnl Better fail loudly at build-time than silenty at run-time.
RDC_PROG_LINK_FLAGS_IFELSE([-Wl,-z,defs])
dnl Check for various optimization flags dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -Os], AC_CACHE_CHECK([if \$CC accepts -Os],
[ac_cv_c_os], [ac_cv_c_os],
......
...@@ -23,6 +23,7 @@ AC_DEFUN([RDC_PROG_CC_FLAGS_IFELSE], ...@@ -23,6 +23,7 @@ AC_DEFUN([RDC_PROG_CC_FLAGS_IFELSE],
ac_res=`eval echo '${'$as_ac_var'}'` ac_res=`eval echo '${'$as_ac_var'}'`
AS_IF([test "${ac_res}" != "no"], [ AS_IF([test "${ac_res}" != "no"], [
CFLAGS="${CFLAGS} $1"
CXXFLAGS="${CXXFLAGS} $1" CXXFLAGS="${CXXFLAGS} $1"
OBJCFLAGS="${OBJCFLAGS} $1" OBJCFLAGS="${OBJCFLAGS} $1"
$2 $2
...@@ -40,11 +41,11 @@ AC_DEFUN([RDC_PROG_CC_WFLAGS], ...@@ -40,11 +41,11 @@ AC_DEFUN([RDC_PROG_CC_WFLAGS],
AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE], AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE],
[AC_LANG_ASSERT(C) [AC_LANG_ASSERT(C)
CFLAGS_save="${CFLAGS}" LDFLAGS_save="${LDFLAGS}"
as_ac_var=`echo "ac_cv_prog_cc_flags_$1" | $as_tr_sh` as_ac_var=`echo "ac_cv_prog_link_flags_$1" | $as_tr_sh`
AC_CACHE_CHECK([if $CC accepts $1], [$as_ac_var], [ AC_CACHE_CHECK([if $LINK accepts $1], [$as_ac_var], [
CFLAGS="${CFLAGS_save} $1" LDFLAGS="${LDFLAGS_save} $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ AC_LINK_IFELSE([AC_LANG_PROGRAM()], [
eval "$as_ac_var=yes" eval "$as_ac_var=yes"
],[ ],[
eval "$as_ac_var=no" eval "$as_ac_var=no"
...@@ -53,10 +54,10 @@ AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE], ...@@ -53,10 +54,10 @@ AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE],
ac_res=`eval echo '${'$as_ac_var'}'` ac_res=`eval echo '${'$as_ac_var'}'`
AS_IF([test "${ac_res}" != "no"], [ AS_IF([test "${ac_res}" != "no"], [
true LDFLAGS="${LDFLAGS} $1"
$2 $2
], [ ], [
LDFLAGS="${CFLAGS_save}" LDFLAGS="${LDFLAGS_save}"
$3 $3
]) ])
]) ])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment