<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 20, 2016, at 5:49 AM, Carsten Mattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div style="font-family:courier new,monospace" class="gmail_default">Hi again, Teresa.<br class=""><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">Looks like I had forgotten to report back with success<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">when finally building 3.9.0 in ThinLTO linker mode<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">back in October. Sorry about that and thanks for<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">helping me out. I know how important it is to get<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">success reports as well, as a developer myself,<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">so sorry again :(.<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">While that worked back then, last weekend I tried to<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">build 3.9.1 using 3.9.0 as installed from Arch Linux<br class="">and ran into a familiar issue but in another module.<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">I was using the Arch Linux package because it worked<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">the last time and without something like a chroot,<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">I cannot build 3.9.1 with personal-3.9.0 and then<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">overwrite it with the new build because the ninja<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">scripts hard-code paths to CC and CXX which then<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">ends in an error.<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class=""></div>I tried twice, and before I try another build,<div style="font-family:courier new,monospace;display:inline" class="gmail_default"> </div>I wonder about this:<br class=""><div style="font-family:courier new,monospace" class="gmail_default"><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">- Should I avoid any and all CFLAGS, CXXFLAGS, CPPFLAGS,<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> LDFLAGS in favor of passing these exclusively as<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> cmake's -Dsomething_something=<FLAGS>? Linux distros<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> usually have an environment with CFLAGS etc. and use<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> that building packages and this didn't interfere in the<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> past in my builds, but I'm open to avoid this by unsetting<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> any such variables first.<br class=""><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">- Is there a configuration in the CI matrix that builds all<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> of LLVM with ThinLTO so that I can be reasonably sure<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> any error is most likely local to my environment or<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"> because of operator (silly me) faults?<br class=""><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">$ svn info<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">URL: <a href="http://llvm.org/svn/llvm-project/llvm/branches/release_39" class="">http://llvm.org/svn/llvm-project/llvm/branches/release_39</a><br class="">Relative URL: ^/llvm/branches/release_39<br class="">Repository Root: <a href="http://llvm.org/svn/llvm-project" class="">http://llvm.org/svn/llvm-project</a><br class="">Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8<br class="">Revision: 290054<br class="">Node Kind: directory<br class="">Schedule: normal<br class="">Last Changed Author: tstellar<br class="">Last Changed Rev: 288847<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class=""><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">I also pass these in LDFLAGS but they're not visible<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">in the error trace below:<br class=""></div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>What is your exact cmake invocation?</div><div>I don’t think cmake accept “LDFLAGS” directly, instead it is using “CMAKE_MODULE_LINKER_FLAGS”, “CMAKE_SHARED_LINKER_FLAGS”, and “CMAKE_EXE_LINKER_FLAGS”.</div><div><br class=""></div><div>Ideally these would be set automatically when building LLVM with -DLLVM_ENABLE_LTO=THIN.</div><div><br class=""></div><div><br class=""></div><div>Teresa, I think it would be valuable to update llvm/cmake/modules/HandleLLVMOptions.cmake and make sure 1) either LLD or GOLD is used, 2) add the relevant plugin flags if needed.</div><div><br class=""></div><div><br class=""></div><div>if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")<br class=""> append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS<br class=""> CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)<br class=""> # On darwin, enable the lto cache. This improves initial build time a little<br class=""> # since we re-link a lot of the same objects, and significantly improves<br class=""> # incremental build time.<br class=""> append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"<br class=""> CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)</div><div><br class=""></div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div style="font-family:courier new,monospace" class="gmail_default"> -Wl,-plugin-opt,-function-sections \<br class=""> -Wl,-plugin-opt,-data-sections \<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">Any idea why lldb-argdumper would fail to link reproducably?<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class=""></div><div style="font-family:courier new,monospace" class="gmail_default">$ ninja<br class=""><br class="">[...]<br class=""></div><div style="font-family:courier new,monospace" class="gmail_default"><br class="">[3480/3688] Linking CXX executable bin/lldb-argdumper<br class="">FAILED: bin/lldb-argdumper<br class="">: && /usr/bin/clang++ -O2 -pipe<br class="">-fstack-protector-strong<br class="">--param=ssp-buffer-size=4<br class="">-march=x86-64<br class="">-mtune=generic<br class="">-fPIC<br class="">-fvisibility-inlines-hidden<br class="">-Wall<br class="">-W<br class="">-Wno-unused-parameter<br class="">-Wwrite-strings<br class="">-Wcast-qual<br class="">-Wmissing-field-initializers<br class="">-pedantic<br class="">-Wno-long-long<br class="">-Wcovered-switch-default<br class="">-Wnon-virtual-dtor<br class="">-Wdelete-non-virtual-dtor<br class="">-Werror=date-time<br class="">-std=c++11<br class="">-fcolor-diagnostics<br class="">-ffunction-sections<br class="">-fdata-sections<br class="">-flto=thin<br class="">-Wno-deprecated-declarations<br class="">-Wno-unknown-pragmas<br class="">-Wno-strict-aliasing<br class="">-Wno-deprecated-register<br class="">-Wno-vla-extension<br class="">-O3<br class="">-DNDEBUG<br class="">-fuse-ld=gold<br class="">-flto=thin<br class="">-Wl,-allow-shlib-undefined<br class="">-Wl,-O3<br class="">-Wl,--gc-sections<br class="">tools/lldb/tools/argdumper/CMakeFiles/lldb-argdumper.dir/argdumper.cpp.o<br class="">-o bin/lldb-argdumper -lpthread lib/liblldb.so.3.9.1 -Wl,--start-group<br class="">lib/liblldbBase.a lib/liblldbBreakpoint.a lib/liblldbCommands.a<br class="">lib/liblldbDataFormatters.a lib/liblldbHost.a lib/liblldbCore.a<br class="">lib/liblldbExpression.a lib/liblldbInitialization.a<br class="">lib/liblldbInterpreter.a lib/liblldbSymbol.a lib/liblldbTarget.a<br class="">lib/liblldbUtility.a lib/liblldbPluginDisassemblerLLVM.a<br class="">lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a<br class="">lib/libLLVMDebugInfoPDB.a lib/libLLVMDebugInfoCodeView.a<br class="">lib/liblldbPluginSymbolFileSymtab.a<br class="">lib/liblldbPluginDynamicLoaderStatic.a<br class="">lib/liblldbPluginDynamicLoaderPosixDYLD.a<br class="">lib/liblldbPluginDynamicLoaderHexagonDYLD.a<br class="">lib/liblldbPluginDynamicLoaderWindowsDYLD.a<br class="">lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginGoLanguage.a<br class="">lib/liblldbPluginJavaLanguage.a lib/liblldbPluginObjCLanguage.a<br class="">lib/liblldbPluginObjCPlusPlusLanguage.a<br class="">lib/liblldbPluginObjectFileELF.a lib/liblldbPluginObjectFileJIT.a<br class="">lib/liblldbPluginSymbolVendorELF.a<br class="">lib/liblldbPluginObjectContainerBSDArchive.a<br class="">lib/liblldbPluginObjectContainerMachOArchive.a<br class="">lib/liblldbPluginProcessGDBRemote.a lib/liblldbPluginProcessUtility.a<br class="">lib/liblldbPluginPlatformAndroid.a lib/liblldbPluginPlatformGDB.a<br class="">lib/liblldbPluginPlatformFreeBSD.a lib/liblldbPluginPlatformKalimba.a<br class="">lib/liblldbPluginPlatformLinux.a lib/liblldbPluginPlatformNetBSD.a<br class="">lib/liblldbPluginPlatformPOSIX.a lib/liblldbPluginPlatformWindows.a<br class="">lib/liblldbPluginPlatformMacOSX.a<br class="">lib/liblldbPluginDynamicLoaderMacOSXDYLD.a<br class="">lib/liblldbPluginUnwindAssemblyInstEmulation.a<br class="">lib/liblldbPluginUnwindAssemblyX86.a<br class="">lib/liblldbPluginAppleObjCRuntime.a<br class="">lib/liblldbPluginRenderScriptRuntime.a<br class="">lib/liblldbPluginLanguageRuntimeGo.a<br class="">lib/liblldbPluginLanguageRuntimeJava.a<br class="">lib/liblldbPluginCXXItaniumABI.a lib/liblldbPluginABIMacOSX_arm.a<br class="">lib/liblldbPluginABIMacOSX_arm64.a lib/liblldbPluginABIMacOSX_i386.a<br class="">lib/liblldbPluginABISysV_arm.a lib/liblldbPluginABISysV_arm64.a<br class="">lib/liblldbPluginABISysV_i386.a lib/liblldbPluginABISysV_x86_64.a<br class="">lib/liblldbPluginABISysV_hexagon.a lib/liblldbPluginABISysV_ppc.a<br class="">lib/liblldbPluginABISysV_ppc64.a lib/liblldbPluginABISysV_mips.a<br class="">lib/liblldbPluginABISysV_mips64.a lib/liblldbPluginABISysV_s390x.a<br class="">lib/liblldbPluginInstructionARM.a lib/liblldbPluginInstructionARM64.a<br class="">lib/liblldbPluginInstructionMIPS.a<br class="">lib/liblldbPluginInstructionMIPS64.a<br class="">lib/liblldbPluginObjectFilePECOFF.a lib/liblldbPluginOSGo.a<br class="">lib/liblldbPluginOSPython.a lib/liblldbPluginMemoryHistoryASan.a<br class="">lib/liblldbPluginInstrumentationRuntimeAddressSanitizer.a<br class="">lib/liblldbPluginInstrumentationRuntimeThreadSanitizer.a<br class="">lib/liblldbPluginSystemRuntimeMacOSX.a<br class="">lib/liblldbPluginProcessElfCore.a lib/liblldbPluginJITLoaderGDB.a<br class="">lib/liblldbPluginExpressionParserClang.a<br class="">lib/liblldbPluginExpressionParserGo.a lib/liblldbPluginProcessLinux.a<br class="">lib/liblldbPluginProcessPOSIX.a -Wl,--end-group lib/libclangCodeGen.a<br class="">lib/libLLVMBitWriter.a lib/libLLVMCoverage.a lib/libLLVMipo.a<br class="">lib/libLLVMVectorize.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a<br class="">lib/libLLVMInstrumentation.a lib/libLLVMLinker.a<br class="">lib/libLLVMObjCARCOpts.a lib/libLLVMObject.a lib/libLLVMScalarOpts.a<br class="">lib/libLLVMInstCombine.a lib/libLLVMTarget.a<br class="">lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a<br class="">lib/libclangRewriteFrontend.a lib/libclangFrontend.a<br class="">lib/libclangDriver.a lib/libclangParse.a lib/libLLVMMCParser.a<br class="">lib/libLLVMProfileData.a lib/libLLVMOption.a lib/libclangRewrite.a<br class="">lib/libclangSerialization.a lib/libclangSema.a lib/libclangAnalysis.a<br class="">lib/libclangEdit.a lib/libclangAST.a lib/libclangLex.a<br class="">lib/libclangBasic.a lib/libLLVMMC.a lib/libLLVMBitReader.a<br class="">lib/libLLVMCore.a lib/libLLVMSupport.a -lrt -ldl -lcurses -lpthread<br class="">-lz -lm -Wl,-rpath,"\$ORIGIN/../lib" && :<br class=""><br class="">/usr/bin/ld.gold: bin/lldb-argdumper: hidden symbol `__morestack' in<br class="">/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.2.1/libgcc.a(morestack.o)<br class="">is referenced by DSO<br class=""><br class="">/usr/bin/ld.gold: final link failed: Bad value<br class=""><br class="">clang-3.9: error: linker command failed with exit code 1 (use -v to<br class="">see invocation)<br class=""><br class="">ninja: build stopped: subcommand failed.<br class=""></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>