changeset 812:4e1e6aa7f445

Convince gcc to build/install libgcc_eh.a even for --disable-shared compilers, and tell the wrapper to expect it.
author Rob Landley <rob@landley.net>
date Sat, 22 Aug 2009 04:07:00 -0500
parents aea72ecff868
children e2fc10ede93f
files sources/patches/gcc-core-libgcceh.patch sources/toys/ccwrap.c
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/gcc-core-libgcceh.patch	Sat Aug 22 04:07:00 2009 -0500
@@ -0,0 +1,25 @@
+--- gcc-4.2.1/gcc/mklibgcc.in	2006-07-04 15:20:01.000000000 -0500
++++ gcc-core/gcc/mklibgcc.in	2009-08-21 21:51:35.000000000 -0500
+@@ -223,8 +223,8 @@
+   if [ "$LIBUNWIND" ]; then
+     libunwind_a=$dir/libunwind.a
+   fi
++  libgcc_eh_a=$dir/libgcc_eh.a
+   if [ "$SHLIB_LINK" ]; then
+-    libgcc_eh_a=$dir/libgcc_eh.a
+     libgcc_s_so=$dir/libgcc_s${SHLIB_EXT}
+     if [ "$LIBUNWIND" ]; then
+       libunwind_so=$dir/libunwind${SHLIB_EXT}
+@@ -889,11 +889,11 @@
+   echo '	chmod 644'  ${ldir}/libgcov.a
+   echo '	$(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
+ 
+-  if [ "$SHLIB_LINK" ]; then
+     echo '	$(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
+     echo '	chmod 644'  ${ldir}/libgcc_eh.a
+     echo '	$(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
+ 
++  if [ "$SHLIB_LINK" ]; then
+     shlib_slibdir_qual=
+     os_multilib_dir=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
+     if [ "$os_multilib_dir" != . ]; then
--- a/sources/toys/ccwrap.c	Fri Aug 21 23:21:57 2009 -0500
+++ b/sources/toys/ccwrap.c	Sat Aug 22 04:07:00 2009 -0500
@@ -5,6 +5,8 @@
  * Copyright (C) 2006-2009 Rob Landley <rob@landley.net>
  *
  * Wrapper to use uClibc with gcc, and make gcc relocatable.
+ *
+ * Licensed under GPLv2.
  */
 
 #define _GNU_SOURCE
@@ -42,7 +44,7 @@
 		else gcc_argv[argcnt++] = "-lgcc_eh"; \
 	} while (0);
 #else
-#define ADD_GCC_S()
+#define ADD_GCC_S() gcc_argv[argcnt++] = "-lgcc_eh"
 #endif
 
 // Confirm that a regular file exists, and (optionally) has the executable bit.