This reverts a change of commit b3598cf2a3 .
On Windows on ARM64 with LLVM the "NM" tool is called with a parameter like so:
```
RbConfig::CONFIG["NM"] # => "llvm-nm --no-llvm-bc"
```
Therefore the command must be called with a shell string.
* Since it does not work when using some configure options such as:
.../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
as the CI does.
* It also duplicates the logic of spec/ruby/optional/capi/spec_helper.rb incorrectly.
ruby/spec maintainers have no experience and no interest in dealing with these complicated CRuby build system issues.
We asked help on the CRuby Slack and nobody helped so far.
- `if exist` and `del` ignore directories matching the wildcard,
remove both separately.
- `rd /s` ignores wildcards, while `del` removes ordinary files by the
wildcard, iterate over matching directories by `for /D`.
This change will be merged into 3.5 along with other encoding, command
line, environment variables, etc.
Revert following commits:
- bd831bcca5
[Bug #20929] Win32: Use `wcsftime`
- 1c15f641cc
[Bug #20929] Win32: Encode timezone name in UTF-8
- 78762b5218
[Bug #20929] Fix `assert_zone_encoding`
1. Store the `PKG_CONFIG` variable in Makefile.sub (or try to get it from the ENV var PKG_CONFIG in mkmf.rb)
2. Try to use --msvc-syntax, with a fallback to replacing -Lxxx with -libpath:xxx. --msvc-syntax has been in pkgconf since 1.4.0 (released 7 years ago). pkg-config (freedesktop), does not support it, hence the fallback.
3. The `try_ldflags` passes these `ldflags` as the `opt` parameter to the `link_command`, not as `ldflags`. Unix systems are forgiving in that regard, MSVC is not: as a result as passing them as `opt`, they (specifically the `/libpath:xxx` ones) end up passed before the `-link` command to `cl.exe` and it throws because it ignores it and therefore can't find the lib.
```
cl : Command line warning D9002 : ignoring unknown option '-libpath:C:/Users/julien/.conan2/p/libff3726d89a6255c/p/lib'
```
Two minor fixes to arm64 instruction decoding when looking for __pioinfo:
1. add_mask was shifted by one bit, it was intended to be 0x7f800000. However, since the mask was already excluding matching the 'sh' bit, and since the purpose of the add following the adrp is to add in the lower 12 bits, I opted to set the mask to 0x7fc00000 and simply remove the handling for the 12 bit shift option which is now required to be disabled in order to match.
2. adrp's immediate was supposed to be sign extended. So far, I have not seen cases where the global variable ends up before the code in memory, but it's a possibility, so handle the sign extension.