Make --enable-initfini-array the default
authorAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 08:53:41 +0000 (19:23 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 08:54:34 +0000 (19:24 +1030)
* configure.ac (--enable-initfini-array): Remove run test.  Default
to "yes".  Change help string to --disable-initfini-array.
* configure: Regenerate.

ld/ChangeLog
ld/configure
ld/configure.ac

index c2fabd3..0f622d0 100644 (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
index 120d934..d019688 100755 (executable)
@@ -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]
 
 # Check whether --enable-initfini-array was given.
 if test "${enable_initfini_array+set}" = set; then :
-  enableval=$enable_initfini_array;
-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
+  enableval=$enable_initfini_array; case "${enableval}" in
+ yes|no) ;;
+ *) as_fn_error "invalid --enable-initfini-array argument" "$LINENO" 5 ;;
+ esac
 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
 
 
index 188172d..d61beb2 100644 (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,