Use -mno-outline-atomics for supporting aarch64 compilers
Newer aarch64 gcc compilers will link to helper functions that will select atomic
instructions based on ISA version. We do not have these helpers, so this change
disables this feature as long as the compiler supports this option.
@@ -117,6 +117,14 @@ ifeq ($(ARCH),x86_64)
KERNCFLAGS+= -mno-sse \
-mno-sse2
endif
+
+ifeq ($(ARCH),aarch64)
+OUTLINE_ATOMICS= $(shell $(CC) --help=target | grep -c outline-atomics)
+ifneq ($(OUTLINE_ATOMICS),0)
+KERNCFLAGS+= -mno-outline-atomics
+endif
+endif
+
KERNCFLAGS+= -fno-omit-frame-pointer
KERNLDFLAGS= --gc-sections -z max-page-size=4096 -L $(OUTDIR)/klib
