libasan.so missing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

libasan.so missing

Wolfgang Grandegger
Hello,

I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why the
address sanitizer library "libasan.so*" is not available in the rootfs
of the target. Is it intentional? And what is the best way to get it
added to the rootfs?

Wolfgang.
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Jan Kundrát
On středa 14. června 2017 9:14:46 CEST, Wolfgang Grandegger wrote:
> I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder
> why the address sanitizer library "libasan.so*" is not available
> in the rootfs of the target. Is it intentional? And what is the
> best way to get it added to the rootfs?

I was hitting the same problem but with GCC 6.3. I "kinda solved it" by
simply copying the files around; I'm afraid I don't want to dive into GCC's
makefiles to see why these are getting skipped.

Cheers,
Jan
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Wolfgang Grandegger
Hello Jan,

Am 16.06.2017 um 14:14 schrieb Jan Kundrát:
> On středa 14. června 2017 9:14:46 CEST, Wolfgang Grandegger wrote:
>> I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why
>> the address sanitizer library "libasan.so*" is not available in the
>> rootfs of the target. Is it intentional? And what is the best way to
>> get it added to the rootfs?
>
> I was hitting the same problem but with GCC 6.3. I "kinda solved it" by
> simply copying the files around; I'm afraid I don't want to dive into
> GCC's makefiles to see why these are getting skipped.

Yes, copying the library to the target directory in a board-specific
script is an option (the wrong rpath should not harm). I just wonder why
it's not available, at least in the staging tree. Maybe somebody can
explain why?

Wolfgang.
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Peter Korsgaard-2
In reply to this post by Wolfgang Grandegger
>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:

 > Hello,
 > I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why
 > the address sanitizer library "libasan.so*" is not available in the
 > rootfs of the target. Is it intentional? And what is the best way to
 > get it added to the rootfs?

Is this with uClibc-ng, musl or Glibc?

We have the following in package/gcc/gcc.mk:

# libsanitizer requires wordexp, not in default uClibc config. Also
# doesn't build properly with musl.
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC)$(BR2_TOOLCHAIN_BUILDROOT_MUSL),y)
HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer
endif

We recently enabled wordexp support in uClibc-ng, so this can most likely
we enabled there. I'll do a test build now.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Wolfgang Grandegger
Hello Peter,

Am 03.07.2017 um 19:19 schrieb Peter Korsgaard:
>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
>
>   > Hello,
>   > I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why
>   > the address sanitizer library "libasan.so*" is not available in the
>   > rootfs of the target. Is it intentional? And what is the best way to
>   > get it added to the rootfs?
>
> Is this with uClibc-ng, musl or Glibc?

It's with Glibc. I think the libsanitizer libs are built but not moved
to the target.

> We have the following in package/gcc/gcc.mk:
>
> # libsanitizer requires wordexp, not in default uClibc config. Also
> # doesn't build properly with musl.
> ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC)$(BR2_TOOLCHAIN_BUILDROOT_MUSL),y)
> HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer
> endif
>
> We recently enabled wordexp support in uClibc-ng, so this can most likely
> we enabled there. I'll do a test build now.

Wolfgang.

_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Peter Korsgaard-2
>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:

 > Hello Peter,
 > Am 03.07.2017 um 19:19 schrieb Peter Korsgaard:
 >>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
 >>
 >> > Hello,
 >> > I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why
 >> > the address sanitizer library "libasan.so*" is not available in the
 >> > rootfs of the target. Is it intentional? And what is the best way to
 >> > get it added to the rootfs?
 >>
 >> Is this with uClibc-ng, musl or Glibc?

 > It's with Glibc. I think the libsanitizer libs are built but not moved
 > to the target.

Correct. I've sent a patch fixing this for the internal and external
toolchain. Could you give it a try?

https://patchwork.ozlabs.org/patch/783661/
https://patchwork.ozlabs.org/patch/783660/

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Wolfgang Grandegger


Am 03.07.2017 um 23:59 schrieb Peter Korsgaard:

>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
>
>   > Hello Peter,
>   > Am 03.07.2017 um 19:19 schrieb Peter Korsgaard:
>   >>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
>   >>
>   >> > Hello,
>   >> > I'm using the x86_64 buildroot toolchain with gcc 5.4. I wonder why
>   >> > the address sanitizer library "libasan.so*" is not available in the
>   >> > rootfs of the target. Is it intentional? And what is the best way to
>   >> > get it added to the rootfs?
>   >>
>   >> Is this with uClibc-ng, musl or Glibc?
>
>   > It's with Glibc. I think the libsanitizer libs are built but not moved
>   > to the target.
>
> Correct. I've sent a patch fixing this for the internal and external
> toolchain. Could you give it a try?
>
> https://patchwork.ozlabs.org/patch/783661/
> https://patchwork.ozlabs.org/patch/783660/

$ find . -name 'libasan*'
./target/lib/libasan.so
./target/lib/libasan_preinit.o
./target/lib/libasan.so.2
./target/lib/libasan.so.2.0.0

It works. The libsanitizer adds some extra space and runtime overhead, I
assume. Therefore, on Ubuntu, the libraries are not installed by
default. They can be added by installing the "libasan0" package. For
buildroot, would it make sense to make this option configurable as well?

(libasan.*) Extra toolchain libraries to be copied to target

Wolfgang.
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Peter Korsgaard-2
>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:

Hi,

 >> Correct. I've sent a patch fixing this for the internal and external
 >> toolchain. Could you give it a try?
 >>
 >> https://patchwork.ozlabs.org/patch/783661/
 >> https://patchwork.ozlabs.org/patch/783660/

 > $ find . -name 'libasan*'
 > ./target/lib/libasan.so
 > ./target/lib/libasan_preinit.o
 > ./target/lib/libasan.so.2
 > ./target/lib/libasan.so.2.0.0

 > It works. The libsanitizer adds some extra space and runtime overhead,
 > I assume. Therefore, on Ubuntu, the libraries are not installed by
 > default. They can be added by installing the "libasan0" package. For
 > buildroot, would it make sense to make this option configurable as
 > well?

 > (libasan.*) Extra toolchain libraries to be copied to target

Yes, I'll respin the series to add an option to install
asan/lsan/tsan/usan.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Matthew Weber
All,

On Tue, Jul 4, 2017 at 7:22 AM, Peter Korsgaard <[hidden email]> wrote:

>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
>
> Hi,
>
>  >> Correct. I've sent a patch fixing this for the internal and external
>  >> toolchain. Could you give it a try?
>  >>
>  >> https://patchwork.ozlabs.org/patch/783661/
>  >> https://patchwork.ozlabs.org/patch/783660/
>
>  > $ find . -name 'libasan*'
>  > ./target/lib/libasan.so
>  > ./target/lib/libasan_preinit.o
>  > ./target/lib/libasan.so.2
>  > ./target/lib/libasan.so.2.0.0
>
>  > It works. The libsanitizer adds some extra space and runtime overhead,
>  > I assume. Therefore, on Ubuntu, the libraries are not installed by
>  > default. They can be added by installing the "libasan0" package. For
>  > buildroot, would it make sense to make this option configurable as
>  > well?
>
>  > (libasan.*) Extra toolchain libraries to be copied to target
>
> Yes, I'll respin the series to add an option to install
> asan/lsan/tsan/usan.
>

I'm building the following Buildroot Custom toolchain config and
noticing a libsanitizer failure.  I haven't looked to far into why
yet.  This was working back on master ~06/13

../../../../libsanitizer/asan/asan_linux.cc: In function âbool
__asan::AsanInterceptsSignal(int)â:
../../../../libsanitizer/asan/asan_linux.cc:222:20: error: âSIGSEGVâ
was not declared in this scope
   return signum == SIGSEGV && common_flags()->handle_segv;
                    ^
make[6]: *** [asan_linux.lo] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-target-libsanitizer] Error 2
make[2]: *** [all] Error 2
make[1]: *** [/accts/mlweber1/target/build/host-gcc-final-5.4.0/.stamp_built]
Error 2
make: *** [_all] Error 2

Config to reproduce:
BR2_powerpc=y
BR2_powerpc_e500mc=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="3.12.37"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_12=y
BR2_GCC_VERSION_5_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_GCC_ENABLE_LTO=y





--
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / Security Systems and Software / Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to [hidden email].
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Matthew Weber
All,

On Fri, Jul 7, 2017 at 9:08 AM, Matthew Weber
<[hidden email]> wrote:

> All,
>
> On Tue, Jul 4, 2017 at 7:22 AM, Peter Korsgaard <[hidden email]> wrote:
>>>>>>> "Wolfgang" == Wolfgang Grandegger <[hidden email]> writes:
>>
>> Hi,
>>
>>  >> Correct. I've sent a patch fixing this for the internal and external
>>  >> toolchain. Could you give it a try?
>>  >>
>>  >> https://patchwork.ozlabs.org/patch/783661/
>>  >> https://patchwork.ozlabs.org/patch/783660/
>>
>>  > $ find . -name 'libasan*'
>>  > ./target/lib/libasan.so
>>  > ./target/lib/libasan_preinit.o
>>  > ./target/lib/libasan.so.2
>>  > ./target/lib/libasan.so.2.0.0
>>
>>  > It works. The libsanitizer adds some extra space and runtime overhead,
>>  > I assume. Therefore, on Ubuntu, the libraries are not installed by
>>  > default. They can be added by installing the "libasan0" package. For
>>  > buildroot, would it make sense to make this option configurable as
>>  > well?
>>
>>  > (libasan.*) Extra toolchain libraries to be copied to target
>>
>> Yes, I'll respin the series to add an option to install
>> asan/lsan/tsan/usan.
>>
>
> I'm building the following Buildroot Custom toolchain config and
> noticing a libsanitizer failure.  I haven't looked to far into why
> yet.  This was working back on master ~06/13
>
> ../../../../libsanitizer/asan/asan_linux.cc: In function âbool
> __asan::AsanInterceptsSignal(int)â:
> ../../../../libsanitizer/asan/asan_linux.cc:222:20: error: âSIGSEGVâ
> was not declared in this scope
>    return signum == SIGSEGV && common_flags()->handle_segv;
>                     ^
> make[6]: *** [asan_linux.lo] Error 1
> make[5]: *** [all-recursive] Error 1
> make[4]: *** [all] Error 2
> make[3]: *** [all-target-libsanitizer] Error 2
> make[2]: *** [all] Error 2
> make[1]: *** [/accts/mlweber1/target/build/host-gcc-final-5.4.0/.stamp_built]
> Error 2
> make: *** [_all] Error 2
>
> Config to reproduce:
> BR2_powerpc=y
> BR2_powerpc_e500mc=y
> BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
> BR2_KERNEL_HEADERS_VERSION=y
> BR2_DEFAULT_KERNEL_VERSION="3.12.37"
> BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_12=y
> BR2_GCC_VERSION_5_X=y
> BR2_TOOLCHAIN_BUILDROOT_CXX=y
> BR2_GCC_ENABLE_LTO=y
>

Looks like I need to post a GCC5 bugfix.  Pending more testing :-)

https://www.mail-archive.com/gcc-patches@.../msg159613.html

Matt
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Peter Korsgaard-2
>>>>> "Matthew" == Matthew Weber <[hidden email]> writes:

Hi,

 > Looks like I need to post a GCC5 bugfix.  Pending more testing :-)

 > https://www.mail-archive.com/gcc-patches@.../msg159613.html

Ahh indeed, please submit a patch if that fixes the build issue -
Thanks.

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: libasan.so missing

Matthew Weber
Peter,

On Wed, Jul 12, 2017 at 10:04 AM, Peter Korsgaard <[hidden email]> wrote:
>>>>>> "Matthew" == Matthew Weber <[hidden email]> writes:
>
> Hi,
>
>  > Looks like I need to post a GCC5 bugfix.  Pending more testing :-)
>
>  > https://www.mail-archive.com/gcc-patches@.../msg159613.html
>
> Ahh indeed, please submit a patch if that fixes the build issue -


https://patchwork.ozlabs.org/patch/787511/
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot