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)
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
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
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