Issue compiling third party libraries for HTML5

Rael55
Mon, 11 Jun 2018 14:59:00 +0000
Platform & Builds

I’m trying to compile Assimp as a LLVM bitcode library for my HTML5 project. However, when compiling, I get these errors:

2>EXEC : warning : Linking two modules of different data layouts: 'K:/Unreal Projects/ArtGallery/ThirdParty/Assimp/bin/assimp.bc' is 'e-m:w-i64:64-f80:128-n8:16:32:64-S128' whereas 'K:/Unreal Projects/ArtGallery/Intermediate/Build/HTML5/ArtGallery/Development/Launch/Module.Launch.cpp.bc' is 'e-p:32:32-i64:64-v128:32:128-n32-S128'
2>
2>     1>
2>EXEC : warning : Linking two modules of different target triples: K:/Unreal Projects/ArtGallery/ThirdParty/Assimp/bin/assimp.bc' is 'x86_64-pc-windows-msvc19.0.24215' whereas 'K:/Unreal Projects/ArtGallery/Intermediate/Build/HTML5/ArtGallery/Development/Launch/Module.Launch.cpp.bc' is 'asmjs-unknown-emscripten'
2>
2>         Not handled: i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor30* @"\01??_R0?AUFIStringValueImpl@Assimp@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64))
2>     1>
2>EXEC : LLVM error : FlattenGlobals: ConstantExpr opcode not handled: sub

I used clang++ and llvm-link that were included in the emscripten folder under the engine directory, so I thought I was doing things correctly. I used clang++ to compile my cpp’s (with options -c -O and -emit-llvm, would that be an issue?) and then simply used llvm-link with all the .bc’s generated to combine into one .bc (didn’t use options here other than -o to specify filename). Should I be using emcc or something to do this, or what should I be doing to correct this issue?

3 posts - 1 participant