[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 7/9] stubdom: fix unfound libgmp library issues



From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx>

With binutils 2.25.0 libgmp is not found. When building
studom's we build our own libgmp for each minios. On
x86-64 all libraries are put on the directory:

stubdom/cross-root-x86_64/x86_64-xen-elf/lib/

The exception is libgmp, it gets tosse don lib64. It doesn't
seem the latest linker might amend lib64 as a default search
path when using -nostdlib -- I cannot confirm from binutils
code changes that's the case yet, but at least through the
observed behaviour that seems to be the case.

Be explicit and peg the lib64 directory as part of the search
path as well when on x86-64. This fixes the following final
linker error:

ld -r -d -nostdlib
-L/sda3/home/mcgrof/devel/xen/stubdom/cross-root-x86_64/x86_64-xen-elf/lib
-m elf_x86_64 -\( /sda3/home/mcgrof/devel/xen/stubdom/vtpm/vtpm.a -T
app.lds -\) -ltpm -ltpm_crypto -lgmp -lpolarssl --undefined main -o
/sda3/home/mcgrof/devel/xen/stubdom/mini-os-x86_64-vtpm/mini-os_app.o
ld: cannot find -lgmp

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
---
 stubdom/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index e1359cfaf7e5..e01be070bf26 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -53,6 +53,11 @@ TARGET_CPPFLAGS += -I$(CURDIR)/include
 TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
+# lib64 is not pegged as default search path for archs for some versions
+# of binutils, its where libgmp gets tossed, so be explicit
+ifeq ($(XEN_TARGET_ARCH),x86_64)
+TARGET_LDFLAGS += -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib64
+endif
 
 TARGETS=$(STUBDOM_TARGETS)
 
-- 
2.6.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.