Project

General

Profile

Actions

Feature #16795

open

build ruby.exe on Windows against ruby-static.lib omitting x64-vcruntime-ruby.dll (no '--enable-shared' option for Windows)

Added by repu1sion (Andrii Guriev) over 4 years ago. Updated over 4 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:97927]

Description

I'm trying to build ruby for embedded windows environment. It would help a lot if I would be able to do it without '--enable-shared'
as it could be done for Linux platform. So on linux just ruby-static.a built, without any .so.
Executable is about 10Mb and it depends only on libc, libm, libdl, libphtread.
But in windows case there is no such option in configure.bat and as a result I have
18Kb executable and 3Mb x64-vcruntime-ruby.dll. Even if I hack Makefile.sub and change 'enable_shared' from 'yes' to 'no' it
just doesn't build .dll but executable is still 18Kb and relies on missed dll, it doesn't get linked against libruby-static.lib.
The real problem I have later when I try to build some C native extensions, so byebug for example generates its makefile
automatically and builds also against x64-vcruntime-ruby.dll which leads to some segfaults because it just calls functions
from .dll which is present on host but not in embedded environment. In case of linux nmap just shows that during byebug
linking all ruby functions like st_lookup etc are undefined ('U' symbol). So it finds this functions later.
But on Windows when I build byebug it already depends on x64-vcruntime-ruby.dll
Is there any way to build ruby.exe on Windows against static lib, without relying on .dll ?
So it seems '--enable-shared' on Windows is just enabled by default and there is no correct way to disable it (but could be done on Linux platform)

Actions

Also available in: Atom PDF

Like0
Like0Like0