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

Re: [Minios-devel] [UNIKRAFT PATCHv6 32/37] plat/kvm: Update linker.uk to link image for Arm64



Hey Wei,

I noticed that on some installations it fails to link the image with:

/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: cannot open linker script file ldscripts/aarch64elf.xr: No such file or directory
collect2: error: ld returned 1 exit status

I think there might be something missing in the aarch64 cross compiler packages of Debian/Ubuntu. I could link and run the image by changing the LDFLAGS to -Wl,-m,aarch64linux.

Do you know something about this. Is this related?:
https://lkml.org/lkml/2018/7/10/190

Thanks,

Simon

On 14.09.2018 21:27, Simon Kuenzer wrote:
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 14.09.2018 09:57, Wei Chen wrote:
From: Wei Chen <Wei.Chen@xxxxxxx>

Update linker.uk to support link Arm64 image to aarch64elf
format.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
  plat/kvm/Linker.uk | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk
index 20fe1d2..daf2efe 100644
--- a/plat/kvm/Linker.uk
+++ b/plat/kvm/Linker.uk
@@ -1,6 +1,11 @@
  ifeq (x86_64,$(CONFIG_UK_ARCH))
  KVM_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/kvm/x86/link64.lds
  KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
+else ifeq (arm64,$(CONFIG_UK_ARCH))
+KVM_LDSCRIPT_SRC := $(CONFIG_UK_BASE)/plat/kvm/arm/link64.lds.S
+KVM_LDSCRIPT     := $(call src2lds,libkvmplat,$(KVM_LDSCRIPT_SRC))
+KVM_LDFLAGS-y     += -Wl,-m,aarch64elf
+$(eval $(call buildrule,libkvmplat,$(KVM_LDSCRIPT_SRC),$(KVM_LDSCRIPT)))
  endif
  ##
@@ -16,7 +21,7 @@ $(KVM_IMAGE): $(KVM_LINK) $(KVM_LINK-y) $(UK_LINK) $(UK_LINK-y) $(KVM_LDSCRIPT)
              $(UK_LINK) $(UK_LINK-y) -o $@.ld.o)
      $(call build_cmd,OBJCOPY,,$@.o,\
             $(OBJCOPY) -w -G kvmos_* -G _libkvmplat_entry $@.ld.o $@.o)
-ifeq (x86_64,$(CONFIG_UK_ARCH))
+ifneq ($(filter x86_64 arm64,$(CONFIG_UK_ARCH)),)
      $(call build_cmd,LD,,$@,\
             $(LD) $(LDFLAGS) $(LDFLAGS-y) \
               $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) \


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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