This is the mail archive of the gcc-patches@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]

[PATCH]: An interface patch


> -- 
> H.J. Lu (hjl@gnu.org)
> ---
> Mon Aug  9 13:23:10 1999  H.J. Lu  (hjl@gnu.org)
> 
> 	* config.if (libc_interface): If not sure, check libc.so and
> 	append "eh-" if libc.so has the .eh_frame section.
> 

Ooops. It is the wrong patch. Here is the fixed one.



H.J.
--------
Mon Aug  9 13:23:10 1999  H.J. Lu  (hjl@gnu.org)

	* config.if (libc_interface): If not sure, check libc.so and
	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	Mon Aug  9 13:57:15 1999
@@ -84,4 +84,66 @@ EOF
     libc_interface=-
     ;;
   esac
+
+  # It is a very tricky since C++ is switched to DWARF2 based EH on
+  # Linux/Alpha in gcc 2.95. Depending on the compiler used to compile
+  # glibc, libc.so is different. We have to encode it in library name
+  # if necessary.
+  case ${target_os} in
+  *linux*libc1*|*linux*libc5*)
+    ;;
+  *linux*gnu*)
+    case ${target_alias} in
+    *i[3456]86*|*m68k*|*mips*|*sparc*)
+      # Known to have EH today.
+      ;;
+    *)
+      if [ ${target_alias} = ${build_alias} ]
+      then
+        if_libc_dir=/lib
+      else
+	# Cross compiling.
+	if [ -n "${exec_prefix}" ]
+	then
+	  if_exec_prefix=${exec_prefix}
+	else
+	  if_exec_prefix=${prefix}
+	fi
+	if [ -z "${if_exec_prefix}" ]
+	then
+	  echo "Error: neither \"exec_prefix\" nor \"prefix\" is defined."
+	  exit 1
+	fi
+	if_libc_dir=${if_exec_prefix}/${target_alias}/lib
+	if_libc_found=no
+	for f in ${if_libc_dir}/libc.so.6*
+	do
+	  if [ -f $f ]
+	  then
+	    if_libc_found=yes
+	    break
+	  fi
+	done
+	if [ ${if_libc_found} = "no" ]
+	then
+	  echo "Warning: cross compilation may fail because no C"
+	  echo "library is found. You may have to rebuild it after"
+	  echo "the C library is installed."
+	  if_libc_dir=
+	fi
+      fi
+      if [ -n "${if_libc_dir}" ]
+      then
+	# Check if libc.so has the .eh_frame section.
+	OBJDUMP_FOR_TARGET=${OBJDUMP_FOR_TARGET-objdump}
+	${OBJDUMP_FOR_TARGET} -h ${if_libc_dir}/libc.so.6* | grep .eh_frame > /dev/null 2>&1
+	if [ "$?" = 0 ]
+	then
+	  libc_interface=${libc_interface}eh-
+	fi
+      fi
+      ;;
+    esac
+    ;;
+  esac
 fi


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