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]

gnu-regex.o can't find alloca + patch


The recent alloca tweeking caused fixinc/gnu-regex.o to mishandle
alloca when using cc on solaris2 (and probably any non-gcc compiler.)

 > cc -DIN_GCC -g -I. -I.. -I../../../egcs-CVS20010306/gcc/fixinc
 >   -I../../../egcs-CVS20010306/gcc/fixinc/..
 >   -I../../../egcs-CVS20010306/gcc/fixinc/../config
 >   --I../../../egcs-CVS20010306/gcc/fixinc/../../include -o fixincl
 >   -fixincl.o fixtests.o fixfixes.o server.o procopen.o gnu-regex.o
 >   -fixlib.o ../../libiberty/libiberty.a
 > 
 > ild: (undefined symbol) alloca -- referenced in the text segment of gnu-regex.o
 > make[3]: *** [full-stamp] Error 5

This patch seems to fix it.  Ok to install?


2001-03-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* fixinc/Makefile.in (FIXINC_DEFS): Add -DHAVE_CONFIG_H.

	* fixinc/gnu-regex.c: Don't include auto-host.h since we get
	config.h now.  Include libiberty.h to handle alloca.

diff -rup orig/egcs-CVS20010306/gcc/fixinc/Makefile.in egcs-CVS20010306/gcc/fixinc/Makefile.in
--- orig/egcs-CVS20010306/gcc/fixinc/Makefile.in	Wed Dec 27 10:40:02 2000
+++ egcs-CVS20010306/gcc/fixinc/Makefile.in	Tue Mar  6 10:27:46 2001
@@ -23,7 +23,7 @@
 # Its purpose is to build the any-platforms fixinc.sh script.
 
 FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
-FIXINC_DEFS = -DIN_GCC $(FL_LIST) $(INCLUDES)
+FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
 
 # Directory where sources are, from where we are.
 srcdir = @srcdir@
diff -rup orig/egcs-CVS20010306/gcc/fixinc/gnu-regex.c egcs-CVS20010306/gcc/fixinc/gnu-regex.c
--- orig/egcs-CVS20010306/gcc/fixinc/gnu-regex.c	Thu Dec 14 14:58:39 2000
+++ egcs-CVS20010306/gcc/fixinc/gnu-regex.c	Tue Mar  6 11:04:05 2001
@@ -22,16 +22,17 @@
    along with this program; if not, write to the Free Software Foundation, 
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#include "auto-host.h"
-/* GCC LOCAL: we don't need NLS here.  */
-#undef ENABLE_NLS
-
 #undef	_GNU_SOURCE
 #define _GNU_SOURCE
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+
+/* GCC LOCAL: we don't need NLS here.  */
+#undef ENABLE_NLS
+/* GCC LOCAL: to handle defining alloca.  */
+#include "libiberty.h"
 
 /* Do not use a C alloca, we will leak memory and crash.  */
 #ifdef C_ALLOCA


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