From: Santiago Pagani Date: Thu, 19 Dec 2019 11:20:26 +0000 (+0100) Subject: Fix newlib ARM64 support X-Git-Tag: RELEASE-0.4~5 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6e126947ea46b3eb7c1cafdd01b450d8b4517a9d;p=unikraft%2Flibs%2Fnewlib.git Fix newlib ARM64 support At the moment newlib compiles for ARM64 but fails at runtime. This patch changes some generic newlib files for the machine specific newlib files for ARM64. Signed-off-by: Santiago Pagani Reviewed-by: Felipe Huici --- diff --git a/Makefile.uk b/Makefile.uk index a963e82..7ccc771 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) @@ -732,10 +734,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 @@ -743,17 +748,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 @@ -796,11 +805,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