Make --enable-initfini-array the default

* configure.ac (--enable-initfini-array): Remove run test.  Default
	to "yes".  Change help string to --disable-initfini-array.
	* configure: Regenerate.
This commit is contained in:
Alan Modra 2015-12-02 19:23:41 +10:30
parent c27b8c2aeb
commit 26e3a0c9ba
3 changed files with 17 additions and 54 deletions

View file

@ -1,3 +1,9 @@
2015-12-02 Alan Modra <amodra@gmail.com>
* configure.ac (--enable-initfini-array): Remove run test. Default
to "yes". Change help string to --disable-initfini-array.
* configure: Regenerate.
2015-11-20 Maciej W. Rozycki <macro@imgtec.com>
* configure.tgt <mips*el-mti-elf*, mips*el-img-elf*>: Add

43
ld/configure vendored
View file

@ -1450,7 +1450,7 @@ Optional Features:
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings
--disable-nls do not use Native Language Support
--enable-initfini-array use .init_array/.fini_array sections
--disable-initfini-array do not use .init_array/.fini_array sections
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -16814,43 +16814,12 @@ fi
# Check whether --enable-initfini-array was given.
if test "${enable_initfini_array+set}" = set; then :
enableval=$enable_initfini_array;
enableval=$enable_initfini_array; case "${enableval}" in
yes|no) ;;
*) as_fn_error "invalid --enable-initfini-array argument" "$LINENO" 5 ;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .preinit_array/.init_array/.fini_array support" >&5
$as_echo_n "checking for .preinit_array/.init_array/.fini_array support... " >&6; }
if test "${gcc_cv_initfini_array+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "x${build}" = "x${target}" ; then
if test "$cross_compiling" = yes; then :
gcc_cv_initfini_array=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
static int x = -1;
int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
gcc_cv_initfini_array=yes
else
gcc_cv_initfini_array=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
else
gcc_cv_initfini_array=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_initfini_array" >&5
$as_echo "$gcc_cv_initfini_array" >&6; }
enable_initfini_array=$gcc_cv_initfini_array
enable_initfini_array=yes
fi

View file

@ -215,23 +215,11 @@ AC_SEARCH_LIBS([dlopen], [dl])
AM_CONDITIONAL([ENABLE_PLUGINS], [test x$plugins = xyes])
AC_ARG_ENABLE(initfini-array,
[ --enable-initfini-array use .init_array/.fini_array sections],
[], [
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
gcc_cv_initfini_array, [dnl
if test "x${build}" = "x${target}" ; then
AC_RUN_IFELSE([AC_LANG_SOURCE([
static int x = -1;
int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;])],
[gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
[gcc_cv_initfini_array=no])
else
gcc_cv_initfini_array=no
fi])
enable_initfini_array=$gcc_cv_initfini_array
])
[ --disable-initfini-array do not use .init_array/.fini_array sections],
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([invalid --enable-initfini-array argument]) ;;
esac], [enable_initfini_array=yes])
AC_SUBST(enable_initfini_array)
if test $enable_initfini_array = yes; then
AC_DEFINE(HAVE_INITFINI_ARRAY, 1,