This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Option to disable combreloc


Glibc on arm appears to misdetect that -z combreloc fails to work.  This
patch gives the option to disable it if needed for testing:


2002-11-06  Jeff Bailey  <jbailey@gnu.org>

        * configure.in: Add option --without-combreloc.


Index: configure.in
===================================================================
RCS file: /cvs/glibc/libc/configure.in,v
retrieving revision 1.375
diff -u -p -r1.375 configure.in
--- configure.in	6 Nov 2002 08:54:01 -0000	1.375
+++ configure.in	6 Nov 2002 13:09:10 -0000
@@ -182,6 +182,12 @@ AC_ARG_WITH([__thread],
 	    [use__thread=$withval],
 	    [use__thread=yes])
 
+AC_ARG_WITH([combreloc],
+	    AC_HELP_STRING([--without-combreloc],
+	                   [do not use -z combreloc]),
+	    [usecombreloc=$withval],
+	    [usecombreloc=yes])
+
 AC_ARG_ENABLE([hidden-plt],
               AC_HELP_STRING([--disable-hidden-plt],
                              [do not hide internal function calls to
avoid PLT]),
@@ -1268,33 +1274,37 @@ EOF
   rm -f conftest*])
   AC_SUBST(libc_cv_Bgroup)
 
-  AC_CACHE_CHECK(for -z combreloc,
-		 libc_cv_z_combreloc, [dnl
-  cat > conftest.c <<EOF
+  if test "x$usecombreloc" != xno; then
+    AC_CACHE_CHECK(for -z combreloc,
+  		   libc_cv_z_combreloc, [dnl
+      cat > conftest.c <<EOF
 extern int bar (int);
 extern int mumble;
 int foo (void) { return bar (mumble); }
 EOF
-  if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
+      if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
 			-nostdlib -nostartfiles
 			-Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
-  then
+      then
 dnl The following test is a bit weak.  We must use a tool which can
test
 dnl cross-platform since the gcc used can be a cross compiler.  Without
 dnl introducing new options this is not easily doable.  Instead use a
tool
 dnl which always is cross-platform: readelf.  To detect whether -z
combreloc
 dnl look for a section named .rel.dyn.
-    if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null;
then
-      libc_cv_z_combreloc=yes
-    else
-      libc_cv_z_combreloc=no
+        if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' >
/dev/null; then
+          libc_cv_z_combreloc=yes
+        else
+          libc_cv_z_combreloc=no
+        fi
+      else
+        libc_cv_z_combreloc=no
+      fi
+      rm -f conftest*])
+    if test "$libc_cv_z_combreloc" = yes; then
+      AC_DEFINE(HAVE_Z_COMBRELOC)
     fi
   else
     libc_cv_z_combreloc=no
-  fi
-  rm -f conftest*])
-  if test "$libc_cv_z_combreloc" = yes; then
-    AC_DEFINE(HAVE_Z_COMBRELOC)
   fi
 fi
 AC_SUBST(libc_cv_z_combreloc)



Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]