Bug #10566
closedFailure to compile ruby-trunk via mingw-w64 on linux
Description
=begin
Greetings;
In my quest for optimizing my network usage (very slow connection), I've been migrating my
archlinux installation to a sort of gentoo setup, building my own packages from source repos.
In the process of that, I've written a PKGBUILD file to compile ruby, lib32-libruby, and
mingw-w64-ruby.
While the recipe works fine against ruby 2.1.5's source code, I'm running into issues with
ruby-trunk, either from the svn repo or the git mirror. ruby and lib32-libruby both compile
fine, but the mingw-w64 build fails at attempting to link ruby.exe and rubyw.exe, citing a
number of undefined references to Init_ in extinit.c, while the dll, dll.a, and static.a
files compile just fine. While I am solely building for the sake of using it as a linked in
library for embedding this is hopefully of little concern to me, however I feel it
is my duty to report the issue here.
Files
Updated by ntzrmtthihu777 (Marty Plummer) over 10 years ago
my configure command:
configure_args=' '''--host=i686-w64-mingw32''' '''--target=i686-w64-mingw32''' '''--build=x86_64-unknown-linux-gnu''' '''--prefix=/usr/i686-w64-mingw32''' '''--enable-shared''' '''--enable-static''' '''--disable-install-doc''' '''--disable-install-rdoc''' '''--disable-install-capi''' '''--with-out-ext=readline,sdbm''' '''--with-static-linked-ext''' '''--disable-ipv6''' '''--with-tcl-dir=/usr/i686-w64-mingw32''' '''--with-tk-dir=/usr/i686-w64-mingw32''' '''build_alias=x86_64-unknown-linux-gnu''' '''host_alias=i686-w64-mingw32''' '''target_alias=i686-w64-mingw32''' '''CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4''' '''LDFLAGS=''' '''CPPFLAGS=-DHAVE_TYPE_NET_LUID''' '''CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4''''
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Status changed from Open to Feedback
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED
Could you show your exts.mk file?
And...
- --enable-static is not a valid option
- --disable-install-doc implies --disable-install-rdoc and --disable-install-capi
- --with-tcl-dir and --with-tk-dir don't make sense as they are equal to --prefix
- -O2 -g -pipe -Wall and
_FORTIFY_SOURCE
are redundant
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
Applied in changeset r48711.
extmk.rb: no EXTOBJS to main if enable-shared
- ext/extmk.rb: as all extension objects including initializations
of ext and enc shouild be linked to libruby if enable-shared,
EXTOBJS should not be linked to main programs.
[ruby-core:66675] [Bug #10566]
Updated by ntzrmtthihu777 (Marty Plummer) over 10 years ago
Ah, one second. Some of the redundancy is due to archlinux shipping a pair of configure wrapper scripts to make looping the build for i686 and x86_64 w64-mingw32 simpler; I was not aware that --disable-install-doc implies the others, I adopted a PKGBUILD that last worked on some 2.0.0 ruby version, and I figured if it wasn't broke, don't fix it.
Give me a bit, I'm doing real physical work at home, and I'm running the build again against the latest svn to get the exts.mk file untainted by my experimentation.
Updated by ntzrmtthihu777 (Marty Plummer) over 10 years ago
Nobuyoshi Nakada wrote:
Applied in changeset r48711.
extmk.rb: no EXTOBJS to main if enable-shared
- ext/extmk.rb: as all extension objects including initializations
of ext and enc shouild be linked to libruby if enable-shared,
EXTOBJS should not be linked to main programs.
[ruby-core:66675] [Bug #10566]
Ah, many thanks! I just reran makepkg, which updates source of repo-based builds, and it worked. Was scratching my head for a second there, then I noticed your post with the fix. Huge thanks, quick resolution :)