Commit graph

1823 commits

Author SHA1 Message Date
Nobuyoshi Nakada
401932c18f
NMake needs caret to escape a hash sign 2025-08-12 18:19:09 +09:00
Nobuyoshi Nakada
cc4eba000b
Win: Use @ instead of echo off in vssetup.cmd
`echo off` affects the batch files called from this file as well.
2025-08-11 20:29:55 +09:00
Lars Kanis
dc10c92749 Revert to shell execution when invoking nm tool
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.
2025-08-03 23:43:58 +09:00
Nobuyoshi Nakada
b3598cf2a3 Win: Strip CRs from cpp and nm output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
2025-08-01 00:15:27 +09:00
Hiroshi SHIBATA
be7b1164e6 Split autogenerated dependency to depend file from common.mk 2025-07-25 19:50:06 +09:00
Nobuyoshi Nakada
4c60e431e1
Win32: Suppress an error message when baseruby is not found 2025-07-24 15:45:35 +09:00
Nobuyoshi Nakada
1395abd025
Win: Use VsDevCmd.bat instead of old vcvarsall.bat 2025-06-01 12:16:18 +09:00
Nobuyoshi Nakada
a64616fb4c
Win: Fix winget command to install 2025-06-01 10:24:06 +09:00
Nobuyoshi Nakada
a333fb1ecc
Win: Add scripts to install and setup 2025-05-30 18:44:28 +09:00
Nobuyoshi Nakada
72bda0f981
[Bug #21255] Win32: Do not export __declspec(selectany) symbols
```
x64-vcruntime140-ruby350.def : error LNK2001: unresolved external symbol Avx2WmemEnabledWeakValue
```
2025-05-27 15:26:25 +09:00
Nobuyoshi Nakada
e1adb6cb15
Win: Suppress false warnings from Visual C 17.14.1
https://developercommunity.visualstudio.com/t/warning-C5287:-operands-are-different-e/10877942?

It is not able to silence "operands are different enum types"
warnings, even using an explicit cast, as the message says.
2025-05-27 15:26:24 +09:00
Nobuyoshi Nakada
ec41b1e823 Fix for old mingw without clock_gettime and clock_getres 2025-05-22 13:08:39 +09:00
Nobuyoshi Nakada
b48b841378 digest.so needs ruby/digest.h which is installed by build-ext 2025-05-12 02:50:25 +09:00
Nobuyoshi Nakada
204740b73f Revert "Try removing building C API specs in CRuby makefiles entirely"
This reverts commit 2a9236366d.
spec/ruby/optional/capi/spec_helper.rb doesn't work well for mingw.
2025-05-12 02:50:25 +09:00
Nobuyoshi Nakada
3e47e7a499 Fix redefinition of clock_gettime and clock_getres
winpthreads-git 12.0.0.r720 provides `clock_gettime` and
`clock_getres` as inline functions.
2025-05-12 02:50:25 +09:00
Hiroshi SHIBATA
49742414f6 Revert "Fix redefinition of clock_gettime and clock_getres"
This reverts commit 585598623d.

This broke Windows CIs

```
linking miniruby.exe
   Creating library miniruby.lib and object miniruby.exp
process.obj : error LNK2019: unresolved external symbol clock_gettime referenced in function rb_clock_gettime
random.obj : error LNK2001: unresolved external symbol clock_gettime
thread.obj : error LNK2001: unresolved external symbol clock_gettime
time.obj : error LNK2001: unresolved external symbol clock_gettime
process.obj : error LNK2019: unresolved external symbol clock_getres referenced in function rb_clock_getres
miniruby.exe : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.EXE"' : return code '0x2'
```
2025-05-11 12:09:26 +09:00
Nobuyoshi Nakada
585598623d
Fix redefinition of clock_gettime and clock_getres
winpthreads-git 12.0.0.r720 provides `clock_gettime` and
`clock_getres` as inline functions.
2025-05-10 18:26:09 +09:00
Benoit Daloze
2a9236366d Try removing building C API specs in CRuby makefiles entirely
* 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.
2025-05-09 23:22:15 +02:00
YO4
9c71b5901c fix rb_w32_strerror when errno < 0
change SystemCallError.new(-1) message on Windows

(Bug #21083)
https://bugs.ruby-lang.org/issues/21083
2025-03-19 01:28:59 +09:00
Nobuyoshi Nakada
2782cc75a9
Win32: Remove intermediate files for rubyspec-capiext 2025-03-12 18:20:40 +09:00
Nobuyoshi Nakada
3239af9b5d
Win32: Make object files in the same place as the DLLs 2025-03-12 18:20:39 +09:00
Nobuyoshi Nakada
3278e3b6f3
[Bug #21177] Win32: Allow longer path name 2025-03-12 00:46:05 +09:00
Hiroshi SHIBATA
13c64a8a20 Pass XINCFLAGS for gmp build with Windows platform
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-02-17 18:08:37 +09:00
Nobuyoshi Nakada
4a67ef09cc
[Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
Nobuyoshi Nakada
cf00b31b5d
Remove a stale function for MJIT 2025-02-13 13:12:24 +09:00
Nobuyoshi Nakada
908fe85dfc
Remove stale comment for MJIT 2025-02-13 13:06:59 +09:00
ydah
ccb4ba45ed Use LRAMA instead of YACC 2025-01-14 17:20:02 +09:00
Nobuyoshi Nakada
3cd809deb5
Win32: Fix rm.bat
- `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`.
2024-12-31 14:53:07 +09:00
Nobuyoshi Nakada
adbbc9109e
Win32: Update clean commands for bundled gems 2024-12-27 16:27:30 +09:00
Nobuyoshi Nakada
3a2d1feb1e
Win32: Rewrite rm.bat
`rd` cannot remove ordinary files, use `del` or `rd` for each entry.
2024-12-27 16:25:49 +09:00
Nobuyoshi Nakada
6be0ae35e8
Win32: Remove win32 directory if empty 2024-12-27 14:25:07 +09:00
Nobuyoshi Nakada
fb82f3a632 Win32: Defer change of timezone name encoding after 3.4
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`
2024-12-24 13:25:55 +09:00
Julien Marrec
be7e5f1f85 Implements [Feature #3456]: Support pkgconf on windows
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'
```
2024-12-23 11:52:14 +09:00
Nobuyoshi Nakada
e1ff13b146
modular-gc-precheck for mswin 2024-12-22 22:10:26 +09:00
Nobuyoshi Nakada
2f2530b195
Allow variables in modular_gc_dir
Such as `$(ruby_version)`, `$(arch)` and so on.
2024-12-22 22:10:26 +09:00
Nobuyoshi Nakada
c25dd4ee47
Win32: Add coroutine for mswin on arm64 2024-12-17 20:25:06 +09:00
Nobuyoshi Nakada
36c36d0486
Win32: Allow arm64 platform 2024-12-17 20:25:05 +09:00
Nobuyoshi Nakada
f12e2622c1 Split system dependent commands to clean modular-gc 2024-12-10 12:31:47 +09:00
Nobuyoshi Nakada
1c15f641cc [Bug #20929] Win32: Encode timezone name in UTF-8 2024-12-06 18:59:38 +09:00
Hiroshi SHIBATA
8f2575a17d
Typofix 2024-12-02 10:32:05 +09:00
Nobuyoshi Nakada
96fac34797
Win32: Accept slashes in --with-opt-dir argument 2024-12-01 17:31:10 +09:00
Nobuyoshi Nakada
029174a402
Win32: Use the symbolic name for the default NTVER
And embed the given `_WIN32_WINNT` in config.h as well, for extension
libraries.
2024-12-01 10:13:35 +09:00
Nobuyoshi Nakada
091c7d4a54
Win32: Make waring 4013 error
```
'function' undefined; assuming extern returning int
The compiler encountered a call to an undefined function.
```
2024-12-01 10:13:34 +09:00
Nobuyoshi Nakada
ed9fff67f0
Win32: Accept a symbolic name for --with-ntver option 2024-11-30 15:21:51 +09:00
jeremyd2019
4745338a3f [win32] fix arm64 instruction decoding
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.
2024-11-30 14:22:55 +09:00
Nobuyoshi Nakada
c6ca339955
Fix --empty option of ifchange 2024-11-24 18:34:01 +09:00
Nobuyoshi Nakada
80cfa57234
[Feature #20563] Update required Windows version
Update the default `NTVER`, so that the declarations of APIs
introduced since Windows 8 will be enabled.
https://learn.microsoft.com/cpp/porting/modifying-winver-and-win32-winnt
2024-11-22 19:01:55 +09:00
Nobuyoshi Nakada
7b8db102be
win32/ifchange.bat: Remove code for old command.com [ci skip] 2024-11-18 18:06:08 +09:00
Nobuyoshi Nakada
3fee7e7d38
win32/ifchange.bat: Discard useless message
When the destination does not exist, `del` needs to do nothing.
2024-11-18 18:05:49 +09:00
Nobuyoshi Nakada
d768b200ab
win32/setup.mak: Remove unnecessary quotes and adjust quoting style 2024-11-18 18:05:29 +09:00