This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Build failure due to .incbin
On Tue, Feb 27, 2007 at 12:01:52PM +0100, Andreas Schwab wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
>
> > binutils/
> > * bin2c.c: New file.
> > * Makefile.am (EXTRA_PROGRAMS): Add bin2c.
> > (CFILES): Add bin2c.c.
> > (bin2c_SOURCES): Define.
> > (bin2c.o): Dependencies from "make dep-am".
> > * configure.in (BUILD_MISC): Add bin2c.
>
> I don't think this works when building with a cross-compiler.
Indeed. Thanks for pointing this out. I also forgot to remove the
mention of spu_inc.o in ld/configure.tgt.
binutils/
* Makefile.am (PROGS): Add BUILD_INSTALL_MISC.
(bin_PROGRAMS): Replace BUILD_MISC with BUILD_INSTALL_MISC.
(EXTRA_PROGRAMS): Remove bin2c.
(bin2c$(EXEEXT_FOR_BUILD)): New rule.
(bin2c_SOURCES): Delete.
(DISTCLEANFILES): Remove sysinfo.
(MOSTLYCLEANFILES): Add sysinfo$(EXEEXT_FOR_BUILD) and
bin2c$(EXEEXT_FOR_BUILD).
* configure.in (BUILD_MISC): Add $(EXEEXT_FOR_BUILD) to bin2c.
Move embedspu to..
(BUILD_INSTALL_MISC): ..here.
* Makefile.in: Regenerate.
* configure: Regenerate.
ld/
* configure.tgt (spu-*-elf*): Delete targ_extra_ofiles.
Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.82
diff -u -p -r1.82 Makefile.am
--- binutils/Makefile.am 27 Feb 2007 08:31:45 -0000 1.82
+++ binutils/Makefile.am 28 Feb 2007 01:22:47 -0000
@@ -50,15 +50,15 @@ DLLWRAP_PROG=dllwrap
SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
-PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@
+PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ @BUILD_INSTALL_MISC@
-bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@
+bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@
## We need a special rule to install the programs which are built with
## -new, and to rename cxxfilt to c++filt.
noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
-EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG) bin2c
+EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG)
# Stuff that goes in tooldir/ if appropriate.
TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump
@@ -280,6 +280,9 @@ sysinfo.o:
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \
fi
+bin2c$(EXEEXT_FOR_BUILD):
+ $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c
+
embedspu: embedspu.sh
sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
chmod a+x $@
@@ -340,8 +343,6 @@ windres_LDADD = $(BFDLIB) $(LIBIBERTY) @
dllwrap_SOURCES = dllwrap.c version.c
dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
-bin2c_SOURCES = bin2c.c version.c
-
EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
@@ -349,8 +350,7 @@ EXTRA_DIST = arparse.c arparse.h arlex.c
diststuff: $(EXTRA_DIST) info
all: info
-DISTCLEANFILES = sysinfo sysroff.c sysroff.h \
- site.exp site.bak
+DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak
# Targets to rebuild dependencies in this Makefile.
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
@@ -399,7 +399,8 @@ dep-am: DEP
###
-MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh*
+MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
+ binutils.log binutils.sum abcdefgh*
mostlyclean-local:
-rm -rf tmpdir
Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.74
diff -u -p -r1.74 configure.in
--- binutils/configure.in 27 Feb 2007 08:31:45 -0000 1.74
+++ binutils/configure.in 28 Feb 2007 01:22:53 -0000
@@ -224,6 +224,7 @@ DLLTOOL_DEFAULT=
BUILD_WINDRES=
BUILD_DLLWRAP=
BUILD_MISC=
+BUILD_INSTALL_MISC=
OBJDUMP_DEFS=
for targ in $target $canon_targets
@@ -233,7 +234,7 @@ do
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
BUILD_SRCONV='$(SRCONV_PROG)'
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
- BUILD_MISC="${BUILD_MISC} bin2c"
+ BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
else
case $targ in
changequote(,)dnl
@@ -336,7 +337,7 @@ changequote([,])dnl
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
powerpc*-*-linux* | powerpc*-*-elf*)
- BUILD_MISC="${BUILD_MISC} embedspu"
+ BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
;;
sh*-*-pe)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@@ -347,7 +348,7 @@ changequote([,])dnl
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
spu-*-*)
- BUILD_MISC="${BUILD_MISC} bin2c"
+ BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
;;
mips*-*-pe)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@@ -393,6 +394,7 @@ AC_SUBST(DLLTOOL_DEFS)
AC_SUBST(BUILD_WINDRES)
AC_SUBST(BUILD_DLLWRAP)
AC_SUBST(BUILD_MISC)
+AC_SUBST(BUILD_INSTALL_MISC)
AC_SUBST(OBJDUMP_DEFS)
AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.206
diff -u -p -r1.206 configure.tgt
--- ld/configure.tgt 22 Feb 2007 15:05:42 -0000 1.206
+++ ld/configure.tgt 28 Feb 2007 01:22:55 -0000
@@ -577,7 +577,6 @@ sparc*-wrs-vxworks*) targ_emul=sparcaout
sparc*-*-rtems*) targ_emul=elf32_sparc
;;
spu-*-elf*) targ_emul=elf32_spu
- targ_extra_ofiles="spu_inc.o" ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;
tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;;
--
Alan Modra
IBM OzLabs - Linux Technology Centre