rwallace
rwallace

Reputation: 33375

Building Ruby on Windows and conftest.c

I'm trying to build Ruby on Windows using clang. It builds just fine with the Microsoft compiler, but when I substitute clang, the configure stage fails with the following error:

C:\ruby-2.2.2\win32\build40>..\configure.bat
conftest.c(2,2) :  error:
#error
 ^
1 error generated.
clang-cl.exe: warning: Creating verconf.mk: 'linker' input unused
clang-cl.exe: warning: argument unused during compilation: '-I ../..'
clang-cl.exe: warning: argument unused during compilation: '-I ../../include'
NMAKE : fatal error U1077: 'cl' : return code '0x1'
Stop.

The next step would be to look at conftest.c to try to see what's going on, but a search across the entire hard disk finds no file of that name, and a log of all commands issued during configure doesn't shed much light either. What's up with this, and how can I get hold of a copy of conftest.c?

Further discussion at http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/433633?433552-433636

Upvotes: 1

Views: 337

Answers (1)

Azolo
Azolo

Reputation: 4383

Well, if I had to guess, conftest.c is a temp file created by nmake to test the environment, and the problem is that nmake can't find cl (which should be replaced by clang-cl) when trying to run that test.

Check inside of the Ruby config script. I bet you'll find something that is causing nmake to look for cl instead of clang-cl. But I'm not sure.

I know that when building Ruby with clang from the mingw64 tool chain that I had huge amounts of trouble getting any linker to work properly. It was pretty meh.

Upvotes: 1

Related Questions