This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cross building 4.3.2 for m68k--netbsdelf
- From: "Kurt J. Lidl" <lidl at pix dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Dec 2008 23:09:17 -0500
- Subject: cross building 4.3.2 for m68k--netbsdelf
A while ago, I attempted to build 4.3.2 for the target m68k--netbsdelf
on my SPARC running Solaris 10 Update 4.
It failed like this:
[...]
gcc64 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -W
strict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-a
ttribute -DHAVE_CONFIG_H -o Tcollect2 \
collect2.o tlink.o intl.o version.o ../libcpp/libcpp.a ../libiberty/li
biberty.a ../libdecnumber/libdecnumber.a
Undefined first referenced
symbol in file
m68k_cpu_flags collect2.o
ld: fatal: Symbol referencing errors. No output written to Tcollect2
collect2: ld returned 1 exit status
Further testing revealed that I could compile
a m68k-elf targeted compiler from the 4.3.2 sources.
I finally dug into the problem enough to fix the cross-build
for the target m68k--netbsdelf system.
It appears that using the TARGET_68010 macro in the netbsdelf.h
header is what causes the m68k_cpu_flags variable to become
referenced in collect2.o which then causes the link to fail.
Anyhow, changing the netbsdelf.h file gets me past this point,
which was a stumbling block for a long time.
-Kurt
--- gcc/config/m68k/netbsd-elf.h.orig Thu Aug 2 06:49:31 2007
+++ gcc/config/m68k/netbsd-elf.h Tue Dec 30 21:56:29 2008
@@ -52,11 +52,11 @@
#undef TARGET_VERSION
-#define TARGET_VERSION \
- fprintf (stderr, \
- TARGET_68010 \
- ? " (NetBSD/68010 ELF)" \
- : " (NetBSD/m68k ELF)");
+#ifdef __mc68010__
+#define TARGET_VERSION fprintf (stderr, " (NetBSD/68010 ELF)");
+#else
+#define TARGET_VERSION fprintf (stderr, " (NetBSD/m68k ELF)");
+#endif
/* Provide a CPP_SPEC appropriate for NetBSD m68k targets. Currently we