[RFA] fix bfd multi-arch compilation failure

Pierre Muller muller@ics.u-strasbg.fr
Tue Mar 17 23:26:00 GMT 2009

I tried to do a compilation of
gdb with --enable-targets=all --enable-64-bits-bfd
on OpenSolaris 2008.11.

I found two problems in bfd directory,
related to uses of alloca without
including <alloca.h>

I added 
#include <alloca.h>
garded by #ifdef HAVE_ALLOCA_H
as I suppose that on some systems
alloca is builtin and thus does not require any header.

Is this OK to check in?

Pierre Muller
Pascal language support maintainer for GDB

ChangeLog entry:

2009-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>

	* elf32-m68hc1x.c: Add alloca header.
	* xsym.c: Ditto.

Index: bfd/elf32-m68hc1x.c
RCS file: /cvs/src/src/bfd/elf32-m68hc1x.c,v
retrieving revision 1.33
diff -u -p -r1.33 elf32-m68hc1x.c
--- bfd/elf32-m68hc1x.c 12 Mar 2008 08:36:59 -0000      1.33
+++ bfd/elf32-m68hc1x.c 17 Mar 2009 23:18:58 -0000
@@ -20,6 +20,9 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */

+#include <alloca.h>
 #include "sysdep.h"
 #include "bfd.h"
 #include "bfdlink.h"
Index: bfd/xsym.c
RCS file: /cvs/src/src/bfd/xsym.c,v
retrieving revision 1.23
diff -u -p -r1.23 xsym.c
--- bfd/xsym.c  30 Jul 2008 04:34:56 -0000      1.23
+++ bfd/xsym.c  17 Mar 2009 23:18:58 -0000
@@ -23,6 +23,9 @@
 #include "xsym.h"
 #include "bfd.h"
 #include "libbfd.h"
+#include <alloca.h>

 #define bfd_sym_close_and_cleanup
 #define bfd_sym_bfd_free_cached_info
cvs diff: Diffing bfd/doc
cvs diff: Diffing bfd/hosts
cvs diff: Diffing bfd/po

More information about the Binutils mailing list