Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-01-07 21:04:39 +0300
committerJeff Johnston <jjohnstn@redhat.com>2005-01-07 21:04:39 +0300
commitf7a74742e69119d7133c8d9619ae94175faed068 (patch)
tree526a24a1f892045b2e52bec5a0ee8ba743ee32be /newlib/configure
parent35310094a18515e7b0be818abbff262f6718f849 (diff)
2005-01-07 Paul Brook <paul@codesourcery.com>
* configure.in: Add test for .init_array. * configure: Regenerate. * newlib.hin: Add HAVE_INITFINI_ARRAY. * libc/misc/Makefile.am: Add init.c * libc/misc/Makefile.in: Regenerate. * libc/misc/init.c: New file. * libc/sys/arm/crt0.S: Call __libc_{init,fini}_array instead of _init/_fini if they exist.
Diffstat (limited to 'newlib/configure')
-rwxr-xr-xnewlib/configure35
1 files changed, 35 insertions, 0 deletions
diff --git a/newlib/configure b/newlib/configure
index e684ba6f3..48ce0d37c 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -3425,6 +3425,40 @@ EOF
done
fi;
+echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
+echo "configure:3430: checking for .preinit_array/.init_array/.fini_array support" >&5
+if eval "test \"`echo '$''{'libc_cv_initfinit_array'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+int _start (void) { return 0; }
+int __start (void) { return 0; }
+int foo (void) { return 1; }
+int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+EOF
+if { ac_try='${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+ -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:3441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+then
+ if readelf -S conftest | grep -e INIT_ARRAY > /dev/null; then
+ libc_cv_initfinit_array=yes
+ else
+ libc_cv_initfinit_array=no
+ fi
+else
+ libc_cv_initfinit_array=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_initfinit_array" 1>&6
+
+if test $libc_cv_initfinit_array = yes; then
+ cat >> confdefs.h <<EOF
+#define HAVE_INITFINI_ARRAY 1
+EOF
+
+fi
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -3641,6 +3675,7 @@ s%@SYSCALL_OBJECTLIST@%$SYSCALL_OBJECTLIST%g
s%@UNIX_OBJECTLIST@%$UNIX_OBJECTLIST%g
s%@STDIO64_OBJECTLIST@%$STDIO64_OBJECTLIST%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@libc_cv_initfinit_array@%$libc_cv_initfinit_array%g
CEOF
EOF