diff --git a/repos/ports/ports/gcc.hash b/repos/ports/ports/gcc.hash index 1ffe6771f1..3a3e4cd70e 100644 --- a/repos/ports/ports/gcc.hash +++ b/repos/ports/ports/gcc.hash @@ -1 +1 @@ -b6533ff19936e6aceac99a98b8a29779e5f8a393 +893d85767720fc2b3c695c56d737d2307b1f2229 diff --git a/repos/ports/src/noux-pkg/gcc/patches/aarch64.patch b/repos/ports/src/noux-pkg/gcc/patches/aarch64.patch new file mode 100644 index 0000000000..921e80b942 --- /dev/null +++ b/repos/ports/src/noux-pkg/gcc/patches/aarch64.patch @@ -0,0 +1,40 @@ +diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h +index b9bf979..86f64f9 100644 +--- a/gcc/config/aarch64/aarch64.h ++++ b/gcc/config/aarch64/aarch64.h +@@ -935,4 +935,20 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); + extern tree aarch64_fp16_type_node; + extern tree aarch64_fp16_ptr_type_node; + ++/* genode.h */ ++ ++/* ++ * The 'LINK_SPEC' define comprises the rules of how the GCC frontend invokes ++ * the linker. ++ */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%(shared:-shared) \ ++ %{!static:--eh-frame-hdr}" ++ ++/* Don't assume anything about the header files. */ ++/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57699 */ ++#define NO_IMPLICIT_EXTERN_C ++ + #endif /* GCC_AARCH64_H */ +diff --git a/libgcc/config.host b/libgcc/config.host +index fd206a4..a9a07ad 100644 +--- a/libgcc/config.host ++++ b/libgcc/config.host +@@ -331,8 +331,9 @@ esac + + case ${host} in + aarch64*-*-elf | aarch64*-*-rtems*) +- extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o" ++ extra_parts="$extra_parts crtbegin.o crtbeginS.o crtbeginT.o crtend.o crti.o crtn.o" + extra_parts="$extra_parts crtfastmath.o" ++ tmake_file="$tmake_file t-freebsd t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" + tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" + ;; diff --git a/repos/ports/src/noux-pkg/gcc/patches/series b/repos/ports/src/noux-pkg/gcc/patches/series index 2aab10bcc6..663d26c301 100644 --- a/repos/ports/src/noux-pkg/gcc/patches/series +++ b/repos/ports/src/noux-pkg/gcc/patches/series @@ -11,3 +11,4 @@ target_libbacktrace.patch noux_build.patch arm.patch new_opa.patch +aarch64.patch diff --git a/tool/tool_chain b/tool/tool_chain index d112efc35d..034c2a3a94 100755 --- a/tool/tool_chain +++ b/tool/tool_chain @@ -15,6 +15,7 @@ help: $(ECHO) "--- available commands ---" $(ECHO) "x86 - create tool chain for x86" $(ECHO) "arm - create tool chain for arm" + $(ECHO) "aarch64 - create tool chain for aarch64/arm64" $(ECHO) "riscv - create tool chain for riscv" $(ECHO) "clean - clean everything except downloaded archives" $(ECHO) "cleanall - clean everything including downloaded archives" @@ -30,7 +31,7 @@ help: # User interface # -SUPPORTED_PLATFORMS := x86 arm riscv +SUPPORTED_PLATFORMS := x86 arm riscv aarch64 PLATFORM := $(firstword $(filter $(SUPPORTED_PLATFORMS),$(MAKECMDGOALS))) @@ -193,6 +194,7 @@ LOCAL_LIB_INSTALL_LOCATION = $(BUILD_LOCATION)/lib-install TARGET_NAME_x86 = x86_64-pc-elf TARGET_NAME_arm = arm-none-eabi TARGET_NAME_riscv = riscv64-unknown-elf +TARGET_NAME_aarch64 = aarch64-none-elf GCC_CONFIG_riscv = --with-arch=rv64imac --with-abi=lp64