Subject: Re: toolchain/28767
To: None <toolchain-maintainer@NetBSD.org,>
From: James Chacon <jmc@NetBSD.org>
List: netbsd-bugs
Date: 12/24/2004 17:10:32
On Fri, Dec 24, 2004 at 07:58:37AM +0000, jmc@NetBSD.org wrote:
> Synopsis: Oversize bootxx_ffs causes build.sh distribution to fail
> 
> Responsible-Changed-From-To: port-alpha-maintainer->toolchain-maintainer
> Responsible-Changed-By: jmc@netbsd.org
> Responsible-Changed-When: Fri, 24 Dec 2004 07:58:37 +0000
> Responsible-Changed-Why:
> This is really a toolchain bug w. gas generating extra .eh_frame sections on
> alpha
> 

I think the attached patch is the simpler of the 2 ideas I had for this
(the other was patching gas to add an MD option to alpha to allow turning off
the generation of .eh_frame. It's fairly short but I don't wanna modify the
mainline binutils unless we really need to)

Diff:

Index: Makefile.bootprogs
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/stand/Makefile.bootprogs,v
retrieving revision 1.24
diff -u -r1.24 Makefile.bootprogs
--- Makefile.bootprogs	26 Oct 2003 07:25:35 -0000	1.24
+++ Makefile.bootprogs	24 Dec 2004 19:32:30 -0000
@@ -124,16 +124,18 @@
 
 ### find out what to use for libkern
 KERN_AS=	library
+KERNMISCMAKEFLAGS+=-f ${.CURDIR}/../Makefile.inc
 .include "${S}/lib/libkern/Makefile.inc"
 LIBKERN=	${KERNLIB}
 
 ### find out what to use for libz
 Z_AS=		library
+ZMISCMAKEFLAGS+=-f ${.CURDIR}/../Makefile.inc
 .include "${S}/lib/libz/Makefile.inc"
 LIBZ=		${ZLIB}
 
 ### find out what to use for libsa
 SA_AS=		library
-SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
+SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes -f ${.CURDIR}/../Makefile.inc
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA=		${SALIB}
Index: Makefile.inc
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/stand/Makefile.inc,v
retrieving revision 1.19
diff -u -r1.19 Makefile.inc
--- Makefile.inc	27 Aug 2002 08:53:14 -0000	1.19
+++ Makefile.inc	24 Dec 2004 19:32:30 -0000
@@ -9,3 +9,14 @@
 
 CPPFLAGS+=		-I${.CURDIR}/../..
 LDSTATIC=		-static
+
+# binutils 2.15 forces a .eh_frame section into all objects. Nuke it for space
+.c.o:
+	${COMPILE.c} ${.IMPSRC}
+	${OBJCOPY} -R .eh_frame ${.PREFIX}.o 
+.S.o:
+	${COMPILE.S} ${.IMPSRC}
+	${OBJCOPY} -R .eh_frame ${.PREFIX}.o 
+.s.o:
+	${COMPILE.s} ${.IMPSRC}
+	${OBJCOPY} -R .eh_frame ${.PREFIX}.o