无法在cygwin上构建llvm

时间:2013-09-17 16:53:59

标签: build cygwin llvm

我目前正在尝试通过Cygwin在Windows上构建llvm 3.3。

编译很顺利,但是在链接此错误时构建崩溃了:

llvm[2]: ======= Finished Linking Release+Asserts Executable llvm-mc (without symbols)
make[2]: Leaving directory `/cygdrive/c/Users/Jupotter/Code/llvm-3.3.src/build/tools/llvm-mc'
llvm[2]: Compiling ExecutionDriver.cpp for Release+Asserts build
/cygdrive/c/Users/Jupotter/Code/llvm-3.3.src/build/Release+Asserts/lib/libLLVMMCJIT.a(SectionMemoryManager.o):SectionMemoryManager.cpp:(.text+0x3b): référence indéfinie vers « __register_frame »
/cygdrive/c/Users/Jupotter/Code/llvm-3.3.src/build/Release+Asserts/lib/libLLVMMCJIT.a(SectionMemoryManager.o):SectionMemoryManager.cpp:(.text+0x3b): relocalisation tronquée pour concorder avec la taille: R_X86_64_PC32 vers le symbole indéfini __register_frame
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/c/Users/Jupotter/Code/llvm-3.3.src/build/Release+Asserts/lib/libLLVMMCJIT.a(SectionMemoryManager.o): mauvaise adresse de relocalisation 0x0 dans la section «.pdata»

英文:

undefined reference to "__register_frame
relocation truncated to concord with size: R_X*^_^$_PC32 to undefined symbol __register_frame
wrong relocation address in 0x0 in section ".pdata"

我用这些命令构建llvm:

$ mkdir build
$ cd build
$ ../configure LDFLAGS=-Wl,--stack,16777216 --disable-jit --enable-targets=host-only
$ make -j4

对于win64平台,LDFLAGS选项来自llvm getting started guide。我试过禁用jit,因为它似乎是libLLVMCJIT存在问题。

知道什么可能导致这个版本失败?

2 个答案:

答案 0 :(得分:0)

在Cygwin(x86_64)上编译llvm时遇到了同样的错误。但我可以在Cygwin(x86)上成功编译它。

答案 1 :(得分:0)

外部函数__register_framelibgcc或其他编译器库的一部分,但仅适用于x86。看来您已在32位模式下编译了一些代码或使用了32位库。