Interesting, I didn't know that about CMake. We don't support thinLTO yet, but we might want to update our CMake file or accept/ignore/use-real-lto for -flto=thin in the emscripten driver for compatibility.
On Fri, Aug 4, 2017 at 11:40 AM Dirk Vanden Boer <[email protected]> wrote: > The thin option seems to be the problem indeed. Recent cmake (3.9) assumes > -flto=thin is supported for clang >= 3.9. (thin lto has much faster linking > times then lto). After modifying the cmake detection to use the regular > -flto flag in the case of emscripten things build again. > > > On Friday, August 4, 2017 at 7:27:07 PM UTC+2, Alon Zakai wrote: > >> To use LTO, you can pass emcc the --llvm-lto flag (with value 1 above, >> see emcc --help). >> >> Looks like that CMake flag turns on -flto=thin which I don't know much >> about. It may require a special build of LLVM, one that includes the pass >> it is complaining about. >> > >> On Fri, Aug 4, 2017 at 2:03 AM, Dirk Vanden Boer <[email protected]> >> wrote: >> >>> If I enable lto using >>> cmake: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON >>> >>> Emscripten fails with the following error, is lto supported? >>> >>> [1/17] Building CXX object util/CMakeFiles/gdxutil.dir/colormap.cpp.o >>> FAILED: util/CMakeFiles/gdxutil.dir/colormap.cpp.o >>> /Users/dirk/Projects/emsdk/emscripten/incoming/em++ >>> -DSPDLOG_FMT_EXTERNAL -I../../util -I../../util/include -I. -isystem >>> ../local-toolchain-wasm/include -isystem >>> ../local-toolchain-wasm/include/eigen3 -Wall -Wextra -Wpedantic >>> -Wfatal-errors -Wno-unknown-pragmas -fdiagnostics-color -stdlib=libc++ >>> -DNDEBUG -O2 -flto=thin -fPIC -fvisibility=hidden -std=c++1z -MD -MT >>> util/CMakeFiles/gdxutil.dir/colormap.cpp.o -MF >>> util/CMakeFiles/gdxutil.dir/colormap.cpp.o.d -o >>> util/CMakeFiles/gdxutil.dir/colormap.cpp.o -c ../../util/colormap.cpp >>> Pass 'Module Summary Analysis' is not initialized. >>> Verify if there is a pass dependency cycle. >>> Required Passes: >>> Error: Required pass not found! Possible causes: >>> - Pass misconfiguration (e.g.: missing macros) >>> - Corruption of the global PassRegistry >>> Assertion failed: (PI && "Expected required passes to be initialized"), >>> function schedulePass, file >>> /Users/dirk/Projects/emsdk/clang/fastcomp/src/lib/IR/LegacyPassManager.cpp, >>> line 647. >>> 0 clang-4.0 0x0000000104822ae8 >>> llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 >>> 1 clang-4.0 0x0000000104821ca6 >>> llvm::sys::RunSignalHandlers() + 86 >>> 2 clang-4.0 0x0000000104823139 SignalHandler(int) + 361 >>> 3 libsystem_platform.dylib 0x00007fffcdfc2b3a _sigtramp + 26 >>> 4 libsystem_malloc.dylib 0x00007fffcdf3691f >>> tiny_malloc_from_free_list + 431 >>> 5 libsystem_c.dylib 0x00007fffcde47420 abort + 129 >>> 6 libsystem_c.dylib 0x00007fffcde0e893 basename_r + 0 >>> 7 clang-4.0 0x0000000104335e02 >>> llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 2082 >>> 8 clang-4.0 0x0000000104335718 >>> llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 312 >>> 9 clang-4.0 0x0000000104a0a5bf >>> clang::EmitBackendOutput(clang::DiagnosticsEngine&, >>> clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, >>> clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout >>> const&, llvm::Module*, clang::BackendAction, >>> std::__1::unique_ptr<llvm::raw_pwrite_stream, >>> std::__1::default_delete<llvm::raw_pwrite_stream> >) + 11503 >>> 10 clang-4.0 0x0000000104bebe70 >>> clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1056 >>> 11 clang-4.0 0x00000001054d53c2 >>> clang::ParseAST(clang::Sema&, bool, bool) + 466 >>> 12 clang-4.0 0x0000000104e2365c >>> clang::FrontendAction::Execute() + 76 >>> 13 clang-4.0 0x0000000104de4bb1 >>> clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1201 >>> 14 clang-4.0 0x0000000104e7a481 >>> clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4865 >>> 15 clang-4.0 0x0000000103bb93b3 >>> cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1235 >>> 16 clang-4.0 0x0000000103bb7a49 main + 10297 >>> 17 libdyld.dylib 0x00007fffcddb3235 start + 1 >>> 18 libdyld.dylib 0x0000000000000062 start + 841272878 >>> Stack dump: >>> 0. Program arguments: >>> /Users/dirk/Projects/emsdk/clang/fastcomp/build_incoming_64/bin/clang-4.0 >>> -cc1 -triple asmjs-unknown-emscripten -emit-llvm-bc -flto=thin >>> -disable-free -main-file-name colormap.cpp -mrelocation-model pic >>> -pic-level 2 -mthread-model posix -mdisable-fp-elim -no-integrated-as >>> -mconstructor-aliases -target-linker-version 278.4 -dwarf-column-info >>> -debugger-tuning=gdb -coverage-notes-file >>> /Users/dirk/Projects/gdx-core/build/gdx-wasm/util/CMakeFiles/gdxutil.dir/colormap.cpp.gcno >>> -nostdsysteminc -nobuiltininc -resource-dir >>> /Users/dirk/Projects/emsdk/clang/fastcomp/build_incoming_64/bin/../lib/clang/4.0.0 >>> -dependency-file util/CMakeFiles/gdxutil.dir/colormap.cpp.o.d >>> -sys-header-deps -MT util/CMakeFiles/gdxutil.dir/colormap.cpp.o -isystem >>> ../local-toolchain-wasm/include -isystem >>> ../local-toolchain-wasm/include/eigen3 -D __EMSCRIPTEN_major__=1 -D >>> __EMSCRIPTEN_minor__=37 -D __EMSCRIPTEN_tiny__=16 -D _LIBCPP_ABI_VERSION=2 >>> -D SPDLOG_FMT_EXTERNAL -I ../../util -I ../../util/include -I . -D NDEBUG >>> -stdlib=libc++ -O2 -Werror=implicit-function-declaration -Wall -Wextra >>> -Wpedantic -Wfatal-errors -Wno-unknown-pragmas -std=c++1z >>> -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir >>> /Users/dirk/Projects/gdx-core/build/gdx-wasm -ferror-limit 19 >>> -fmessage-length 0 -fvisibility hidden -fobjc-runtime=gnustep >>> -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics >>> -vectorize-loops -vectorize-slp -nobuiltininc -nostdsysteminc >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include/libcxx >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/lib/libcxxabi/include >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include/compat >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include/SSE >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include/libc >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/lib/libc/musl/arch/emscripten >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/local/include >>> -isystem/Users/dirk/Projects/emsdk/emscripten/incoming/system/include/SDL >>> -disable-llvm-optzns -o util/CMakeFiles/gdxutil.dir/colormap.cpp.o -x c++ >>> ../../util/colormap.cpp >>> 1. <eof> parser at end of file >>> clang-4.0: fatal error: unable to execute command: Abort trap: 6 >>> clang version 4.0.0 ( >>> https://github.com/kripken/emscripten-fastcomp-clang.git >>> feff46c2a99f012dfdd291f02636fd386d132969) ( >>> https://github.com/kripken/emscripten-fastcomp.git >>> d11ecd94546630d1e087de93ac95eccb2630b5e3) (emscripten 1.37.16 : 1.37.16) >>> Target: asmjs-unknown-emscripten >>> Thread model: posix >>> InstalledDir: >>> /Users/dirk/Projects/emsdk/clang/fastcomp/build_incoming_64/bin >>> ERROR:root:compiler frontend failed to generate LLVM bitcode, halting >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
