Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/binutils/dist/ld restore the initfini array tests
details: https://anonhg.NetBSD.org/src/rev/d505a511cb7f
branches: trunk
changeset: 348578:d505a511cb7f
user: christos <christos%NetBSD.org@localhost>
date: Wed Oct 26 20:26:20 2016 +0000
description:
restore the initfini array tests
diffstat:
external/gpl3/binutils/dist/ld/configure | 48 +++++++++++++++++++++++-----
external/gpl3/binutils/dist/ld/configure.ac | 22 ++++++++++---
2 files changed, 56 insertions(+), 14 deletions(-)
diffs (97 lines):
diff -r 2d128c5c4b7a -r d505a511cb7f external/gpl3/binutils/dist/ld/configure
--- a/external/gpl3/binutils/dist/ld/configure Wed Oct 26 20:05:21 2016 +0000
+++ b/external/gpl3/binutils/dist/ld/configure Wed Oct 26 20:26:20 2016 +0000
@@ -1454,7 +1454,7 @@
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings
--disable-nls do not use Native Language Support
- --disable-initfini-array do not use .init_array/.fini_array sections
+ --enable-initfini-array use .init_array/.fini_array sections
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -16866,14 +16866,44 @@
# Check whether --enable-initfini-array was given.
if test "${enable_initfini_array+set}" = set; then :
- enableval=$enable_initfini_array; case "${enableval}" in
- yes|no) ;;
- *) as_fn_error "invalid --enable-initfini-array argument" "$LINENO" 5 ;;
- esac
-else
- enable_initfini_array=yes
-fi
-
+ 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
+ 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
+
+ fi
if test $enable_initfini_array = yes; then
diff -r 2d128c5c4b7a -r d505a511cb7f external/gpl3/binutils/dist/ld/configure.ac
--- a/external/gpl3/binutils/dist/ld/configure.ac Wed Oct 26 20:05:21 2016 +0000
+++ b/external/gpl3/binutils/dist/ld/configure.ac Wed Oct 26 20:26:20 2016 +0000
@@ -226,11 +226,23 @@
AM_CONDITIONAL([ENABLE_PLUGINS], [test x$plugins = xyes])
AC_ARG_ENABLE(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])
+ [ --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
+])
AC_SUBST(enable_initfini_array)
if test $enable_initfini_array = yes; then
AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
Home |
Main Index |
Thread Index |
Old Index