<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 27, 2016 at 2:00 PM, Carsten Mattner <span dir="ltr"><<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Sep 27, 2016 at 8:37 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com">tejohnson@google.com</a>> wrote:<br>
<br>
Just in case it's important, I'm using Arch Linux (and most Linux<br>
distros these days) CFLAGS/CPPFLAGS/LDFLAGS, which are as follows:<br>
<br>
$ grep FLAGS /etc/makepkg.conf<br>
CPPFLAGS="-D_FORTIFY_SOURCE=2"<br>
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong"<br>
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong"<br>
LDFLAGS="-Wl,-O1,--sort-<wbr>common,--as-needed,-z,relro"<br>
<br>
This is the same way Fedora or Arch linux would build clang, or any<br>
other usual package for that matter.<br></blockquote><div><br></div><div>Ok, thanks will also try adding these.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The only uncommon thing I set is the macro -D_GLIBCXX_USE_CXX11_ABI=0,<br>
which I use to avoid C++11 ABI chaos since g++5.x, although it's<br>
probably safe to drop by now, especially when CXX=clang++. That's<br>
g++-specific, so is irrelevant to the issue at hand.<br>
<span class="gmail-"><br>
> I wonder if there is a bug that was fixed. I have bootstrapped with<br>
> ThinLTO with the 3.9 compiler, but not with LLDB and not with<br>
> SHARED_LIBS=ON. I can try with an older 3.9 version.<br>
<br>
</span>As you seem to have faster hardware, I would appreciate a validation<br>
before I embark on another >=3h build endavour.<br></blockquote><div><br></div><div>Sure, I will try this and let you know. Unfortunately, though, I have another big work commitment</div><div>that is going to eat up most of my time through Thu, although I may be able to find some time to </div><div>try it.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> Not sure I followed that, but in essence you just want to make sure that<br>
> llvm-ranlib and llvm-ar match the build compiler.<br>
<br>
</span>Sorry for the confusing description.<br>
<br>
I build llvm and install it locally in my home dir somewhere<br>
($PREFIX). After building llvm, I move that installation out of the<br>
way before installing the new build in a now empty $PREFIX, but not<br>
before prepending the moved-to PREFIX in $PATH, in case I need the old<br>
toolchain during 'ninja install'.<br>
<br>
Make more sense?<br></blockquote><div><br></div><div>I think so - what is confusing me is that your cmake command is specifying the same $PREFIX</div><div>for both the install destination and the source of the llvm-ar/llvm-ranlib that will be used in the new</div><div>build. Should the llvm-ar/llvm-ranlib in the cmake command use your moved-to PREFIX instead? </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> I used ON to try to reproduce your issue, the OFF was a suggestion<br>
> to avoid it as a workaround. I'm surprised your build defaults this<br>
> to ON, according to <a href="http://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank">http://llvm.org/docs/CMake.<wbr>html</a> it defaults to<br>
> OFF.<br>
<br>
</span>Hmm, I will explicitly set it to OFF in the next build.<br>
<br>
Is it expected for the .so files listed below to be created with<br>
SHARED_LIB=OFF?<br></blockquote><div><br></div><div>I do get a few .so with my default SHARED_LIB=OFF build, although I am not building</div><div>some of those (e.g. the omp and polly libs). Maybe the error is actually coming from one</div><div>of those, not libLLVMRUntimedyld.so. Although the only .so I see in your link below is</div><div>lib/liblldb.so.3.9.1. Mine (lib/liblldb.so.4.0.0) doesn't reference morestack.<br></div><div><br></div><div>Can you nm the .so files in your lib dir and see if any reference __morestack?</div><div><br></div><div>Although it would be strange if they aren't referenced in the failing link.</div><div><br></div><div>Thanks,</div><div>Teresa</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> This is from your SHARED_LIBS=OFF build I assume? With the build<br>
> containing the DSO error I'm assuming BUILD_SHARED_LIBS=ON, which<br>
> would mean this should be a .so.<br>
<br>
</span>One would expect so, but in fact it's with the flags I posted<br>
yesterday, so I'm equally confused as to why there's no .so, but the<br>
error<br>
<br>
These are the DSO file in lib/:<br>
<br>
$ ls lib/*.so<br>
lib/BugpointPasses.so<br>
lib/libclang.so<br>
lib/libgomp.so<br>
lib/libiomp5.so<br>
lib/liblldb.so<br>
lib/libLTO.so<br>
lib/libomp.so<br>
lib/LLVMgold.so<br>
lib/LLVMHello.so<br>
lib/LLVMPolly.so<br>
<br>
I'll assume, given the existence of the various .so files, that<br>
SHARED_LIBS=ON is the default and what's been configured.<br>
<br>
Unless cmake's configure step somehow is responsible for nuking<br>
libLLVMRUntimedyld.so, I don't know if it's supposed to exist yet in<br>
the build plan (failed) so far.<br>
<span class="gmail-"><br>
> If this archive is from the build getting the DSO error then I'm<br>
> confused about which DSO is giving the error. In that case what does<br>
> the link line look like?<br>
<br>
</span>For easier reading, I've newlined the parameters.<br>
<br>
[1/90] Linking CXX executable bin/lldb-3.9.1<br>
FAILED: bin/lldb-3.9.1<br>
: && $PREFIX/bin/clang++<br>
-D_GLIBCXX_USE_CXX11_ABI=0<br>
-O2<br>
-pipe<br>
-fstack-protector-strong<br>
--param=ssp-buffer-size=4<br>
-march=x86-64<br>
-mtune=generic<br>
-fPIC<br>
-fvisibility-inlines-hidden<br>
-Wall<br>
-W<br>
-Wno-unused-parameter<br>
-Wwrite-strings<br>
-Wcast-qual<br>
-Wmissing-field-initializers<br>
-pedantic<br>
-Wno-long-long<br>
-Wcovered-switch-default<br>
-Wnon-virtual-dtor<br>
-Wdelete-non-virtual-dtor<br>
-Werror=date-time<br>
-std=c++11<br>
-fcolor-diagnostics<br>
-ffunction-sections<br>
-fdata-sections<br>
-flto=thin<br>
-Wno-deprecated-declarations<br>
-Wno-unknown-pragmas<br>
-Wno-strict-aliasing<br>
-Wno-deprecated-register<br>
-Wno-vla-extension<br>
-O3<br>
-DNDEBUG<br>
-Wl,-O1,--sort-common,--as-<wbr>needed,-z,relro,--hash-style=<wbr>gnu<br>
-flto=thin<br>
-Wl,-allow-shlib-undefined<br>
-Wl,-O3<br>
-Wl,--gc-sections \<br>
 tools/lldb/tools/driver/<wbr>CMakeFiles/lldb.dir/Driver.<wbr>cpp.o \<br>
 tools/lldb/tools/driver/<wbr>CMakeFiles/lldb.dir/Platform.<wbr>cpp.o<br>
-o bin/lldb-3.9.1<br>
-lpthread<br>
lib/liblldb.so.3.9.1<br>
-Wl,--start-group<br>
lib/liblldbBase.a<br>
lib/liblldbBreakpoint.a<br>
lib/liblldbCommands.a<br>
lib/liblldbDataFormatters.a<br>
lib/liblldbHost.a<br>
lib/liblldbCore.a<br>
lib/liblldbExpression.a<br>
lib/liblldbInitialization.a<br>
lib/liblldbInterpreter.a<br>
lib/liblldbSymbol.a<br>
lib/liblldbTarget.a<br>
lib/liblldbUtility.a<br>
lib/<wbr>liblldbPluginDisassemblerLLVM.<wbr>a<br>
lib/<wbr>liblldbPluginSymbolFileDWARF.a<br>
lib/<wbr>liblldbPluginSymbolFilePDB.a<br>
lib/libLLVMDebugInfoPDB.a<br>
lib/libLLVMDebugInfoCodeView.a<br>
lib/<wbr>liblldbPluginSymbolFileSymtab.<wbr>a<br>
lib/<wbr>liblldbPluginDynamicLoaderStat<wbr>ic.a<br>
lib/<wbr>liblldbPluginDynamicLoaderPosi<wbr>xDYLD.a<br>
lib/<wbr>liblldbPluginDynamicLoaderHexa<wbr>gonDYLD.a<br>
lib/<wbr>liblldbPluginDynamicLoaderWind<wbr>owsDYLD.a<br>
lib/<wbr>liblldbPluginCPlusPlusLanguage<wbr>.a<br>
lib/liblldbPluginGoLanguage.a<br>
lib/liblldbPluginJavaLanguage.<wbr>a<br>
lib/liblldbPluginObjCLanguage.<wbr>a<br>
lib/<wbr>liblldbPluginObjCPlusPlusLangu<wbr>age.a<br>
lib/<wbr>liblldbPluginObjectFileELF.a<br>
lib/<wbr>liblldbPluginObjectFileJIT.a<br>
lib/<wbr>liblldbPluginSymbolVendorELF.a<br>
lib/<wbr>liblldbPluginObjectContainerBS<wbr>DArchive.a<br>
lib/<wbr>liblldbPluginObjectContainerMa<wbr>chOArchive.a<br>
lib/<wbr>liblldbPluginProcessGDBRemote.<wbr>a<br>
lib/<wbr>liblldbPluginProcessUtility.a<br>
lib/<wbr>liblldbPluginPlatformAndroid.a<br>
lib/liblldbPluginPlatformGDB.a<br>
lib/<wbr>liblldbPluginPlatformFreeBSD.a<br>
lib/<wbr>liblldbPluginPlatformKalimba.a<br>
lib/<wbr>liblldbPluginPlatformLinux.a<br>
lib/<wbr>liblldbPluginPlatformNetBSD.a<br>
lib/<wbr>liblldbPluginPlatformPOSIX.a<br>
lib/<wbr>liblldbPluginPlatformWindows.a<br>
lib/<wbr>liblldbPluginPlatformMacOSX.a<br>
lib/<wbr>liblldbPluginDynamicLoaderMacO<wbr>SXDYLD.a<br>
lib/<wbr>liblldbPluginUnwindAssemblyIns<wbr>tEmulation.a<br>
lib/<wbr>liblldbPluginUnwindAssemblyX86<wbr>.a<br>
lib/<wbr>liblldbPluginAppleObjCRuntime.<wbr>a<br>
lib/<wbr>liblldbPluginRenderScriptRunti<wbr>me.a<br>
lib/<wbr>liblldbPluginLanguageRuntimeGo<wbr>.a<br>
lib/<wbr>liblldbPluginLanguageRuntimeJa<wbr>va.a<br>
lib/<wbr>liblldbPluginCXXItaniumABI.a<br>
lib/liblldbPluginABIMacOSX_<wbr>arm.a<br>
lib/liblldbPluginABIMacOSX_<wbr>arm64.a<br>
lib/liblldbPluginABIMacOSX_<wbr>i386.a<br>
lib/liblldbPluginABISysV_arm.a<br>
lib/liblldbPluginABISysV_<wbr>arm64.a<br>
lib/liblldbPluginABISysV_i386.<wbr>a<br>
lib/liblldbPluginABISysV_x86_<wbr>64.a<br>
lib/liblldbPluginABISysV_<wbr>hexagon.a<br>
lib/liblldbPluginABISysV_ppc.a<br>
lib/liblldbPluginABISysV_<wbr>ppc64.a<br>
lib/liblldbPluginABISysV_mips.<wbr>a<br>
lib/liblldbPluginABISysV_<wbr>mips64.a<br>
lib/liblldbPluginABISysV_<wbr>s390x.a<br>
lib/<wbr>liblldbPluginInstructionARM.a<br>
lib/<wbr>liblldbPluginInstructionARM64.<wbr>a<br>
lib/<wbr>liblldbPluginInstructionMIPS.a<br>
lib/<wbr>liblldbPluginInstructionMIPS64<wbr>.a<br>
lib/<wbr>liblldbPluginObjectFilePECOFF.<wbr>a<br>
lib/liblldbPluginOSGo.a<br>
lib/liblldbPluginOSPython.a<br>
lib/<wbr>liblldbPluginMemoryHistoryASan<wbr>.a<br>
lib/<wbr>liblldbPluginInstrumentationRu<wbr>ntimeAddressSanitizer.a<br>
lib/<wbr>liblldbPluginInstrumentationRu<wbr>ntimeThreadSanitizer.a<br>
lib/<wbr>liblldbPluginSystemRuntimeMacO<wbr>SX.a<br>
lib/<wbr>liblldbPluginProcessElfCore.a<br>
lib/liblldbPluginJITLoaderGDB.<wbr>a<br>
lib/<wbr>liblldbPluginExpressionParserC<wbr>lang.a<br>
lib/<wbr>liblldbPluginExpressionParserG<wbr>o.a<br>
lib/liblldbPluginProcessLinux.<wbr>a<br>
lib/liblldbPluginProcessPOSIX.<wbr>a<br>
-Wl,--end-group<br>
lib/libclangCodeGen.a<br>
lib/libLLVMBitWriter.a<br>
lib/libLLVMCoverage.a<br>
lib/libLLVMipo.a<br>
lib/libLLVMVectorize.a<br>
lib/libLLVMIRReader.a<br>
lib/libLLVMAsmParser.a<br>
lib/libLLVMInstrumentation.a<br>
lib/libLLVMLinker.a<br>
lib/libLLVMObjCARCOpts.a<br>
lib/libLLVMObject.a<br>
lib/libLLVMScalarOpts.a<br>
lib/libLLVMInstCombine.a<br>
lib/libLLVMTarget.a<br>
lib/libLLVMTransformUtils.a<br>
lib/libLLVMAnalysis.a<br>
lib/libclangRewriteFrontend.a<br>
lib/libclangFrontend.a<br>
lib/libclangDriver.a<br>
lib/libclangParse.a<br>
lib/libLLVMMCParser.a<br>
lib/libLLVMProfileData.a<br>
lib/libLLVMOption.a<br>
lib/libclangRewrite.a<br>
lib/libclangSerialization.a<br>
lib/libclangSema.a<br>
lib/libclangAnalysis.a<br>
lib/libclangEdit.a<br>
lib/libclangAST.a<br>
lib/libclangLex.a<br>
lib/libclangBasic.a<br>
lib/libLLVMMC.a<br>
lib/libLLVMBitReader.a<br>
lib/libLLVMCore.a<br>
lib/libLLVMSupport.a<br>
-lrt<br>
-ldl<br>
-lcurses<br>
-lpthread<br>
-lz<br>
-lm<br>
-Wl,-rpath,"\$ORIGIN/../lib<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td><td nowrap style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td nowrap style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top:2px solid rgb(238,178,17)"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>