diff options
author | Pierrick Bouvier <101587250+pbo-linaro@users.noreply.github.com> | 2023-11-23 12:17:28 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 17:17:28 +0900 |
commit | 784fdecc4c9f6ba9a8fc872518872ed6bdbc6670 (patch) | |
tree | 87b4eee2c395854bc56331b66536bcc82616a123 /cygwin | |
parent | e8b905896482f2952ccbb4d5bf0a1910edd07bf9 (diff) | |
download | ruby-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 'cygwin')
-rw-r--r-- | cygwin/GNUmakefile.in | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in index 0929859030..192a8cc711 100644 --- a/cygwin/GNUmakefile.in +++ b/cygwin/GNUmakefile.in @@ -3,9 +3,14 @@ gnumake = yes include Makefile DLLWRAP = @DLLWRAP@ --target=$(target_os) --driver-name="$(CC)" -windres-cpp := $(CPP) -xc -windres-cpp := --preprocessor=$(firstword $(windres-cpp)) \ - $(addprefix --preprocessor-arg=,$(wordlist 2,$(words $(windres-cpp)),$(windres-cpp))) +ifeq (@USE_LLVM_WINDRES@,yes) # USE_LLVM_WINDRES + # llvm-windres fails when preprocessor options are added + windres-cpp := +else + windres-cpp := $(CPP) -xc + windres-cpp := --preprocessor=$(firstword $(windres-cpp)) \ + $(addprefix --preprocessor-arg=,$(wordlist 2,$(words $(windres-cpp)),$(windres-cpp))) +endif WINDRES = @WINDRES@ $(windres-cpp) -DRC_INVOKED STRIP = @STRIP@ |