Project

General

Profile

Actions

Bug #19044

open

Attempting to compile a static ruby 3.1 fails with MinGW

Added by maxirmx (Maxim Samsonov) about 2 years ago.

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

Description

  1. I use the code from https://github.com/ruby/ruby/tree/ruby_3_1 and GHA workflow at https://github.com/ruby/ruby/blob/ruby_3_1/.github/workflows/mingw.yml as a baseline

  2. I alter configure command in the workflow from

- name: configure
  run: >
    ../src/configure --disable-install-doc --prefix=/.
    --build=$CHOST --host=$CHOST --target=$CHOST
   to
- name: configure
  run: >
     ../src/configure --disable-install-doc --with-static-linked-ext --disable-shared --without-gmp -- prefix=/.
      --build=$CHOST --host=$CHOST --target=$CHOST

and uncomment option nodynamic in ext/Setup

  1. The first failure I observe is:
C:\msys64\ucrt64\bin\dllwrap.exe: WARNING: C:\msys64\ucrt64\bin\dllwrap.exe is deprecated, use gcc -shared or ld -shared instead
C:\msys64\ucrt64\bin\dllwrap.exe: no export definition file provided.
Creating one, but that may not be what you want
x86_64-w64-mingw32-cc: error: unrecognized command-line option '-mno-cygwin'; did you mean '-mno-clwb'?
C:\msys64\ucrt64\bin\dllwrap.exe: x86_64-w64-mingw32-cc exited with status 1
make: *** [GNUmakefile:73: ruby.exp] Error 1
 In order to resolve it I comment out ``` DLLWRAP += -mno-cygwin``` in ```cygwin/GNUmakefile.in```
  1. Then I get the second failure:
creating ruby.exp
C:\msys64\ucrt64\bin\dllwrap.exe: WARNING: C:\msys64\ucrt64\bin\dllwrap.exe is deprecated, use gcc -shared or ld -shared instead

C:\msys64\ucrt64\bin\dllwrap.exe: no export definition file provided.
Creating one, but that may not be what you want
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol _DllMainCRTStartup@12; defaulting to 0000000063981000
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol _DllMainCRTStartup@12; defaulting to 0000000063981000
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: cannot find entry symbol _DllMainCRTStartup@12; defaulting to 0000000063981000
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ruby.o:ruby.c:(.text+0x54f5): undefined reference to `Init_enc'
collect2.exe: error: ld returned 1 exit status
make: *** [GNUmakefile:74: ruby.exp] Error 1

I believe that when GNUMakefile is generated disable-shared flag is ignored silently

No data to display

Actions

Also available in: Atom PDF

Like0