This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build failure due to .incbin


On Sun, Feb 25, 2007 at 01:34:11PM +0100, Segher Boessenkool wrote:
> [Ulrich, you're the maintainer for the SPU stuff, right?]

No, I am.

> gcc -c -Wa,-I,../../../src/ld/emultempl -o spu_inc.o 
> ../../../src/ld/emultempl/spu_inc.s
> ../../../src/ld/emultempl/spu_inc.s:6:Unknown pseudo-op: .incbin
> 
> This file is compiled with the native assembler, and it
> doesn't know .incbin .  Please fix :-)

Sigh.  Built-in support for spu overlays requires that we smuggle an
spu object file into ld somehow.  gas .incbin is one way, another is
"objcopy -I binary -O <host_format>", a third is "ld -r -b binary".
All of these methods rely on host tools to some extent.  I guess
the thing to do is simply not support a built-in overlay manager
if the host tools are deficient.

> Also, is there a way to say --enable-targets=all --oh-but-not-these-few?

Nope.

	* emultempl/spuelf.em (_binary_builtin_ovl_mgr_start): Rename
	to _binary_spu_ovl_o_start.
	(_binary_builtin_ovl_mgr_end): Rename to _binary_spu_ovl_o_end.
	(spu_elf_load_ovl_mgr): Fatal error on missing overlay manager.
	* emultempl/spu_inc.s: Rename symbols.
	* emultempl/spu_none.s: New file.
	* emultempl/spu_ovl.S: Update copyright.
	* Makefile.am (spu_inc.o): Try building with ld -r first, then
	gas incbin, then build without overlay manager.
	* Makefile.in: Regenerate.

Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.229
diff -u -p -r1.229 Makefile.am
--- ld/Makefile.am	17 Feb 2007 13:33:57 -0000	1.229
+++ ld/Makefile.am	26 Feb 2007 08:43:26 -0000
@@ -724,8 +724,14 @@ eelf32_sparc_vxworks.c: $(srcdir)/emulpa
 eelf32_spu.c: $(srcdir)/emulparams/elf32_spu.sh $(srcdir)/emultempl/spuelf.em \
   $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_spu "$(tdir_elf32_spu)"
-spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_ovl.o
-	$(CC) -c -Wa,-I,$(srcdir)/emultempl -o $@ $<
+spu_inc.o: $(srcdir)/emultempl/spu_inc.s $(srcdir)/emultempl/spu_none.s \
+  $(srcdir)/emultempl/spu_ovl.o
+	cp $(srcdir)/emultempl/spu_ovl.o spu_ovl.o; \
+	if ! ld -r -o $@ -b binary spu_ovl.o; then \
+	  if ! $(CC) -c -o $@ $(srcdir)/emultempl/spu_inc.s; then \
+	    $(CC) -c -o $@ $(srcdir)/emultempl/spu_none.s; \
+	  fi \
+	fi
 $(srcdir)/emultempl/spu_ovl.o: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
 	cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
 	if ../gas/as-new --version \
Index: ld/emultempl/spu_inc.s
===================================================================
RCS file: /cvs/src/src/ld/emultempl/spu_inc.s,v
retrieving revision 1.1
diff -u -p -r1.1 spu_inc.s
--- ld/emultempl/spu_inc.s	25 Oct 2006 06:49:21 -0000	1.1
+++ ld/emultempl/spu_inc.s	26 Feb 2007 08:39:40 -0000
@@ -1,7 +1,7 @@
  .text
- .globl _binary_builtin_ovl_mgr_start
- .globl _binary_builtin_ovl_mgr_end
+ .globl _binary_spu_ovl_o_start
+ .globl _binary_spu_ovl_o_end
 
-_binary_builtin_ovl_mgr_start:
+_binary_spu_ovl_o_start:
  .incbin "spu_ovl.o"
-_binary_builtin_ovl_mgr_end:
+_binary_spu_ovl_o_end:
Index: ld/emultempl/spu_none.s
===================================================================
RCS file: ld/emultempl/spu_none.s
diff -N ld/emultempl/spu_none.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emultempl/spu_none.s	26 Feb 2007 08:37:42 -0000
@@ -0,0 +1,6 @@
+ .text
+ .globl _binary_spu_ovl_o_start
+ .globl _binary_spu_ovl_o_end
+
+_binary_spu_ovl_o_start:
+_binary_spu_ovl_o_end:
Index: ld/emultempl/spu_ovl.S
===================================================================
RCS file: /cvs/src/src/ld/emultempl/spu_ovl.S,v
retrieving revision 1.2
diff -u -p -r1.2 spu_ovl.S
--- ld/emultempl/spu_ovl.S	13 Feb 2007 07:47:22 -0000	1.2
+++ ld/emultempl/spu_ovl.S	26 Feb 2007 08:37:42 -0000
@@ -1,6 +1,6 @@
 /* Overlay manager for SPU.
 
-   Copyright 2006 Free Software Foundation, Inc.
+   Copyright 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GLD, the Gnu Linker.
 
Index: ld/emultempl/spuelf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/spuelf.em,v
retrieving revision 1.1
diff -u -p -r1.1 spuelf.em
--- ld/emultempl/spuelf.em	25 Oct 2006 06:49:21 -0000	1.1
+++ ld/emultempl/spuelf.em	26 Feb 2007 08:37:42 -0000
@@ -38,12 +38,12 @@ static int emit_stub_syms = 0;
 static bfd_vma local_store_lo = 0;
 static bfd_vma local_store_hi = 0x3ffff;
 
-extern void *_binary_builtin_ovl_mgr_start;
-extern void *_binary_builtin_ovl_mgr_end;
+extern void *_binary_spu_ovl_o_start;
+extern void *_binary_spu_ovl_o_end;
 
 static const struct _ovl_stream ovl_mgr_stream = {
-  &_binary_builtin_ovl_mgr_start,
-  &_binary_builtin_ovl_mgr_end
+  &_binary_spu_ovl_o_start,
+  &_binary_spu_ovl_o_end
 };
 
 static asection *toe = NULL;
@@ -118,6 +118,8 @@ spu_elf_load_ovl_mgr (void)
     {
       /* User supplied __ovly_load.  */
     }
+  else if (ovl_mgr_stream.start == ovl_mgr_stream.end)
+    einfo ("%F%P: no built-in overlay manager\n");
   else
     {
       lang_input_statement_type *ovl_is;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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