-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile on Windows XP (32-bit) fails #36
Comments
This may be fixed with #39. Reopen if it is not. |
Thanks, but GitHub doesn't seem to have provided me with the ability to reopen it. :) Version 1.1.15 (on my 32-bit Windows XP) still results in "internal compiler error: Illegal instruction". I suspect the -D_FILE_OFFSET_BITS=64 compiler option (from mkmf.log, below) may be illegal on my 32-bit machine. Suggestively, web searching "D_FILE_OFFSET_BITS" produced this StackOverflow answer: "Compile your programs with "gcc -D_FILE_OFFSET_BITS=64". This forces all file access calls to use the 64 bit variants...For portability with other platforms you should use getconf LFS_CFLAGS which will return -D_FILE_OFFSET_BITS=64 on Linux platforms but might return something else on e.g. Solaris": If this is the problem (although I'm not a gcc expert), I suspect some way could be found (for atomic) to work on 32-bit machines as well, by providing gcc compiler options which work on both 64 and 32-bit machines. Does this make sense for atomic?
|
That does indeed sound possible, but I'm not very good with Makefiles on Windows. Perhaps @unak knows what we need to do? |
I'm not an expert of gcc, but it seems the problem of mingw's gcc. |
Now I have reported it on the RubyInstaller mailing list. I'll document here what I've learned so far. The command in question (which I'm using on a 32-bit Windows XP) is Interestingly, it worked fine using Ruby 1.9.3 and the 1.9.3 Ruby development kit (for Windows). At first, after a fresh install (without setting up the Ruby development kit), a minimal example:
seemed to reveal a problem involving Ruby 2.0.0 Standard Library's mkmf (for 32-bit machines). However, on my 32-bit Linux machine with Ruby 2.0.0-p247, the same commands also output "-D_FILE_OFFSET_BITS=64", yet the 1.1.15 gem installed just fine. Therefore that gcc option seems unlikely to be the problem. |
@MarkDBlackwell @unak if the problem appears in Ruby 2.0.0, then is a problem with Usage of To my bad I don't have a Windows XP installation handy, but will have one this weekend. Will take a look then and get back to you guys. |
@luislavena Great, thank you! I will wait to see if there's anything we need to do in atomic. |
@MarkDBlackwell hello, I believe I see your problem: you have a cygwin-based or cygwin installed version of GCC that is not the one compatible with RubyInstaller. From your backtrace:
RubyInstaller requires the exact version of GCC that was used to compile it, and is distributed as a DevKit that contains all the necessary pieces to properly work. You can see from the target information:
That the cygwin provided compiler is not compatible with RubyInstaller, as the target platform of RubyInstaller is Even if you had version 4.7.2 (the one used by RubyInstaller), you need to target the exact same platform/architecture, which is not the case of the GCC you have installed. In RubyInstaller troubleshooting page: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-cygwin It clearly mentions to avoid mixing up Cygwin with RubyInstaller. At RubyInstaller downloads page: http://rubyinstaller.org/downloads/ You will see a list of versions of Ruby and the indication of the matching DevKit. The following is the output of a clean installation of Ruby 2.0.0-p451 with mingw-w64-4.7.2 DevKit installing atomic gem:
@headius we have been having great results cross-compiling gems with rake-compiler and rake-compiler-dev-box Having pre-compiled binaries will reduce the issues some users experience with mismatched compilers. Would you like to try that out and let me know if works for you? Just recently @tenderlove released newer sqlite3 and provided Windows binaries using this approach. The binaries included 1.8.7, 1.9.3 and 2.0.0 binaries plus a 64bits version of the gem: http://rubygems.org/gems/sqlite3/versions
Let me know if that helps. Cheers. |
@luislavena, yes; that's a good tip. I noticed that Cygwin problem also (after my first report) so I corrected it by removing Cygwin from my PATH. Now, when I install the gem from the Windows command line, my PATH includes no gcc. Also, in order to forestall problematic versions of other programs, I removed almost everything from my PATH. (Please see the gist.) However, gem installation is still failing. I made a gist of the command line output including mkmf.log. I installed the Devkit from file DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe. At this point, I don't know how to verify which gcc version my "gem install" command is using. That might be interesting.
Is the word length of your (physical) XP machine 64 bits, perhaps? I'm thinking this might make a difference. |
I'm using a 32bits version of XP, 64bits XP is very rare and highly unlikely RubyInstaller will work on it. All this time we have talk about 32bits Ruby and 32bits XP. The setting From the gist you showed to us:
It is clear something is failing in your system. This could be caused by some DLLs copied in your system folder that might be affecting how GCC works. You can start try copy the I also noticed this: Asking this because installation on folder with spaces is discouraged, as some gems and lot of tools do not work properly. Either way, the problem on your system seems very specific to your Windows XP installation. I've managed to get a fresh Windows XP SP3 VM (thanks to modern.ie), installed Ruby 2.0.0-p451 and DevKit mingw64-32-4.7.2 in it and got this: https://gist.github.com/luislavena/9302220 If you need further assistance, we can coordinate a TeamViewer session so I can get into your machine and verify what could be the problem. But definitely is not RubyInstaller or atomic related. |
File conftest.c is auto-generated (per RubyGems Guides, section Gems with Extensions). Of course, gem atomic's file extconf.rb generates conftest.c, perhaps based on various things it finds when probing one's particular system. For this reason, I'm thinking the problem may be atomic related, or Ruby language mkmf related. I copied the visible code. Running gcc produced "illegal instruction". This gist shows the command line output.
Actually, passing a completely empty file to gcc produces "illegal instruction" also (for me). Supposedly, my fresh reinstall of Ruby should have installed all the correct, needed DLLs over any hypothetical bad DLLs. Isn't this right?
It's a real folder. |
Hello @MarkDBlackwell,
I really don't understand if my english is the problem, not understanding what I said or you simply play with me. I stayed up until 3am last night, downloading and testing a Windows XP SP3 machine and test the issue to help you out, and proved you the issue is not Ruby, RubyInstaller or DevKit related, but you keep insisting on that. I've been building, compiling and solving Ruby and RubyInstaller issues for the past 7 years and pretty much I can detect when the problem is something in system or the problem is something I did wrong with Ruby or RubyInstaller.
That has nothing to do if in your machine you already have some DLLs that could affect GCC execution. Again, see the troubleshooting page of RubyInstaller: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-devkit_dll_conflict As you can see from there, we had in the past similar experiences and investigated to obtain resolutions, which later where shared in the wiki. Me testing on a clean XP SP3 box and that it worked is enough for me to say and confirm there is something specific on your environment that is interfering with the compilation. I've offered assist you over a TeamViewer session to help resolve this, yet you decided not to quote or respond to that. If you're interested on help me solve your current issue, please reach me out on RubyInstaller mailing list: https://groups.google.com/forum/#!forum/rubyinstaller So we can coordinate a TeamViewer session day and time. Again: the issue you're experiencing, after your testing of GCC against a empty file proves the issue is not Ruby or atomic related. |
@luislavena, you are absolutely right: my particular computer has a problem. (I also confirmed it isn't a 32-bit machine issue (just now), by accessing another 32-bit XP computer.) I also believe it's not atomic-related (so closing). Everyone: I regret the noise!
No, no! I do appreciate your past time and effort on this problem (and, I regret your spending it). I can only hope that the time you spent setting up a (virtual?) XP box might help other people also (not just me). :)
I do respect your expertise, wisdom and experience! Previously, from my ignorance on how 32-bit XP works on a 64-bit box, I merely worried that my use of a 32-bit box, and your (possible) use of a 64-bit box, might make some difference. I am aware that you are expert in resolving any problems which people may experience (due to their own computers' peculiarities) while using RubyInstaller and DevKit (and, presumably, much more). Moreover, I regret I didn't explicitly acknowledging your expertise before now! :) Particularly, I thank you so much for alerting me to (the existence of) the DLL conflict Wiki page. :) Furthermore, I personally wish to give you many thanks for all your good efforts in building and maintaining the Windows RubyInstaller and Devkit these many years. I'm sure there are many people who appreciate and (obviously) greatly benefit from them, although you may not have heard from them all. :)
I thank you; I did listen. Later, I might accept your kind offer. :) Regarding anything further, I might contact you on the RubyInstaller mailing list. Again, I thank you for all you've done, and for all you do! |
A peculiarity of my computer indeed caused this particular, preconfigured gcc compiler to generate an illegal instruction fault. The peculiarity was: My CPU's architecture was older than A RubyInstaller forum comment provides more information (if desired). |
Compiling on Windows 7 works (for me). However, on Windows XP, I get 'internal compiler error: Illegal instruction'. The latest version (atomic gem) that installs (for me) is 0.0.4. On the Windows command line:
$ gem install atomic -v '1.1.14' --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing atomic:
ERROR: Failed to build gem native extension.
Check the mkmf.log file for more details.
$ copy C:\progra\ruby\200\p353\lib\ruby\gems\2.0.0\gems\atomic-1.1.14\ext\mkmf.log con:
"gcc -o conftest.exe -IC:/progra/ruby/200/p353/include/ruby-2.0.0/i386-mingw32 -IC:/progra/ruby/200/p353/include/ruby-2.0.0/ruby/backward -IC:/progra/ruby/200/p353/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -march=native conftest.c -L. -LC:/progra/ruby/200/p353/lib -L. -lmsvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c:1:0: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See [email protected] for instructions.
checked program was:
/* begin _/
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char *_argv)
6: {
7: return 0;
8: }
/* end */
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.8.2/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.2-2/src/gcc-4.8.2/configure
--srcdir=/cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.2-2/src/gcc-4.8.2 --prefix=/usr --ex
ec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec -
-datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --d
atarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/h
tml -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --wi
thout-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-l
ibgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap
--disable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disa
ble-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ -
-enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --di
sable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp -
-enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --dis
able-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-
libintl-prefix --with-system-zlib --libexecdir=/usr/lib
Thread model: posix
gcc version 4.8.2 (GCC)
$ ruby -v
ruby 2.0.0p353 (2013-11-22) [i386-mingw32]
$ gem env
RubyGems Environment:
The text was updated successfully, but these errors were encountered: