From 22df8d61bedca015c887c69d0a003a40bdcb7398 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 23 Apr 2026 23:16:02 +0900 Subject: [PATCH] mruby-socket: restore Windows link libraries dropped during HAL migration Commit d9e107c80136 ("mruby-socket: migrate HAL to ports/ directories") moved the Windows HAL source into mruby-socket/ports/win/ but dropped the linker.libraries declarations that previously lived in hal-win-socket/mrbgem.rake. Both mingw and MSVC builds now fail to link with undefined references to WSAStartup, socket, send, and other Winsock APIs. Re-declare wsock32 and ws2_32 under a for_windows? guard. Co-authored-by: Claude --- mrbgems/mruby-socket/mrbgem.rake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mrbgems/mruby-socket/mrbgem.rake b/mrbgems/mruby-socket/mrbgem.rake index a0586944d..f6e6dffb0 100644 --- a/mrbgems/mruby-socket/mrbgem.rake +++ b/mrbgems/mruby-socket/mrbgem.rake @@ -8,4 +8,9 @@ MRuby::Gem::Specification.new('mruby-socket') do |spec| spec.add_dependency('mruby-io', :core => 'mruby-io') spec.add_dependency('mruby-error', :core => 'mruby-error') # spec.add_dependency('mruby-mtest') + + if spec.for_windows? + spec.linker.libraries << "wsock32" + spec.linker.libraries << "ws2_32" + end end