[m-rev.] diff: Support Linux/Aarch64 targets using clang in configure_cross.

Peter Wang novalazy at gmail.com
Mon Sep 2 17:04:45 AEST 2024


tools/configure_cross:
    Include config values for clang targeting Linux/Aarch64.

    Loosen matches on linux target triples in case a vendor is included,
    e.g. on Alpine Linux the target triple is aarch64-alpine-linux-musl.

README.cross.md:
    Update documentation.

diff --git a/README.cross.md b/README.cross.md
index cbe55163f..c4f092c24 100644
--- a/README.cross.md
+++ b/README.cross.md
@@ -15,6 +15,7 @@ The following targets are currently supported using clang:
   * FreeBSD x86-64
   * macOS x86-64
   * macOS AArch64 (ARM64)
+  * Linux AArch64 (ARM64)
 
 Furthermore, instead of transferring the Mercury installation to the target
 system and running it there, you can augment the cross-compiled installation
diff --git a/tools/configure_cross b/tools/configure_cross
index eb3dadd82..aceb2f424 100755
--- a/tools/configure_cross
+++ b/tools/configure_cross
@@ -2,7 +2,7 @@
 # vim: ft=sh ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 2012 The University of Melbourne.
-# Copyright (C) 2014, 2018, 2021-2022 The Mercury team.
+# Copyright (C) 2014, 2018, 2021-2024 The Mercury team.
 # This file may only be copied under the terms of the GNU General
 # Public License - see the file COPYING in the Mercury distribution.
 #---------------------------------------------------------------------------#
@@ -97,7 +97,7 @@ case "$cc_type:$host" in
         mercury_cv_gcc_model_reg=yes
         mercury_cv_cannot_use_structure_assignment=yes
         ;;
-    gcc:aarch64-linux-gnu | gcc:aarch64-linux-musl)
+    gcc:aarch64-*linux-gnu | gcc:aarch64-*linux-musl)
         # Taken from the config.cache file after running configure -C
         # - in a Debian 10 arm64 environment (for glibc)
         # - in a Alpine Linux aarch64 environment (for musl)
@@ -114,11 +114,14 @@ case "$cc_type:$host" in
         mercury_cv_gcc_model_reg=yes
         mercury_cv_cannot_use_structure_assignment=no
         ;;
-    clang:x86_64-*freebsd* | clang:x86_64-*darwin* | clang:aarch64-*darwin*)
+    clang:x86_64-*freebsd* | clang:x86_64-*darwin* | clang:aarch64-*darwin* |\
+        clang:aarch64-*linux-gnu | clang:aarch64-*linux-musl)
         # Taken from the config.cache file after running configure -C
         # - in a FreeBSD 13.0 x86-64 environment
         # - in a macOS 10.14 x86-64 environment
         # - in a macOS 12.4 aarch64 environment
+        # - in a Debian 12 arm64 environment (for glibc)
+        # - in a Alpine Linux aarch64 environment (for musl)
         mercury_cv_cc_type=clang
         mercury_cv_siginfo_t=yes
         mercury_cv_pc_access=no
-- 
2.44.0



More information about the reviews mailing list