This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: <offlist> gcc-go cross Makefile.am issue
- From: Ian Lance Taylor <iant at google dot com>
- To: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Cc: xi yang <hiyangxi at gmail dot com>, Chris Johns <chrisj at rtems dot org>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 Apr 2010 15:43:16 -0700
- Subject: Re: <offlist> gcc-go cross Makefile.am issue
- References: <4BAE969A.1040302@oarcorp.com>
Joel Sherrill <joel.sherrill@OARcorp.com> writes:
> There may be a better forum for this but here goes.
>
> libgo/Makefile.am has this:
>
> # How to build a .gox file from a .a file.
> BUILDGOX = \
> set -e; \
> rm -f $@.o; \
> $(CC) -r -nostdlib -o $@.o -Wl,--whole-archive $<; \
> objcopy -j .go_export $@.o $@.tmp; \
> mv -f $@.tmp $@; \
> rm -f $@.o
>
> Notice the use of the native objcopy. It should use
> the one for the target.
>
> I was building for sparc-rtems4.10 so the native Fedora
> objcopy wasn't happy with sparc object. :)
Thanks for pointing that out. Fixed like so. Patch committed to
gccgo branch.
Ian
diff -r 407e15e77f82 libgo/Makefile.am
--- a/libgo/Makefile.am Wed Apr 07 15:21:34 2010 -0700
+++ b/libgo/Makefile.am Wed Apr 07 15:41:03 2010 -0700
@@ -1489,7 +1489,7 @@
set -e; \
rm -f $@.o; \
$(CC) -r -nostdlib -o $@.o -Wl,--whole-archive $<; \
- objcopy -j .go_export $@.o $@.tmp; \
+ $(OBJCOPY) -j .go_export $@.o $@.tmp; \
mv -f $@.tmp $@; \
rm -f $@.o
diff -r 407e15e77f82 libgo/configure.ac
--- a/libgo/configure.ac Wed Apr 07 15:21:34 2010 -0700
+++ b/libgo/configure.ac Wed Apr 07 15:41:03 2010 -0700
@@ -35,6 +35,7 @@
AC_PROG_LD
AC_PROG_RANLIB
+AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL