This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

An interface patch


Here is a Linux/alpha/ppc patch for config.if. The problem is for the
same glibc 2.1 source, if you compile it with egcs 1.1.2, libc.so won't
have the .eh_frame section. However, if you recompile it with gcc 2.95,
now libc.so will have the .eh_frame section. For C++, those 2 libc.so's
compiled with different compilers may not be binary compatible. This
patch tries to detect it and appends "eh-" to "libc_interface" if
the .eh_frame section is in libc.so. Please check it out.

BTW, I seem to remember Linux/PPC supports DWARF2 based EH now. But
I didn't find anything in egcs.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
Sun Jul 18 10:11:42 1999  H.J. Lu  (hjl@gnu.org)

	* config.if (libc_interface): For Linux/Alpha and Linux/PPC,
	append "eh-" if libc.so has the .eh_frame section.

--- ../../import/gcc-2.95/egcs/config.if	Sun Oct 18 10:37:10 1998
+++ ./config.if	Sun Jul 18 09:49:11 1999
@@ -84,4 +84,32 @@ EOF
     libc_interface=-
     ;;
   esac
+
+  # It is a very tricky since C++ is switched to DWARF2 based EH on
+  # Linux/Alpha and Linux/PPC in gcc 2.95. Depending on the compiler
+  # used to compile glibc, libc.so is different. We have to encode it.
+  case ${target_os} in
+  *linux*libc1*|*linux*libc5*)
+    ;;
+  *linux*gnu*)
+    case ${target_alias} in
+    *alpha*|*powerpc*)
+      if [ ${target_alias} = ${build_alias} ]
+      then
+	# Check if libc.so has the .eh_frame section.
+	OBJDUMP_FOR_TARGET=${OBJDUMP_FOR_TARGET-objdump}
+	${OBJDUMP_FOR_TARGET} -h /lib/libc.so.6* | grep .eh_frame > /dev/null 2>&1
+	if [ "$?" = 0 ]
+	then
+	  libc_interface=${libc_interface}eh-
+	fi
+      else
+	# Cross compiling. Assume glibc is compiled with gcc 2.95 or
+	# later.
+	libc_interface=${libc_interface}eh-
+      fi
+      ;;
+    esac
+    ;;
+  esac
 fi


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