From 3f27eac30859f96c0b61520c17fcc84b7703ef2f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 23 Apr 2026 23:16:11 +0900 Subject: [PATCH] mruby-io: restore Windows link library dropped during HAL migration Commit 9965f11cfe1c ("mruby-io: migrate HAL to ports/ directories") moved the Windows HAL source into mruby-io/ports/win/ but dropped the linker.libraries declaration that previously lived in hal-win-io/mrbgem.rake. Both mingw and MSVC builds now fail to link with undefined references to closesocket, WSAStartup, WSACleanup, select, and WSAGetLastError referenced from io.c and io_hal.c. Re-declare ws2_32 under a for_windows? guard. Co-authored-by: Claude --- mrbgems/mruby-io/mrbgem.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mrbgems/mruby-io/mrbgem.rake b/mrbgems/mruby-io/mrbgem.rake index 63933c7b1..b9118713b 100644 --- a/mrbgems/mruby-io/mrbgem.rake +++ b/mrbgems/mruby-io/mrbgem.rake @@ -5,4 +5,8 @@ MRuby::Gem::Specification.new('mruby-io') do |spec| spec.build.defines << "HAVE_MRUBY_IO_GEM" spec.add_test_dependency 'mruby-time', core: 'mruby-time' + + if spec.for_windows? + spec.linker.libraries << "ws2_32" + end end