On Tue, Sep 27, 2016 at 6:53 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:> > > > On Sep 27, 2016, at 2:18 AM, Carsten Mattner <carstenmattner at gmail.com> > wrote: > > > >> On Mon, Sep 26, 2016 at 11:02 PM, Teresa Johnson <tejohnson at google.com> > wrote: > >> I'll either need to get a reproducer from you and/or try to repro it > myself. > > > > Assuming I run into this with BUILD_SHARED_LIBS=OFF, which seems > unlikely, > > what kind of reproducer data would you need from me? >Let me see if I can reproduce it first. Probably a zip of all the inputs to the link and the link command line. Another option would be to save the temp files, but it would require some work to find the one producing the error and I might need all the inputs anyway...> > > >> I usually don't check out and build lldb, so perhaps I will start with > that. > > > > I must say I'm surprised a ThinLTO build of all of LLVM svn isn't part of > > the periodic builders. > > > I have one, it just does include LLDB. >Great, I was going to ask how to get one set up. Is it an official build bot? And I assume you meant it just does "not" include LLDB? Working getting a shared build of LLDB right now... Teresa> Mehdi > > > >> As a workaround you could try -DBUILD_SHARED_LIBS=OFF. > > > > Thanks, will do, but probably not before Wednesday because it looks like > > this requires a full rebuild, if my interpretation of the cmake > warning/error > > is correct. >-- Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160927/8deae87e/attachment.html>
> On Sep 27, 2016, at 7:00 AM, Teresa Johnson <tejohnson at google.com> wrote: > > > > On Tue, Sep 27, 2016 at 6:53 AM, Mehdi Amini <mehdi.amini at apple.com <mailto:mehdi.amini at apple.com>> wrote: > > > > On Sep 27, 2016, at 2:18 AM, Carsten Mattner <carstenmattner at gmail.com <mailto:carstenmattner at gmail.com>> wrote: > > > >> On Mon, Sep 26, 2016 at 11:02 PM, Teresa Johnson <tejohnson at google.com <mailto:tejohnson at google.com>> wrote: > >> I'll either need to get a reproducer from you and/or try to repro it myself. > > > > Assuming I run into this with BUILD_SHARED_LIBS=OFF, which seems unlikely, > > what kind of reproducer data would you need from me? > > Let me see if I can reproduce it first. Probably a zip of all the inputs to the link and the link command line. Another option would be to save the temp files, but it would require some work to find the one producing the error and I might need all the inputs anyway... > > > > >> I usually don't check out and build lldb, so perhaps I will start with that. > > > > I must say I'm surprised a ThinLTO build of all of LLVM svn isn't part of > > the periodic builders. > > > I have one, it just does include LLDB. > > Great, I was going to ask how to get one set up. Is it an official build bot?It is not public if that’s what you're asking. We need Xcode 8 to build with ThinLTO, and the public Apple bots (Green Dragon) is running Xcode 7.> And I assume you meant it just does "not" include LLDB?Yes. — Mehdi> > Working getting a shared build of LLDB right now... > > Teresa > > > Mehdi > > > >> As a workaround you could try -DBUILD_SHARED_LIBS=OFF. > > > > Thanks, will do, but probably not before Wednesday because it looks like > > this requires a full rebuild, if my interpretation of the cmake warning/error > > is correct. > > > > -- > Teresa Johnson | Software Engineer | tejohnson at google.com <mailto:tejohnson at google.com> | 408-460-2413-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160927/86b94fe6/attachment-0001.html>
I can't reproduce the failure. I am building with a clang built Release from recent source as my stage-1 bootstrap compiler: clang version 4.0.0 (trunk 282322) (llvm/trunk 282341) I am configuring the stage-2 bootstrap compiler with the following command, which largely is copied from your earlier email with your cmake command (changes noted below): lto=Thin type=Release cflgs=-w INSTALL_PREFIX=$HOME/llvm/${build_dir_name}/clang-install BUILD_COMPILER=$HOME/llvm/llvm_10_release_build SRC=$HOME/llvm/llvm_head BINUTILS=$HOME/binutils/binutils env DYLD_LIBRARY_PATH=$BUILD_COMPILER/lib/ \ cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=${type} \ -DLLVM_BINUTILS_INCDIR=$BINUTILS/include \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ -DLLVM_TARGETS_TO_BUILD="X86" \ -DLLVM_ENABLE_BACKTRACES=OFF \ -DLLVM_BUILD_EXAMPLES=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_BUILD_TESTS=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_BUILD_DOCS=OFF \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_ENABLE_DOXYGEN=OFF \ -DLLVM_ENABLE_SPHINX=OFF \ -DLLDB_DISABLE_PYTHON=ON \ -DCLANG_PLUGIN_SUPPORT=OFF \ -DLLVM_ENABLE_LTO=${lto} \ -DCMAKE_C_COMPILER=$BUILD_COMPILER/bin/clang \ -DCMAKE_CXX_COMPILER=$BUILD_COMPILER/bin/clang++ \ -DCMAKE_AR=$BUILD_COMPILER/bin/llvm-ar \ -DCMAKE_RANLIB=$BUILD_COMPILER/bin/llvm-ranlib \ -DLLVM_PARALLEL_LINK_JOBS=1 \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_C_FLAGS=${cflgs} \ -DCMAKE_CXX_FLAGS=${cflgs} \ -DCMAKE_EXE_LINKER_FLAGS=${linkflgs} \ $SRC The changes from your config: 1) Used llvm-ar and llvm-nm from the build compiler. I noticed that you are specifying those as coming from the same directory used for CMAKE_INSTALL_PREFIX, which seems wrong - that is where the compiler built here will be installed. 2) Used my own binutils checkout as I don't have plugin-api.h installed in /usr/include 3) Set BUILD_SHARED_LIBS=ON (which I don't see in your earlier config, did you add that later?) 4) Set LLVM_PARALLEL_LINK_JOBS=1 (probably not needed) 5) Build with -w, to avoid occasional issues with warnings only emitted by clang (probably not needed) 6) Specified CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly (you might have had the right versions in your path?) I did an nm on the .so libraries to see where __morestack was referenced and its linkage. No surprise, it is coming from libLLVMRuntimeDyld.so, and I do see it as weak as expected: $ nm lib/libLLVMRuntimeDyld.so | grep morestack w __morestack Can you do the above nm on your lib/libLLVMRuntimeDyld.so and send me the output? Thanks, Teresa On Tue, Sep 27, 2016 at 7:00 AM, Teresa Johnson <tejohnson at google.com> wrote:> > > On Tue, Sep 27, 2016 at 6:53 AM, Mehdi Amini <mehdi.amini at apple.com> > wrote: > >> >> >> > On Sep 27, 2016, at 2:18 AM, Carsten Mattner <carstenmattner at gmail.com> >> wrote: >> > >> >> On Mon, Sep 26, 2016 at 11:02 PM, Teresa Johnson <tejohnson at google.com> >> wrote: >> >> I'll either need to get a reproducer from you and/or try to repro it >> myself. >> > >> > Assuming I run into this with BUILD_SHARED_LIBS=OFF, which seems >> unlikely, >> > what kind of reproducer data would you need from me? >> > > Let me see if I can reproduce it first. Probably a zip of all the inputs > to the link and the link command line. Another option would be to save the > temp files, but it would require some work to find the one producing the > error and I might need all the inputs anyway... > > >> > >> >> I usually don't check out and build lldb, so perhaps I will start with >> that. >> > >> > I must say I'm surprised a ThinLTO build of all of LLVM svn isn't part >> of >> > the periodic builders. >> >> >> I have one, it just does include LLDB. >> > > Great, I was going to ask how to get one set up. Is it an official build > bot? And I assume you meant it just does "not" include LLDB? > > Working getting a shared build of LLDB right now... > > Teresa > > >> Mehdi >> > >> >> As a workaround you could try -DBUILD_SHARED_LIBS=OFF. >> > >> > Thanks, will do, but probably not before Wednesday because it looks like >> > this requires a full rebuild, if my interpretation of the cmake >> warning/error >> > is correct. >> > > > > -- > Teresa Johnson | Software Engineer | tejohnson at google.com | > 408-460-2413 >-- Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160927/14946f5b/attachment.html>
On Tue, Sep 27, 2016 at 6:33 PM, Teresa Johnson <tejohnson at google.com> wrote:> > I can't reproduce the failure. I am building with a clang built > Release from recent source as my stage-1 bootstrap compiler: > clang version 4.0.0 (trunk 282322) (llvm/trunk 282341)The clang I use was built from the 3.9 release branch: clang version 3.9.1 (branches/release_39 281767) Is that too old for it to build itself with ThinLTO?> I am configuring the stage-2 bootstrap compiler with the following > command, which largely is copied from your earlier email with your > cmake command (changes noted below): > > lto=Thin > type=Release > cflgs=-w > INSTALL_PREFIX=$HOME/llvm/${build_dir_name}/clang-install > BUILD_COMPILER=$HOME/llvm/llvm_10_release_build > SRC=$HOME/llvm/llvm_head > BINUTILS=$HOME/binutils/binutils > env DYLD_LIBRARY_PATH=$BUILD_COMPILER/lib/ \ > cmake \ > -G Ninja \ > -DCMAKE_BUILD_TYPE=${type} \ > -DLLVM_BINUTILS_INCDIR=$BINUTILS/include \[...]> -DCMAKE_C_FLAGS=${cflgs} \ > -DCMAKE_CXX_FLAGS=${cflgs} \ > -DCMAKE_EXE_LINKER_FLAGS=${linkflgs} \ > $SRCIs BUILD_COMPILER/bin the result of a previous non-LTO build of trunk? If any of you have suggestions what to omit from the above flags, I'm open to suggestions. This is the culmination of trying to replicate the previous autoconf flags. It's not an exact mapping, but almost.> The changes from your config: > 1) Used llvm-ar and llvm-nm from the build compiler. I noticed that > you are specifying those as coming from the same directory used for > CMAKE_INSTALL_PREFIX, which seems wrong - that is where the compiler > built here will be installed.That's because I'm reusing the previous built 3.9_release (without LTO) and I move it away after the build before running ninja install to the same location after extending PATH with the locally moved tree of the previously installed PREFIX for llvm. Is that a problem?> 2) Used my own binutils checkout as I don't have plugin-api.h > installed in /usr/includeCurious, is your host binutils too old for that to exist in /usr/include?> 3) Set BUILD_SHARED_LIBS=ON (which I don't see in your earlier > config, did you add that later?)What I emailed earlier was the full set of flags passed to cmake, and I had just added SHARED_LIBS=OFF as suggested for the next rebuild. Should I use ON or OFF?> 4) Set LLVM_PARALLEL_LINK_JOBS=1 (probably not needed)I'll try this next time, just to see how much of a difference it makes when I run with with -j4.> 5) Build with -w, to avoid occasional issues with warnings only > emitted by clang (probably not needed) > 6) Specified CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly (you > might have had the right versions in your path?)I've exported CXX and CC to clang++ and clang, which happen to be the locally build 3.9 release branch versions (non-LTO variant).> I did an nm on the .so libraries to see where __morestack was > referenced and its linkage. No surprise, it is coming from > libLLVMRuntimeDyld.so, and I do see it as weak as expected: > > $ nm lib/libLLVMRuntimeDyld.so | grep morestack > w __morestack > > Can you do the above nm on your lib/libLLVMRuntimeDyld.so and send > me the output?In the unfinished build dir I only have lib/libLLVMRuntimedyld.a.
If you have recent host binutils (e.g, under /usr/bin), you can create a symlink to LLVMgold.so in /usr/lib/bfd-plugins dir. With that setup, the host ar/ranlib/nm can be used for thinLTO/LTO build without the need to set CMAKE_RANLIB etc. David On Tue, Sep 27, 2016 at 9:33 AM, Teresa Johnson via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I can't reproduce the failure. I am building with a clang built Release > from recent source as my stage-1 bootstrap compiler: > clang version 4.0.0 (trunk 282322) (llvm/trunk 282341) > > I am configuring the stage-2 bootstrap compiler with the following > command, which largely is copied from your earlier email with your cmake > command (changes noted below): > > lto=Thin > type=Release > cflgs=-w > INSTALL_PREFIX=$HOME/llvm/${build_dir_name}/clang-install > BUILD_COMPILER=$HOME/llvm/llvm_10_release_build > SRC=$HOME/llvm/llvm_head > BINUTILS=$HOME/binutils/binutils > env DYLD_LIBRARY_PATH=$BUILD_COMPILER/lib/ \ > cmake \ > -G Ninja \ > -DCMAKE_BUILD_TYPE=${type} \ > -DLLVM_BINUTILS_INCDIR=$BINUTILS/include \ > -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \ > -DLLVM_TARGETS_TO_BUILD="X86" \ > -DLLVM_ENABLE_BACKTRACES=OFF \ > -DLLVM_BUILD_EXAMPLES=OFF \ > -DLLVM_INCLUDE_EXAMPLES=OFF \ > -DLLVM_BUILD_TESTS=OFF \ > -DLLVM_INCLUDE_TESTS=OFF \ > -DLLVM_BUILD_DOCS=OFF \ > -DLLVM_INCLUDE_DOCS=OFF \ > -DLLVM_ENABLE_DOXYGEN=OFF \ > -DLLVM_ENABLE_SPHINX=OFF \ > -DLLDB_DISABLE_PYTHON=ON \ > -DCLANG_PLUGIN_SUPPORT=OFF \ > -DLLVM_ENABLE_LTO=${lto} \ > -DCMAKE_C_COMPILER=$BUILD_COMPILER/bin/clang \ > -DCMAKE_CXX_COMPILER=$BUILD_COMPILER/bin/clang++ \ > -DCMAKE_AR=$BUILD_COMPILER/bin/llvm-ar \ > -DCMAKE_RANLIB=$BUILD_COMPILER/bin/llvm-ranlib \ > -DLLVM_PARALLEL_LINK_JOBS=1 \ > -DBUILD_SHARED_LIBS=ON \ > -DCMAKE_C_FLAGS=${cflgs} \ > -DCMAKE_CXX_FLAGS=${cflgs} \ > -DCMAKE_EXE_LINKER_FLAGS=${linkflgs} \ > $SRC > > The changes from your config: > 1) Used llvm-ar and llvm-nm from the build compiler. I noticed that you > are specifying those as coming from the same directory used for > CMAKE_INSTALL_PREFIX, which seems wrong - that is where the compiler built > here will be installed. > 2) Used my own binutils checkout as I don't have plugin-api.h installed in > /usr/include > 3) Set BUILD_SHARED_LIBS=ON (which I don't see in your earlier config, did > you add that later?) > 4) Set LLVM_PARALLEL_LINK_JOBS=1 (probably not needed) > 5) Build with -w, to avoid occasional issues with warnings only emitted by > clang (probably not needed) > 6) Specified CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly (you might > have had the right versions in your path?) > > I did an nm on the .so libraries to see where __morestack was referenced > and its linkage. No surprise, it is coming from libLLVMRuntimeDyld.so, and > I do see it as weak as expected: > > $ nm lib/libLLVMRuntimeDyld.so | grep morestack > w __morestack > > Can you do the above nm on your lib/libLLVMRuntimeDyld.so and send me the > output? > > Thanks, > Teresa > > On Tue, Sep 27, 2016 at 7:00 AM, Teresa Johnson <tejohnson at google.com> > wrote: > >> >> >> On Tue, Sep 27, 2016 at 6:53 AM, Mehdi Amini <mehdi.amini at apple.com> >> wrote: >> >>> >>> >>> > On Sep 27, 2016, at 2:18 AM, Carsten Mattner <carstenmattner at gmail.com> >>> wrote: >>> > >>> >> On Mon, Sep 26, 2016 at 11:02 PM, Teresa Johnson < >>> tejohnson at google.com> wrote: >>> >> I'll either need to get a reproducer from you and/or try to repro it >>> myself. >>> > >>> > Assuming I run into this with BUILD_SHARED_LIBS=OFF, which seems >>> unlikely, >>> > what kind of reproducer data would you need from me? >>> >> >> Let me see if I can reproduce it first. Probably a zip of all the inputs >> to the link and the link command line. Another option would be to save the >> temp files, but it would require some work to find the one producing the >> error and I might need all the inputs anyway... >> >> >>> > >>> >> I usually don't check out and build lldb, so perhaps I will start >>> with that. >>> > >>> > I must say I'm surprised a ThinLTO build of all of LLVM svn isn't part >>> of >>> > the periodic builders. >>> >>> >>> I have one, it just does include LLDB. >>> >> >> Great, I was going to ask how to get one set up. Is it an official build >> bot? And I assume you meant it just does "not" include LLDB? >> >> Working getting a shared build of LLDB right now... >> >> Teresa >> >> >>> Mehdi >>> > >>> >> As a workaround you could try -DBUILD_SHARED_LIBS=OFF. >>> > >>> > Thanks, will do, but probably not before Wednesday because it looks >>> like >>> > this requires a full rebuild, if my interpretation of the cmake >>> warning/error >>> > is correct. >>> >> >> >> >> -- >> Teresa Johnson | Software Engineer | tejohnson at google.com | >> 408-460-2413 >> > > > > -- > Teresa Johnson | Software Engineer | tejohnson at google.com | > 408-460-2413 > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160927/95eb2c21/attachment.html>