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

Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH 1/1] Add patch to have newlib running on ARM64



Hi,

On 19/12/2019 11:20, Santiago Pagani wrote:
At the moment newlib can compile for ARM64, but it fails at runtime.
This patch changes some generic newlib files for the machine specific
newlib files for ARM64 when using ARM64.

This commit does not explain what sort of problem is encountered and why using machine specific will solve it.

Technically generic code should work for all the architectures but may not be efficient. So what is the exact problem here?

Cheers,


Signed-off-by: Santiago Pagani <santiagopagani@xxxxxxxxx>
---
  Makefile.uk | 37 ++++++++++++++++++++++++-------------
  1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/Makefile.uk b/Makefile.uk
index 17d8d7a..8828ebb 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -106,10 +106,12 @@ LIBNEWLIB_SUPPRESS_FLAGS-$(call gcc_version_ge,6,0) += 
-Wno-misleading-indentati
  LIBNEWLIB_SUPPRESS_FLAGS-$(call gcc_version_ge,6,0) += 
-Wno-shift-negative-value
  LIBNEWLIB_SUPPRESS_FLAGS-$(call gcc_version_ge,7,0) += 
-Wno-implicit-fallthrough
-LIBNEWLIBC_CFLAGS-y += $(LIBNEWLIB_SUPPRESS_FLAGS-y)
-LIBNEWLIBM_CFLAGS-y   += $(LIBNEWLIB_SUPPRESS_FLAGS-y)
-LIBNEWLIBC_CXXFLAGS-y += $(LIBNEWLIB_SUPPRESS_FLAGS-y)
-LIBNEWLIBM_CXXFLAGS-y += $(LIBNEWLIB_SUPPRESS_FLAGS-y)
+LIBNEWLIB_NO_BUILTINS          += -D__NO_SYSCALLS__ -fno-builtin
+
+LIBNEWLIBC_CFLAGS-y   += $(LIBNEWLIB_SUPPRESS_FLAGS-y) $(LIBNEWLIB_NO_BUILTINS)
+LIBNEWLIBM_CFLAGS-y   += $(LIBNEWLIB_SUPPRESS_FLAGS-y) $(LIBNEWLIB_NO_BUILTINS)
+LIBNEWLIBC_CXXFLAGS-y += $(LIBNEWLIB_SUPPRESS_FLAGS-y) $(LIBNEWLIB_NO_BUILTINS)
+LIBNEWLIBM_CXXFLAGS-y += $(LIBNEWLIB_SUPPRESS_FLAGS-y) $(LIBNEWLIB_NO_BUILTINS)
LIBNEWLIBGLUE_SUPPRESS_FLAGS-y += -Wno-unused-parameter
  LIBNEWLIBGLUE_CFLAGS-y   += $(LIBNEWLIBGLUE_SUPPRESS_FLAGS-y)
@@ -731,10 +733,13 @@ LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/memmem.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/rindex.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcasecmp.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcat.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strchr.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcmp.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strchr.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strchr.S
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strcmp.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strcmp.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcoll.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcpy.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strcpy.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strcpy.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcspn.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strdup.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strdup_r.c
@@ -742,17 +747,21 @@ LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strerror.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strerror_r.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strlcat.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strlcpy.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strlen.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strlen.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strlen.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strlwr.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strncasecmp.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strncasecmp_l.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strncat.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strncmp.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strncmp.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strncmp.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strncpy.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strnlen.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strnlen.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strnlen.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strnstr.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strpbrk.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strrchr.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strrchr.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strrchr.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strsep.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strsignal.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strspn.c
@@ -795,11 +804,13 @@ LIBNEWLIBC_SRCS-y += 
$(LIBNEWLIB_LIBC)/string/xpg_strerror_r.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/bcmp.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/memccpy.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/mempcpy.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/stpcpy.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/stpcpy.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/stpcpy.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/stpncpy.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strndup.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strcasestr.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strchrnul.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBNEWLIB_LIBC)/string/strchrnul.c
+LIBNEWLIBC_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(LIBNEWLIB_LIBC)/machine/aarch64/strchrnul.S
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/strndup_r.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/wcpcpy.c
  LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/string/wcpncpy.c


--
Julien Grall

_______________________________________________
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®.