首页 新闻 会员 周边 捐助

Mac OS X下release编译CoreCLR的问题

0
悬赏园豆:30 [已解决问题] 解决于 2015-02-09 00:01

编译命令:

./build.sh amd64 release clean

错误信息:

Building ASM object src/vm/wks/CMakeFiles/cee_wks.dir/__/amd64/virtualcallstubamd64.S.o
Linking CXX static library libcee_wks.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: 
file: libcee_wks.a(jithelpers_slow.S.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: 
file: libcee_wks.a(jithelpers_slow.S.o) has no symbols
[ 39%] Built target cee_wks
make: *** [all] Error 2
Failed to build coreclr components.

上面只是警告,实际错误是:

Undefined symbols for architecture x86_64:
  "_DBG_CheckStackAlignment", referenced from:
      _DuplicateHandle in libCoreClrPal.a(handleapi.cpp.o)
      _CloseHandle in libCoreClrPal.a(handleapi.cpp.o)
      _CreateFileA in libCoreClrPal.a(file.cpp.o)
      _CreateFileW in libCoreClrPal.a(file.cpp.o)
      _CopyFileW in libCoreClrPal.a(file.cpp.o)
      _CopyFileA in libCoreClrPal.a(file.cpp.o)
      _DeleteFileA in libCoreClrPal.a(file.cpp.o)
      ...
ld: symbol(s) not found for architecture x86_64

请问如何解决这个问题?

问题补充:

运行下面的命令:

sudo xcode-select --switch /Library/Developer/CommandLineTools
brew install libtool

错误变成:

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcee_wks.a(jithelpers_slow.S.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcee_wks.a(jithelpers_slow.S.o) has no symbols
dudu的主页 dudu | 高人七级 | 园豆:30939
提问于:2015-02-08 12:22
< >
分享
最佳答案
0

解决方法:在 src/pal/src/arch/i386/context.S 中,将 #if defined(_DEBUG) 改为 #if defined(__APPLE__) 

dudu | 高人七级 |园豆:30939 | 2015-02-09 00:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册