cross compiling using llvm 1.8

Hi Anton,

But if I’m ignoring this warning and continue according to the instructions (i.e. copy back the saved tblgen and perform build as usual), then I get a LOT of linkage errors regarding undefined symbols. For instance,

smWriterEmitter.cpp:(.text+0x21): undefined reference to _ZNSs6assignERKSs' AsmWriterEmitter.cpp:(.text+0x39): undefined reference to _ZNSs6assignERKSs’
/homes/aviv/projects/VMP_SDK_llvm1.8_gil/generated-llvm/obj/utils/TableGen/Debug/AsmWriterEmitter.o: In function _Z41__static_initialization_and_destruction_0ii': AsmWriterEmitter.cpp:(.text+0x70): undefined reference to _ZNSt8ios_base4InitC1Ev’
AsmWriterEmitter.cpp:(.text+0x78): undefined reference to __dso_handle' AsmWriterEmitter.cpp:(.text+0x8c): undefined reference to __cxa_atexit’
AsmWriterEmitter.cpp:(.text+0x94): undefined reference to _ZN4llvm19SupportIsInfLinkVarE' AsmWriterEmitter.cpp:(.text+0xa0): undefined reference to _ZN4llvm11IncludeFileC1EPv’
AsmWriterEmitter.cpp:(.text+0xa8): undefined reference to _ZN4llvm19SupportIsNANLinkVarE' AsmWriterEmitter.cpp:(.text+0xb4): undefined reference to _ZN4llvm11IncludeFileC1EPv’
/homes/aviv/projects/VMP_SDK_llvm1.8_gil/generated-llvm/obj/utils/TableGen/Debug/AsmWriterEmitter.o: In function _ZNSt4pairISsN138_GLOBAL__N__homes_aviv_projects_VMP_SDK_llvm1.8_gil_generated_llvm_obj_.._.._llvm1.8_utils_TableGen_AsmWriterEmitter.cpp_00000000_4112428B16AsmWriterOperandEEC1ERKS2_': AsmWriterEmitter.cpp:(.text+0x25e): undefined reference to _ZNSsC1ERKSs’
AsmWriterEmitter.cpp:(.text+0x273): undefined reference to _ZNSsC1ERKSs' AsmWriterEmitter.cpp:(.text+0x28b): undefined reference to _ZNSsC1ERKSs’
AsmWriterEmitter.cpp:(.text+0x2a5): undefined reference to _ZNSsD1Ev' AsmWriterEmitter.cpp:(.text+0x2ad): undefined reference to _Unwind_Resume’
AsmWriterEmitter.cpp:(.text+0x2b7): undefined reference to `_ZNSsD1Ev’

Can you tell what lead to it and how I can avoid it?

Hi,

AsmWriterEmitter.cpp:(.text+0x78): undefined reference to `__dso_handle'
AsmWriterEmitter.cpp:(.text+0x8c): undefined reference to `__cxa_atexit'

This is not connected with that warning. Something is wrong with your
compiler / linker. Either it does not provide needed libraries, or
broken in other way.

AsmWriterEmitter.cpp:(.text+0x25e): undefined reference to `_ZNSsC1ERKSs'

these came from libstdc++

AsmWriterEmitter.cpp:(.text+0x273): undefined reference to `_ZNSsC1ERKSs'
AsmWriterEmitter.cpp:(.text+0x28b): undefined reference to `_ZNSsC1ERKSs'
AsmWriterEmitter.cpp:(.text+0x2a5): undefined reference to `_ZNSsD1Ev'
AsmWriterEmitter.cpp:(.text+0x2ad): undefined reference to `_Unwind_Resume'

and this from libgcc

Hi,

I finally gave up building on Linux, in the meantime, and tried to build this version straight on Windows, using mingw32.

This is my command line:

(running from /c/llvm1.8/generated-llvm/obj)

…/…/llvm/configure --prefix=/c/llvm1.8/gene

rated-llvm/install/ --enable-debug-runtime --enable-jit

This is my path definition (it has several redundancies):

$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program Files/Common Files/Teleca Shared:/mingw:/c/downloads:/c/llvm1.8/generated-llvm/obj/Debug/bin:/c/llvm1.8-mingw32/bin:/c/llvm1.8-frontend/bin:/mingw/bin

And this is the error I get while running configure:

.

.

.

appending configuration tag CXX to mklib
appending configuration tag F77 to mklib
checking for llvm-gcc.exe… /c/llvm1.8-mingw32/bin/llvm-gcc.exe
checking for llvm-g++.exe… /c/llvm1.8-mingw32/bin/llvm-g++.exe
checking tool compatibility… configure: error: g++|icc required but not found

I searched the file system and couldn’t find a file called g++.exe - only gcc.exe (which is located under mingw/bin) and llvm-g++.exe (which is located under llvm1.8-frontend/bin).

What seems to be the problem and how can I solve it?

guy@MS-WXP-AVIV /c/llvm1.8/generated-llvm/obj

Anton Korobeynikov wrote:

Aviv Peretz wrote:

Hi,

I finally gave up building on Linux, in the meantime, and tried to build this version straight on Windows, using mingw32.

....

appending configuration tag CXX to mklib
appending configuration tag F77 to mklib
checking for llvm-gcc.exe... /c/llvm1.8-mingw32/bin/llvm-gcc.exe
checking for llvm-g++.exe... /c/llvm1.8-mingw32/bin/llvm-g++.exe
*checking tool compatibility... configure: error: g++|icc required but not found*

I searched the file system and couldn't find a file called g++.exe - only gcc.exe (which is located under mingw/bin) and llvm-g++.exe (which is located under llvm1.8-frontend/bin).

What seems to be the problem and how can I solve it?

You only have C (provided by gcc) installed. You need to unpack the C++ tarball (which provides g++) in the parent directory (the one above bin with gcc, include, and lib). The C++ tarball should be the same release number as the gcc already installed.

Kenneth

Thanks, it helped :slight_smile:

I’m now building the sources and apparently my mingw installation does not support pthread and therefore examples/ParallelJIT.cpp fails:

make[2]: Entering directory /c/llvm1.8/generated-llvm/obj/examples/ParallelJIT' llvm[2]: Compiling ParallelJIT.cpp for Debug build c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:20:21: pthread.h: No such file or directory c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:212: error: pthread_cond_t ’ does not name a type

…/…/llvm/configure --prefix=/c/llvm1.8/generated-llvm/install/ --enable-debug-runtime --enable-jit

Is there an elegant way to skip building the examples (e.g. via a specific flag of cofigure) or the only way to overcome this is to insert #if 0 in the actual code?

Kenneth Boyd wrote:

Aviv Peretz wrote:

Thanks, it helped :slight_smile:

I'm now building the sources and apparently my mingw installation does not support pthread and therefore examples/ParallelJIT.cpp fails:

I'm not exactly happy with the emulation libraries for pthread on MingW32 available either.

make[2]: Entering directory `/c/llvm1.8/generated-llvm/obj/examples/ParallelJIT'
llvm[2]: Compiling ParallelJIT.cpp for Debug build
c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:20:21: pthread.h: No such file or directory
c:/llvm1.8/llvm/examples/ParallelJIT/ParallelJIT.cpp:212: error: `pthread_cond_t ' does not name a type

../../llvm/configure --prefix=/c/llvm1.8/generated-llvm/install/ --enable-debug-runtime --enable-jit

Is there an elegant way to skip building the examples (e.g. via a specific flag of cofigure) or the only way to overcome this is to insert #if 0 in the actual code?

Well, you could see if the tools-only target exists in the Makefile (but I think building the examples is informative).

A sufficiently POSIX-y make will provide the -k option for "keep on going after errors". This should let you build all of the examples you can build.

Of course, you may want to capture everything to a logfile since it'll get huge. I use something like

make -k 2>&1 | tee Build.txt

Kenneth

Is there an elegant way to skip building the examples (e.g. via a specific
flag of cofigure) or the only way to overcome this is to insert #if 0 in the
actual code?

As far as I remember 1.8 did not build cleanly out-of-the-box on
mingw32. But afair, using pthreads port should work fine.