This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] GDB: PPC: sim: fix cross-compilation
- From: Aaro Koskinen <aaro dot koskinen at iki dot fi>
- To: Mike Frysinger <vapier at gentoo dot org>, gdb-patches at sources dot redhat dot com, gdb-patches at sourceware dot org
- Date: Mon, 17 Feb 2014 22:09:22 +0200
- Subject: [PATCH] GDB: PPC: sim: fix cross-compilation
- Authentication-results: sourceware.org; auth=none
Hi,
Please consider applying the below trivial patch.
When cross-compiling GDB for PPC, there's a prerequisite "-lz" for psim
that results in a build failure. With such prerequisite, GNU Make will
try to search the library from build machine's /usr/lib which is wrong.
On 64-bit Linux build machines the compilation will fail because of this.
This has been also reported on other operating systems, see e.g.
https://sourceware.org/bugzilla/show_bug.cgi?id=12202.
The fix is to delete system library linker options from
prerequisite/dependency list as they are not really useful anyway.
2014-02-17 Aaro Koskinen <aaro.koskinen@iki.fi>
* PR gdb/12202. Fix cross-compilation on PPC by removing compiler
library options from psim dependencies.
diff -uprN gdb-7.7.orig/sim/ppc/Makefile.in gdb-7.7/sim/ppc/Makefile.in
--- gdb-7.7.orig/sim/ppc/Makefile.in 2013-12-08 06:55:48.000000000 +0200
+++ gdb-7.7/sim/ppc/Makefile.in 2014-02-17 21:15:39.645080159 +0200
@@ -552,7 +552,7 @@ PACKAGE_SRC = @sim_pk_src@
PACKAGE_OBJ = @sim_pk_obj@
-psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
+psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
$(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
run: psim