# Taken from http://people.freebsd.org/~peter/ezm3-amd64/ezm3-port.diff.gz
#
# Various build hacks to make life easier on amd64.  Build the
# gcc backend all static with whatever means necessary.  This makes
# it easier to decode coredumps.
#
Index: language/modula3/m3compiler/m3cc/gcc/gcc/Makefile.in
--- language/modula3/m3compiler/m3cc/gcc/gcc/Makefile.in	Tue Feb 17 01:06:14 2004
+++ language/modula3/m3compiler/m3cc/gcc/gcc/Makefile.in	Mon Feb 16 21:15:11 2004
@@ -66,7 +66,7 @@
 XCFLAGS =
 TCFLAGS =
-CFLAGS = -g
+CFLAGS = -g -static
 STAGE1_CFLAGS = -g @stage1_cflags@
-BOOT_CFLAGS = -g -O2
+BOOT_CFLAGS = -g -static
 
 # The warning flags are separate from BOOT_CFLAGS because people tend to
@@ -103,5 +103,5 @@
 
 AWK = @AWK@
-CC = @CC@
+CC = @CC@ -g -static
 BISON = @BISON@
 BISONFLAGS =
@@ -583,5 +583,5 @@
 # programs built during a bootstrap.
 # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
-INTERNAL_CFLAGS = -DIN_GCC @CROSS@
+INTERNAL_CFLAGS = -DIN_GCC @CROSS@ -g -static
 
 # This is the variable actually used when we compile.
@@ -589,5 +589,5 @@
 # of HOST_CFLAGS in build-make to match.
 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
-  $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
+  $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@ -g -static
 
 # Likewise.
@@ -631,5 +631,5 @@
 # Always use -I$(srcdir)/config when compiling.
 .c.o:
-	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -g $(INCLUDES) $< $(OUTPUT_OPTION)
 
 # This tells GNU make version 3 not to export all the variables
@@ -963,5 +963,5 @@
 
 cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS)
-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -g -static -o cc1$(exeext) \
 		$(C_OBJS) $(BACKEND) $(LIBS)
 
