aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPierrick Bouvier <101587250+pbo-linaro@users.noreply.github.com>2023-11-23 12:17:28 +0400
committerGitHub <noreply@github.com>2023-11-23 17:17:28 +0900
commit784fdecc4c9f6ba9a8fc872518872ed6bdbc6670 (patch)
tree87b4eee2c395854bc56331b66536bcc82616a123 /configure.ac
parente8b905896482f2952ccbb4d5bf0a1910edd07bf9 (diff)
downloadruby-784fdecc4c9f6ba9a8fc872518872ed6bdbc6670.tar.gz
windows-arm64 support (#8995)
* [win32] fix compilation for windows-arm64 Credits to MSYS2 Ruby package using this patch. * [win32] nm use full options Fix compilation error when using MSYS2 environment. Credits to MSYS2 Ruby package using this patch. * [win32] detect llvm-windres (used for windows-arm64) When adding preprocessor option for llvm-windres (using clang as parameter), it fails. Thus, do not add this. It's needed to be able to compile windows-arm64 version, because MSYS2 toolchain is LLVM based (instead of GCC/binutils). * [win32] pioinfo detection for windows-arm64 This fixes "unexpected ucrtbase.dll" for native windows-arm64 ruby binary. It does not solve issue with x64 version emulated on this platform. Value of pioinfo pointer can be found in ucrtbase.dll at latest adrp/add sequence before return of _isatty function. This works for both release and debug ucrt. Due to the nature of aarch64 ISA (vs x86 or x64), it's needed to disassemble instructions to retrieve offset value, which is a bit more complicated than matching specific string patterns. Details about adrp/add usage can be found in this blog post: https://devblogs.microsoft.com/oldnewthing/20220809-00/?p=106955 For instruction decoding, the Arm documentation was used as a reference.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5bac4f0c63..ec1d6adc49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -509,6 +509,9 @@ AS_CASE(["$target_os"],
],
[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
+USE_LLVM_WINDRES=no
+windres_version=`windres --version | grep LLVM`
+test -z "$windres_version" || USE_LLVM_WINDRES=yes
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -2664,6 +2667,9 @@ AS_CASE([$coroutine_type], [yes|''], [
[*86-mingw*], [
coroutine_type=win32
],
+ [aarch64-mingw*], [
+ coroutine_type=arm64
+ ],
[arm*-linux*], [
coroutine_type=arm32
],
@@ -4239,6 +4245,7 @@ AC_SUBST(MINIOBJS)
AC_SUBST(THREAD_MODEL)
AC_SUBST(COROUTINE_TYPE, ${coroutine_type})
AC_SUBST(PLATFORM_DIR)
+AC_SUBST(USE_LLVM_WINDRES)
firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`