clang:错误:无法执行命令:分段错误:11

时间:2014-10-22 15:57:17

标签: ruby-on-rails ruby xcode clang

抱歉我的英文。我安装json gem时遇到clang的问题。 我安装了xcode,xcode命令行工具等。我无法在stackoverflow,google中找到问题,我也不知道。 我有xver 6.1的Mavericks 10.9.4。 我尝试了在stackoverflow,google中找到的所有内容。 经度:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/Users/terrry/.rvm/rubies/ruby-2.0.0-p576/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
Stack dump:
0.  Program arguments:    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.7.0 -emit-obj -disable-free -disable-llvm-verifier -main-file-name generator.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -coverage-file /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1/ext/json/ext/generator/generator.o -resource-dir  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -D JSON_GENERATOR -D _XOPEN_SOURCE -D _DARWIN_C_SOURCE -D _DARWIN_UNLIMITED_SELECT -D _REENTRANT -I . -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0/x86_64-darwin13.4.0 -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0/ruby/backward -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0 -I . -I /Users/travis/.sm/pkg/active/include -O3 -fdebug-compilation-dir /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1/ext/json/ext/generator -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.7.0 -fencode-extended-block-signature -fno-common -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o generator.o -x c generator.c 
1.<eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'generator.c'.
4.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@cState_initialize'
 clang: error: unable to execute command: Segmentation fault: 11
 clang: error: clang frontend command failed due to signal (use -v to see invocation)
 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
 Target: x86_64-apple-darwin13.1.0
 Thread model: posix
 clang: note: diagnostic msg: PLEASE submit a bug report to        http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source,   and associated run script.
 clang: note: diagnostic msg: 
   ********************

    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    clang: note: diagnostic msg:/var/folders/6g/
     z_zh4w3n1vddfmvbct9205600000gn/T/generator-4b740d.c
    clang: note: diagnostic msg: /var/folders/6g/z_zh4w3n1vddfmvbct9205600000gn/T/generator- 4b740d.sh
  clang: note: diagnostic msg: 

   ********************
   make: *** [generator.o] Error 254

   make failed, exit code 2

   Gem files will remain installed in /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1 for inspection.
   Results logged to /Users/terrry/.rvm/gems/ruby-2.0.0-p576/extensions/x86_64-darwin-13/2.0.0-static/json-1.8.1/gem_make.out

1 个答案:

答案 0 :(得分:0)

在clang下,我在编译.c文件时遇到了类似的错误,该文件的行长度超过了C99标准的最大允许长度:4,095个字符。错误消息在这里没有用。