Bug #7817

(Unable to compile Ruby 2.0.0-rc2 on OSX (clang version 2.1)

Added by Lee Jarvis about 1 year ago. Updated about 1 year ago.

[ruby-core:52077]
Status:Rejected
Priority:High
Assignee:Kenta Murata
Category:build
Target version:2.0.0
ruby -v:2.0.0-rc2 Backport:

Description

clang -v returns

Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

Here's the make output:

https://gist.github.com/injekt/4e26a6dee2ce42fc463d

The same version compiles fine with gcc on the same system, and reportedly compiles without issues on more recent versions of clang


Related issues

Related to ruby-trunk - Bug #5076: Mac OS X Lion Support Closed 03/14/2011

History

#1 Updated by Yusuke Endoh about 1 year ago

  • Status changed from Open to Feedback

Thank you for your report. Were you able to compile rc1 successfully?

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Motohiro KOSAKI about 1 year ago

clang -v returns

Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

I recommend to use latest compiler. Following one works fine at least.
Old clang has plenty bugs.

Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

#3 Updated by Lee Jarvis about 1 year ago

I believe I did compile rc1 successfully but I can't reproduce since I have updated clang, chances are it probably doesn't compile properly, though.

I understand using an older version of clang would be an issue and that's fine, but we should state this in the install documentation somewhere, otherwise people using an older clang version having segfaults installing Ruby may not know to check this.

#4 Updated by Koichi Sasada about 1 year ago

  • Assignee set to Yusuke Endoh
  • Priority changed from Normal to High

#5 Updated by Yusuke Endoh about 1 year ago

  • Assignee changed from Yusuke Endoh to Kenta Murata

mrkn, what do you think?

Yusuke Endoh mame@tsg.ne.jp

#6 Updated by Yui NARUSE about 1 year ago

  • Status changed from Feedback to Rejected

As I wrote in #5076, CRuby requires "Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)" or later.
It is bundled with Xcode 4.2.
If you want to build old Xcode, use --with-gcc=gcc-4.2.

Old clang has many bugs like http://llvm.org/bugs/show_bug.cgi?id=8319

#7 Updated by Jim Haungs about 1 year ago

Compiling Ruby 2 RC2 with the latest Xcode fails on OSX 10.8.2.

clang -v
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

[2013-02-19 15:41:21] make
CC = gcc-4.2
LD = ld
LDSHARED = gcc-4.2 -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -DFORTIFYSOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBYEXPORT -fPIE
CPPFLAGS = -D
XOPENSOURCE -DDARWINCSOURCE -DDARWINUNLIMITEDSELECT -DREENTRANT -I/Users/jhaungs/.rvm/usr/include -I/Users/jhaungs/.rvm/usr/include -I. -I.ext/include/x8664-darwin12.2.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic
lookup -Wl,-multiplydefined,suppress -L/Users/jhaungs/.rvm/usr/lib -L/Users/jhaungs/.rvm/usr/lib -fstack-protector -Wl,-u,objcmsgSend -pie

SOLIBS =
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling dmyversion.c
compiling miniprelude.c
translating probes probes.d
. ./vm
opts.h
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dlnfind.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm
dump.c
compiling vmbacktrace.c
compiling vm
trace.c
compiling thread.c
compiling cont.c
compiling ./enc/ascii.c
compiling ./enc/usascii.c
compiling ./enc/unicode.c
compiling ./enc/utf
8.c
compiling newline.c
compiling ./missing/setproctitle.c
compiling dmyext.c
linking miniruby
/Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:111: [BUG] Stack consistency error (sp: 38, bp: 36)
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin12.2.0]

-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.

-- Control frame information -----------------------------------------------
c:0006 p:0038 s:0038 e:000037 CLASS /Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:111
c:0005 p:0035 s:0034 e:000033 CLASS /Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:107
c:0004 p:0009 s:0032 e:000031 TOP /Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:85 [FINISH]
c:0003 p:---- s:0030 e:000029 CFUNC :require
c:0002 p:0098 s:0026 E:002468 EVAL ./tool/mkconfig.rb:11 [FINISH]
c:0001 p:0000 s:0002 E:0025b8 TOP [FINISH]

./tool/mkconfig.rb:11:in <main>'
./tool/mkconfig.rb:11:in
require'
/Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:85:in <top (required)>'
/Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:107:in
module:FileUtils'
/Users/jhaungs/.rvm/src/ruby-2.0.0-rc2/lib/fileutils.rb:111:in `module:NoWrite'

-- C level backtrace information -------------------------------------------
0 miniruby 0x000000010d74ada4 rbvmbugreport + 164
1 miniruby 0x000000010d6228ee reportbug + 302
2 miniruby 0x000000010d622ba4 rb
bug + 180
3 miniruby 0x000000010d740e10 vmexeccore + 32080
4 miniruby 0x000000010d740fee vmexec + 94
5 miniruby 0x000000010d741eca rb
iseqeval + 266
6 miniruby 0x000000010d627502 rb
loadinternal + 306
7 miniruby 0x000000010d628c51 rb
requiresafe + 1313
8 miniruby 0x000000010d730c04 call
cfunc1 + 20
9 miniruby 0x000000010d737096 vm
callcfunc + 1046
10 miniruby 0x000000010d745c20 vm
callmethod + 224
11 miniruby 0x000000010d73c2d3 vm
execcore + 12819
12 miniruby 0x000000010d740fee vm
exec + 94
13 miniruby 0x000000010d741d9e rbiseqevalmain + 206
14 miniruby 0x000000010d625c6f ruby
execinternal + 111
15 miniruby 0x000000010d626c52 ruby
run_node + 82
16 miniruby 0x000000010d5ed0cf main + 79
17 libdyld.dylib 0x00007fff916917e1 start + 0
18 ??? 0x0000000000000009 0x0 + 9

-- Other runtime information -----------------------------------------------

  • Loaded script: ./tool/mkconfig.rb

  • Loaded features:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6

#8 Updated by Eric Hodel about 1 year ago

jhaungs (Jim Haungs) wrote:

Compiling Ruby 2 RC2 with the latest Xcode fails on OSX 10.8.2.

clang -v
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

[2013-02-19 15:41:21] make
CC = gcc-4.2
LD = ld
LDSHARED = gcc-4.2 -dynamic -bundle

You did not build with clang.

#9 Updated by Nobuyoshi Nakada about 1 year ago

Yeah, I did see this error with apple-gcc42.
Is it still alive, and is the fix needed?

Also available in: Atom PDF