Message ID | 1542426982-54683-2-git-send-email-matthew.weber@rockwellcollins.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/6] package/compiler-rt: new package | expand |
Hi Matt, Le 17/11/2018 à 04:56, Matt Weber a écrit : > The compiler-rt fuzzer and address sanitizer tools require additional > LLVM binary tools installed to allow stack trace decoding actively during > executable analysis. > > https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > Reviewed-by: Romain Naour <romain.naour@smile.fr> For some reason I get an error while building llvm package tools. x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: '-I/usr/include/libxml2' Can you have a look? Best regards, Romain > --- > Changes > v1 -> v2 > - None > --- > package/llvm/llvm.mk | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk > index 1f9bd44..79477f0 100644 > --- a/package/llvm/llvm.mk > +++ b/package/llvm/llvm.mk > @@ -197,8 +197,17 @@ HOST_LLVM_CONF_OPTS += \ > # We need to activate LLVM_INCLUDE_TOOLS, otherwise it does not generate > # libLLVM.so > LLVM_CONF_OPTS += \ > - -DLLVM_INCLUDE_TOOLS=ON \ > + -DLLVM_INCLUDE_TOOLS=ON > + > +# The llvm-symbolizer binary is used by the Compiler-RT Fuzzer > +# and AddressSanitizer tools for stack traces. > +ifeq ($(BR2_PACKAGE_COMPILER_RT),y) > +LLVM_CONF_OPTS += \ > + -DLLVM_BUILD_TOOLS=ON > +else > +LLVM_CONF_OPTS += \ > -DLLVM_BUILD_TOOLS=OFF > +endif > > # Compiler-rt not in the source tree. > # llvm runtime libraries are not in the source tree. >
Romain, On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: > > Hi Matt, > > Le 17/11/2018 à 04:56, Matt Weber a écrit : > > The compiler-rt fuzzer and address sanitizer tools require additional > > LLVM binary tools installed to allow stack trace decoding actively during > > executable analysis. > > > > https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > > > > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > > Reviewed-by: Romain Naour <romain.naour@smile.fr> > > For some reason I get an error while building llvm package tools. > > x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: > '-I/usr/include/libxml2' > > Can you have a look? I went back and checked my logs on the clang compiler-rt run-test build for that warning and didn't find it. I then checked and my config and it has the unsafe header/library as error. Was your build test just applying my patches and doing an explicit 'make llvm'? Thanks Matt
Hi Matt, Le lun. 19 nov. 2018 à 02:48, Matthew Weber < matthew.weber@rockwellcollins.com> a écrit : > Romain, > > On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> > wrote: > > > > Hi Matt, > > > > Le 17/11/2018 à 04:56, Matt Weber a écrit : > > > The compiler-rt fuzzer and address sanitizer tools require additional > > > LLVM binary tools installed to allow stack trace decoding actively > during > > > executable analysis. > > > > > > https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > > > > > > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > > > Reviewed-by: Romain Naour <romain.naour@smile.fr> > > > > For some reason I get an error while building llvm package tools. > > > > x86_64-linux-g++: WARNING: unsafe header/library path used in > cross-compilation: > > '-I/usr/include/libxml2' > > > > Can you have a look? > > I went back and checked my logs on the clang compiler-rt run-test > build for that warning and didn't find it. I then checked and my > config and it has the unsafe header/library as error. Was your build > test just applying my patches and doing an explicit 'make llvm'? > Indeed, Some tools use libxml2, so you have to add target libxml2 package as build dependency. Best regards, Romain > Thanks > Matt > _______________________________________________ > buildroot mailing list > buildroot@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot > <div dir="auto"><div>Hi Matt,<br><br><div class="gmail_quote"><div dir="ltr">Le lun. 19 nov. 2018 à 02:48, Matthew Weber <<a href="mailto:matthew.weber@rockwellcollins.com">matthew.weber@rockwellcollins.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Romain,<br> <br> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <<a href="mailto:romain.naour@smile.fr" target="_blank" rel="noreferrer">romain.naour@smile.fr</a>> wrote:<br> ><br> > Hi Matt,<br> ><br> > Le 17/11/2018 à 04:56, Matt Weber a écrit :<br> > > The compiler-rt fuzzer and address sanitizer tools require additional<br> > > LLVM binary tools installed to allow stack trace decoding actively during<br> > > executable analysis.<br> > ><br> > > <a href="https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack" rel="noreferrer noreferrer" target="_blank">https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack</a><br> > ><br> > > Signed-off-by: Matthew Weber <<a href="mailto:matthew.weber@rockwellcollins.com" target="_blank" rel="noreferrer">matthew.weber@rockwellcollins.com</a>><br> > > Reviewed-by: Romain Naour <<a href="mailto:romain.naour@smile.fr" target="_blank" rel="noreferrer">romain.naour@smile.fr</a>><br> ><br> > For some reason I get an error while building llvm package tools.<br> ><br> > x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation:<br> > '-I/usr/include/libxml2'<br> ><br> > Can you have a look?<br> <br> I went back and checked my logs on the clang compiler-rt run-test<br> build for that warning and didn't find it. I then checked and my<br> config and it has the unsafe header/library as error. Was your build<br> test just applying my patches and doing an explicit 'make llvm'?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Indeed,</div><div dir="auto">Some tools use libxml2, so you have to add target libxml2 package as build dependency.</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Romain</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br> Thanks<br> Matt<br> _______________________________________________<br> buildroot mailing list<br> <a href="mailto:buildroot@busybox.net" target="_blank" rel="noreferrer">buildroot@busybox.net</a><br> <a href="http://lists.busybox.net/mailman/listinfo/buildroot" rel="noreferrer noreferrer" target="_blank">http://lists.busybox.net/mailman/listinfo/buildroot</a><br> </blockquote></div></div></div>
Romain, On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: > > Hi Matt, > > Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : >> >> Romain, >> >> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: >> > >> > Hi Matt, >> > >> > Le 17/11/2018 à 04:56, Matt Weber a écrit : >> > > The compiler-rt fuzzer and address sanitizer tools require additional >> > > LLVM binary tools installed to allow stack trace decoding actively during >> > > executable analysis. >> > > >> > > https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack >> > > >> > > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> >> > > Reviewed-by: Romain Naour <romain.naour@smile.fr> >> > >> > For some reason I get an error while building llvm package tools. >> > >> > x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: >> > '-I/usr/include/libxml2' >> > >> > Can you have a look? >> >> I went back and checked my logs on the clang compiler-rt run-test >> build for that warning and didn't find it. I then checked and my >> config and it has the unsafe header/library as error. Was your build >> test just applying my patches and doing an explicit 'make llvm'? > > > Indeed, > Some tools use libxml2, so you have to add target libxml2 package as build dependency. > Would you mind sharing your verbose output and equivalent of cmake config guess/status?
Hi Matt, Le 19/11/2018 à 14:04, Matthew Weber a écrit : > Romain, > > On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: >> >> Hi Matt, >> >> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : >>> >>> Romain, >>> >>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: >>>> >>>> Hi Matt, >>>> >>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : >>>>> The compiler-rt fuzzer and address sanitizer tools require additional >>>>> LLVM binary tools installed to allow stack trace decoding actively during >>>>> executable analysis. >>>>> >>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack >>>>> >>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> >>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> >>>> >>>> For some reason I get an error while building llvm package tools. >>>> >>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: >>>> '-I/usr/include/libxml2' >>>> >>>> Can you have a look? >>> >>> I went back and checked my logs on the clang compiler-rt run-test >>> build for that warning and didn't find it. I then checked and my >>> config and it has the unsafe header/library as error. Was your build >>> test just applying my patches and doing an explicit 'make llvm'? >> >> >> Indeed, >> Some tools use libxml2, so you have to add target libxml2 package as build dependency. >> > > Would you mind sharing your verbose output and equivalent of cmake > config guess/status? > I need to rebuild from scratch since I've fixed the build locally. I'll restart a new one next week-end. Best regards, Romain
Romain, On Tue, Nov 20, 2018, 16:37 Romain Naour <romain.naour@gmail.com wrote: > Hi Matt, > > Le 19/11/2018 à 14:04, Matthew Weber a écrit : > > Romain, > > > > On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> > wrote: > >> > >> Hi Matt, > >> > >> Le lun. 19 nov. 2018 à 02:48, Matthew Weber < > matthew.weber@rockwellcollins.com> a écrit : > >>> > >>> Romain, > >>> > >>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> > wrote: > >>>> > >>>> Hi Matt, > >>>> > >>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : > >>>>> The compiler-rt fuzzer and address sanitizer tools require additional > >>>>> LLVM binary tools installed to allow stack trace decoding actively > during > >>>>> executable analysis. > >>>>> > >>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > >>>>> > >>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > >>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> > >>>> > >>>> For some reason I get an error while building llvm package tools. > >>>> > >>>> x86_64-linux-g++: WARNING: unsafe header/library path used in > cross-compilation: > >>>> '-I/usr/include/libxml2' > >>>> > >>>> Can you have a look? > >>> > >>> I went back and checked my logs on the clang compiler-rt run-test > >>> build for that warning and didn't find it. I then checked and my > >>> config and it has the unsafe header/library as error. Was your build > >>> test just applying my patches and doing an explicit 'make llvm'? > >> > >> > >> Indeed, > >> Some tools use libxml2, so you have to add target libxml2 package as > build dependency. > >> > > > > Would you mind sharing your verbose output and equivalent of cmake > > config guess/status? > > > > I need to rebuild from scratch since I've fixed the build locally. > I'll restart a new one next week-end. > When I searched the llvm build, I see there are some xml dependencies. I hadn't got far enough to find the variables in llvm build to adjust or if I just need to make sure libxml2 is built first. > > > > > Best regards, > Romain > <div dir="auto"><div>Romain,</div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Nov 20, 2018, 16:37 Romain Naour <<a href="mailto:romain.naour@gmail.com">romain.naour@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt,<br> <br> Le 19/11/2018 à 14:04, Matthew Weber a écrit :<br> > Romain,<br> > <br> > On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <<a href="mailto:romain.naour@gmail.com" target="_blank" rel="noreferrer">romain.naour@gmail.com</a>> wrote:<br> >><br> >> Hi Matt,<br> >><br> >> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <<a href="mailto:matthew.weber@rockwellcollins.com" target="_blank" rel="noreferrer">matthew.weber@rockwellcollins.com</a>> a écrit :<br> >>><br> >>> Romain,<br> >>><br> >>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <<a href="mailto:romain.naour@smile.fr" target="_blank" rel="noreferrer">romain.naour@smile.fr</a>> wrote:<br> >>>><br> >>>> Hi Matt,<br> >>>><br> >>>> Le 17/11/2018 à 04:56, Matt Weber a écrit :<br> >>>>> The compiler-rt fuzzer and address sanitizer tools require additional<br> >>>>> LLVM binary tools installed to allow stack trace decoding actively during<br> >>>>> executable analysis.<br> >>>>><br> >>>>> <a href="https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack" rel="noreferrer noreferrer" target="_blank">https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack</a><br> >>>>><br> >>>>> Signed-off-by: Matthew Weber <<a href="mailto:matthew.weber@rockwellcollins.com" target="_blank" rel="noreferrer">matthew.weber@rockwellcollins.com</a>><br> >>>>> Reviewed-by: Romain Naour <<a href="mailto:romain.naour@smile.fr" target="_blank" rel="noreferrer">romain.naour@smile.fr</a>><br> >>>><br> >>>> For some reason I get an error while building llvm package tools.<br> >>>><br> >>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation:<br> >>>> '-I/usr/include/libxml2'<br> >>>><br> >>>> Can you have a look?<br> >>><br> >>> I went back and checked my logs on the clang compiler-rt run-test<br> >>> build for that warning and didn't find it. I then checked and my<br> >>> config and it has the unsafe header/library as error. Was your build<br> >>> test just applying my patches and doing an explicit 'make llvm'?<br> >><br> >><br> >> Indeed,<br> >> Some tools use libxml2, so you have to add target libxml2 package as build dependency.<br> >><br> > <br> > Would you mind sharing your verbose output and equivalent of cmake<br> > config guess/status?<br> > <br> <br> I need to rebuild from scratch since I've fixed the build locally.<br> I'll restart a new one next week-end.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">When I searched the llvm build, I see there are some xml dependencies. I hadn't got far enough to find the variables in llvm build to adjust or if I just need to make sure libxml2 is built first.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><br><br><br><br> Best regards,<br> Romain<br> </blockquote></div></div></div>
On Tue, Nov 20, 2018 at 4:37 PM Romain Naour <romain.naour@gmail.com> wrote: > > Hi Matt, > > Le 19/11/2018 à 14:04, Matthew Weber a écrit : > > Romain, > > > > On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: > >> > >> Hi Matt, > >> > >> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : > >>> > >>> Romain, > >>> > >>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: > >>>> > >>>> Hi Matt, > >>>> > >>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : > >>>>> The compiler-rt fuzzer and address sanitizer tools require additional > >>>>> LLVM binary tools installed to allow stack trace decoding actively during > >>>>> executable analysis. > >>>>> > >>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > >>>>> > >>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > >>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> > >>>> > >>>> For some reason I get an error while building llvm package tools. > >>>> > >>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: > >>>> '-I/usr/include/libxml2' > >>>> > >>>> Can you have a look? > >>> > >>> I went back and checked my logs on the clang compiler-rt run-test > >>> build for that warning and didn't find it. I then checked and my > >>> config and it has the unsafe header/library as error. Was your build > >>> test just applying my patches and doing an explicit 'make llvm'? > >> > >> > >> Indeed, > >> Some tools use libxml2, so you have to add target libxml2 package as build dependency. > >> > > > > Would you mind sharing your verbose output and equivalent of cmake > > config guess/status? > > > > I need to rebuild from scratch since I've fixed the build locally. > I'll restart a new one next week-end. > Something like the following added to package/llvm/llvm.mk? (Still haven't see this on my end. I messed with my host system a bit to get libxml2 support and headers in place, no luck.) # LLVM requires libxml2 HOST_LLVM_CONF_OPTS += \ -DLIBXML2_LIBRARIES=$(HOST_DIR)/lib \ -DLIBXML2_INCLUDE_DIR=$(HOST_DIR)/include/libxml2 HOST_LLVM_DEPENDENCIES += host-libxml2 LLVM_CONF_OPTS += \ -DLIBXML2_LIBRARIES=$(STAGING_DIR)/usr/lib \ -DLIBXML2_INCLUDE_DIR=$(STAGING_DIR)/usr/include/libxml2 LLVM_DEPENDENCIES += libxml2 The interesting thing is that it looks like just a windows manifest manager source file uses the libxml2. Unsure of it's role.... Matt
Hi Matt, Le 21/11/2018 à 04:12, Matthew Weber a écrit : > On Tue, Nov 20, 2018 at 4:37 PM Romain Naour <romain.naour@gmail.com> wrote: >> >> Hi Matt, >> >> Le 19/11/2018 à 14:04, Matthew Weber a écrit : >>> Romain, >>> >>> On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: >>>> >>>> Hi Matt, >>>> >>>> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : >>>>> >>>>> Romain, >>>>> >>>>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: >>>>>> >>>>>> Hi Matt, >>>>>> >>>>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : >>>>>>> The compiler-rt fuzzer and address sanitizer tools require additional >>>>>>> LLVM binary tools installed to allow stack trace decoding actively during >>>>>>> executable analysis. >>>>>>> >>>>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack >>>>>>> >>>>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> >>>>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> >>>>>> >>>>>> For some reason I get an error while building llvm package tools. >>>>>> >>>>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: >>>>>> '-I/usr/include/libxml2' >>>>>> >>>>>> Can you have a look? >>>>> >>>>> I went back and checked my logs on the clang compiler-rt run-test >>>>> build for that warning and didn't find it. I then checked and my >>>>> config and it has the unsafe header/library as error. Was your build >>>>> test just applying my patches and doing an explicit 'make llvm'? >>>> >>>> >>>> Indeed, >>>> Some tools use libxml2, so you have to add target libxml2 package as build dependency. >>>> >>> >>> Would you mind sharing your verbose output and equivalent of cmake >>> config guess/status? >>> >> >> I need to rebuild from scratch since I've fixed the build locally. >> I'll restart a new one next week-end. >> > > Something like the following added to package/llvm/llvm.mk? (Still > haven't see this on my end. I messed with my host system a bit to get > libxml2 support and headers in place, no luck.) > > # LLVM requires libxml2 > HOST_LLVM_CONF_OPTS += \ > -DLIBXML2_LIBRARIES=$(HOST_DIR)/lib \ > -DLIBXML2_INCLUDE_DIR=$(HOST_DIR)/include/libxml2 > HOST_LLVM_DEPENDENCIES += host-libxml2 > LLVM_CONF_OPTS += \ > -DLIBXML2_LIBRARIES=$(STAGING_DIR)/usr/lib \ > -DLIBXML2_INCLUDE_DIR=$(STAGING_DIR)/usr/include/libxml2 > LLVM_DEPENDENCIES += libxml2 I reproduced the issue: https://pastebin.com/s8PZvuGt The CMakeCache.txt content seems interesting: //Path to a file. LIBXML2_INCLUDE_DIR:PATH=LIBXML2_INCLUDE_DIR-NOTFOUND //Path to a library. LIBXML2_LIBRARY:FILEPATH=LIBXML2_LIBRARY-NOTFOUND //Path to a program. LIBXML2_XMLLINT_EXECUTABLE:FILEPATH=/usr/bin/xmllint //Use libxml2 if available. Can be ON, OFF, or FORCE_ON LLVM_ENABLE_LIBXML2:STRING=ON LLVM_ENABLE_LIBXML2 allow to define LLVM_LIBXML2_ENABLED $ grep -r LLVM_LIBXML2_ENABLED in the build directory: cmake/modules/CMakeFiles/LLVMConfig.cmake:set(LLVM_LIBXML2_ENABLED 0) NATIVE/cmake/modules/CMakeFiles/LLVMConfig.cmake:set(LLVM_LIBXML2_ENABLED 1) NATIVE/lib/cmake/llvm/LLVMConfig.cmake:set(LLVM_LIBXML2_ENABLED 1) NATIVE/include/llvm/Config/config.h:#define LLVM_LIBXML2_ENABLED 1 lib/cmake/llvm/LLVMConfig.cmake:set(LLVM_LIBXML2_ENABLED 0) include/llvm/Config/config.h:/* #undef LLVM_LIBXML2_ENABLED */ It seems that llvm try to build something for the host (NATIVE) while building target llvm package. Sadly it use the cross-compiler to build them and that is why we hit the paranoid wrapper. > > The interesting thing is that it looks like just a windows manifest > manager source file uses the libxml2. Unsure of it's role.... Then we can just add -DLLVM_ENABLE_LIBXML2=OFF for host-llvm and llvm. Best regards, Romain > > > Matt >
Romain, On Wed, Nov 21, 2018 at 3:19 PM Romain Naour <romain.naour@gmail.com> wrote: > > Hi Matt, > > Le 21/11/2018 à 04:12, Matthew Weber a écrit : > > On Tue, Nov 20, 2018 at 4:37 PM Romain Naour <romain.naour@gmail.com> wrote: > >> > >> Hi Matt, > >> > >> Le 19/11/2018 à 14:04, Matthew Weber a écrit : > >>> Romain, > >>> > >>> On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: > >>>> > >>>> Hi Matt, > >>>> > >>>> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : > >>>>> > >>>>> Romain, > >>>>> > >>>>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: > >>>>>> > >>>>>> Hi Matt, > >>>>>> > >>>>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : > >>>>>>> The compiler-rt fuzzer and address sanitizer tools require additional > >>>>>>> LLVM binary tools installed to allow stack trace decoding actively during > >>>>>>> executable analysis. > >>>>>>> > >>>>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > >>>>>>> > >>>>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > >>>>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> > >>>>>> > >>>>>> For some reason I get an error while building llvm package tools. > >>>>>> > >>>>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: > >>>>>> '-I/usr/include/libxml2' > >>>>>> > >>>>>> Can you have a look? > >>>>> > >>>>> I went back and checked my logs on the clang compiler-rt run-test > >>>>> build for that warning and didn't find it. I then checked and my > >>>>> config and it has the unsafe header/library as error. Was your build > >>>>> test just applying my patches and doing an explicit 'make llvm'? > >>>> > >>>> > >>>> Indeed, > >>>> Some tools use libxml2, so you have to add target libxml2 package as build dependency. > >>>> > >>> > >>> Would you mind sharing your verbose output and equivalent of cmake > >>> config guess/status? > >>> > >> > >> I need to rebuild from scratch since I've fixed the build locally. > >> I'll restart a new one next week-end. > >> > > > > Something like the following added to package/llvm/llvm.mk? (Still > > haven't see this on my end. I messed with my host system a bit to get > > libxml2 support and headers in place, no luck.) > > > > # LLVM requires libxml2 > > HOST_LLVM_CONF_OPTS += \ > > -DLIBXML2_LIBRARIES=$(HOST_DIR)/lib \ > > -DLIBXML2_INCLUDE_DIR=$(HOST_DIR)/include/libxml2 > > HOST_LLVM_DEPENDENCIES += host-libxml2 > > LLVM_CONF_OPTS += \ > > -DLIBXML2_LIBRARIES=$(STAGING_DIR)/usr/lib \ > > -DLIBXML2_INCLUDE_DIR=$(STAGING_DIR)/usr/include/libxml2 > > LLVM_DEPENDENCIES += libxml2 > > I reproduced the issue: https://pastebin.com/s8PZvuGt > Ah ok, I see you have the AMD GPU stuff enabled. I'll enable that and see if I can reproduce the path poisoning. Then do some builds with/without explicitly disabling via -DLLVM_ENABLE_LIBXML2. Matt
Romain, On Wed, Nov 21, 2018 at 9:14 PM Matthew Weber <matthew.weber@rockwellcollins.com> wrote: > > Romain, > > On Wed, Nov 21, 2018 at 3:19 PM Romain Naour <romain.naour@gmail.com> wrote: > > > > Hi Matt, > > > > Le 21/11/2018 à 04:12, Matthew Weber a écrit : > > > On Tue, Nov 20, 2018 at 4:37 PM Romain Naour <romain.naour@gmail.com> wrote: > > >> > > >> Hi Matt, > > >> > > >> Le 19/11/2018 à 14:04, Matthew Weber a écrit : > > >>> Romain, > > >>> > > >>> On Mon, Nov 19, 2018 at 2:10 AM Romain Naour <romain.naour@gmail.com> wrote: > > >>>> > > >>>> Hi Matt, > > >>>> > > >>>> Le lun. 19 nov. 2018 à 02:48, Matthew Weber <matthew.weber@rockwellcollins.com> a écrit : > > >>>>> > > >>>>> Romain, > > >>>>> > > >>>>> On Sun, Nov 18, 2018 at 1:14 PM Romain Naour <romain.naour@smile.fr> wrote: > > >>>>>> > > >>>>>> Hi Matt, > > >>>>>> > > >>>>>> Le 17/11/2018 à 04:56, Matt Weber a écrit : > > >>>>>>> The compiler-rt fuzzer and address sanitizer tools require additional > > >>>>>>> LLVM binary tools installed to allow stack trace decoding actively during > > >>>>>>> executable analysis. > > >>>>>>> > > >>>>>>> https://github.com/google/sanitizers/wiki/AddressSanitizerCallStack > > >>>>>>> > > >>>>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> > > >>>>>>> Reviewed-by: Romain Naour <romain.naour@smile.fr> > > >>>>>> > > >>>>>> For some reason I get an error while building llvm package tools. > > >>>>>> > > >>>>>> x86_64-linux-g++: WARNING: unsafe header/library path used in cross-compilation: > > >>>>>> '-I/usr/include/libxml2' > > >>>>>> > > >>>>>> Can you have a look? > > >>>>> > > >>>>> I went back and checked my logs on the clang compiler-rt run-test > > >>>>> build for that warning and didn't find it. I then checked and my > > >>>>> config and it has the unsafe header/library as error. Was your build > > >>>>> test just applying my patches and doing an explicit 'make llvm'? > > >>>> > > >>>> > > >>>> Indeed, > > >>>> Some tools use libxml2, so you have to add target libxml2 package as build dependency. > > >>>> > > >>> > > >>> Would you mind sharing your verbose output and equivalent of cmake > > >>> config guess/status? > > >>> > > >> > > >> I need to rebuild from scratch since I've fixed the build locally. > > >> I'll restart a new one next week-end. > > >> > > > > > > Something like the following added to package/llvm/llvm.mk? (Still > > > haven't see this on my end. I messed with my host system a bit to get > > > libxml2 support and headers in place, no luck.) > > > > > > # LLVM requires libxml2 > > > HOST_LLVM_CONF_OPTS += \ > > > -DLIBXML2_LIBRARIES=$(HOST_DIR)/lib \ > > > -DLIBXML2_INCLUDE_DIR=$(HOST_DIR)/include/libxml2 > > > HOST_LLVM_DEPENDENCIES += host-libxml2 > > > LLVM_CONF_OPTS += \ > > > -DLIBXML2_LIBRARIES=$(STAGING_DIR)/usr/lib \ > > > -DLIBXML2_INCLUDE_DIR=$(STAGING_DIR)/usr/include/libxml2 > > > LLVM_DEPENDENCIES += libxml2 > > > > I reproduced the issue: https://pastebin.com/s8PZvuGt > > > > Ah ok, I see you have the AMD GPU stuff enabled. I'll enable that and > see if I can reproduce the path poisoning. Then do some builds > with/without explicitly disabling via -DLLVM_ENABLE_LIBXML2. > I still can't reproduce it. Would you mind sharing your defconfig? I'll send a v4 with the -DLLVM_ENABLE_LIBXML2=off. See where you get with that. Matt
diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 1f9bd44..79477f0 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -197,8 +197,17 @@ HOST_LLVM_CONF_OPTS += \ # We need to activate LLVM_INCLUDE_TOOLS, otherwise it does not generate # libLLVM.so LLVM_CONF_OPTS += \ - -DLLVM_INCLUDE_TOOLS=ON \ + -DLLVM_INCLUDE_TOOLS=ON + +# The llvm-symbolizer binary is used by the Compiler-RT Fuzzer +# and AddressSanitizer tools for stack traces. +ifeq ($(BR2_PACKAGE_COMPILER_RT),y) +LLVM_CONF_OPTS += \ + -DLLVM_BUILD_TOOLS=ON +else +LLVM_CONF_OPTS += \ -DLLVM_BUILD_TOOLS=OFF +endif # Compiler-rt not in the source tree. # llvm runtime libraries are not in the source tree.