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

Re: [Minios-devel] [PATCH 37/40] arm64: add the makefile



Hi Steve,

On 07/11/17 09:34, Steve Capper wrote:
On Tue, Nov 07, 2017 at 04:32:36PM +0800, Huang Shijie wrote:
On Mon, Nov 06, 2017 at 06:00:30PM +0000, Julien Grall wrote:
Hi Shijie,

On 03/11/17 03:12, Huang Shijie wrote:
Add the makefile for arm64 code.

This patch refers to Chen Baozi's patch:
       "Initial codes for arm64"

Change-Id: I8fab7db2fe0d24d700e8be2dc9477e5812d6643b
Jira: ENTOS-247
Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
   arch/arm/arm64/Makefile | 26 ++++++++++++++++++++++++++
   arch/arm/arm64/arch.mk  |  7 +++++++
   2 files changed, 33 insertions(+)
   create mode 100644 arch/arm/arm64/Makefile
   create mode 100644 arch/arm/arm64/arch.mk

diff --git a/arch/arm/arm64/Makefile b/arch/arm/arm64/Makefile
new file mode 100644
index 0000000..f268441
--- /dev/null
+++ b/arch/arm/arm64/Makefile
@@ -0,0 +1,26 @@
+#
+# ARM architecture specific makefiles.
+#
+TOPLEVEL_DIR = $(CURDIR)/../../..
+OBJ_DIR=$(CURDIR)
+
+include ../../../Config.mk
+include ../../../minios.mk
+
+ifeq ($(MINIOS_TARGET_ARCH),arm64)
+src-y += ../setup.c ../mm.c ../sched.c ../gic.c ../events.c ../time.c traps.c

This is really ugly and clearly show the lack of cohesion between arm64 and
arm32. You would not need that if the directory arm where containing only
common code.
Okay, I will try to move it to some common place with the arm32..


+src-$(CONFIG_BALLOON) += ../balloon.c
+
+ARCH_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(src-y))
+ARCH_OBJS += $(OBJ_DIR)/hypercalls64.o
+endif
+
+all: $(OBJ_DIR)/$(ARCH_LIB)
+
+# $(HEAD_ARCH_OBJ) is only built here, needed on linking
+# in ../../Makefile.
+$(OBJ_DIR)/$(ARCH_LIB): $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+       $(AR) rv $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS)
+
+clean:
+       rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
diff --git a/arch/arm/arm64/arch.mk b/arch/arm/arm64/arch.mk
new file mode 100644
index 0000000..28e1d9c
--- /dev/null
+++ b/arch/arm/arm64/arch.mk
@@ -0,0 +1,7 @@
+ifeq ($(MINIOS_TARGET_ARCH),arm64)
+ARCH_CFLAGS  := -D__aarch64__ -DXEN_HAVE_PV_GUEST_ENTRY -mgeneral-regs-only 
-fno-PIE

Why do you need to define __aarch64__? The compiler should to it for you.
Yes. we can remove it.

Why do you define XEN_HAVE_PV_GUEST_ENTRY? Arm does not have any start_info
page.
okay, I will remove.


Lastly, why -fno-PIE?
Steve tested a platform which compile very slowly, and need the -fno-PIE
for it.

Hi,

-fno-PIE is needed when building with a Debian Stretch or newer toolchain,
as these are configured with: --enable-default-pie

If we omit -fno-PIE then a global object table is used where we are not
expecting it and this results in crashes in the early code as uninitialised
pointers are dereferenced.

Thank you for the explanation! But I am slightly confused, I tried to build Xen for Arm64 (AFAICT we don't set fno-pie) the GCC from Stretch. I see no issue to boot it.

So how is that different with Mini-OS?

Cheers,

--
Julien Grall

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

 


Rackspace

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