diff mbox

[2/2] toolchain-external: install libsanitizer libraries if available

Message ID 20170703215803.6233-2-peter@korsgaard.com
State Changes Requested
Headers show

Commit Message

Peter Korsgaard July 3, 2017, 9:58 p.m. UTC
Gcc builds libsanitizer (lib{a,l,t,u}san) for
-fsanitize={address,thread,leak,undefined} if the needed dependencies are
available, so ensure these also gets copied to the target fs to support
-fsanitize.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kundrát July 4, 2017, 7:57 a.m. UTC | #1
On pondělí 3. července 2017 23:58:03 CEST, Peter Korsgaard wrote:
> Gcc builds libsanitizer (lib{a,l,t,u}san) for
> -fsanitize={address,thread,leak,undefined} if the needed dependencies are
> available, so ensure these also gets copied to the target fs to support
> -fsanitize.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Tested on Linaro 2017.02 for beaglebone black, it appears to work.

Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Tested-by: Jan Kundrát <jan.kundrat@cesnet.cz>

> ---
>  toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git 
> a/toolchain/toolchain-external/pkg-toolchain-external.mk 
> b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index 8460e37d09..0764b379b5 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -108,7 +108,7 @@ endif
>  # Definitions of the list of libraries that should be copied to the target.
>  #
>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
> -TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* 
> libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* 
> libresolv.so.* librt.so.* libutil.so.*
> +TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* 
> libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* 
> libresolv.so.* librt.so.* libutil.so.* lib?san.so.*
>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_ARM_EABIHF),yy)
>  TOOLCHAIN_EXTERNAL_LIBS += ld-linux-armhf.so.*
>  else
Jan Kundrát July 4, 2017, 10:06 a.m. UTC | #2
On pondělí 3. července 2017 23:58:03 CEST, Peter Korsgaard wrote:
> Gcc builds libsanitizer (lib{a,l,t,u}san) for
> -fsanitize={address,thread,leak,undefined} if the needed dependencies are
> available, so ensure these also gets copied to the target fs to support
> -fsanitize.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git 
> a/toolchain/toolchain-external/pkg-toolchain-external.mk 
> b/toolchain/toolchain-external/pkg-toolchain-external.mk
> index 8460e37d09..0764b379b5 100644
> --- a/toolchain/toolchain-external/pkg-toolchain-external.mk
> +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
> @@ -108,7 +108,7 @@ endif
>  # Definitions of the list of libraries that should be copied to the target.
>  #
>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
> -TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* 
> libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* 
> libresolv.so.* librt.so.* libutil.so.*
> +TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* 
> libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* 
> libresolv.so.* librt.so.* libutil.so.* lib?san.so.*

Actually, this is not enough. There's also "libubsan" which doesn't match 
this glob.

The same applies to the other patch for the internal toolchain. Apart from 
that, I tested it and it works (ASAN is now included).

Cheers,
Jan

>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_ARM_EABIHF),yy)
>  TOOLCHAIN_EXTERNAL_LIBS += ld-linux-armhf.so.*
>  else
diff mbox

Patch

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 8460e37d09..0764b379b5 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -108,7 +108,7 @@  endif
 # Definitions of the list of libraries that should be copied to the target.
 #
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
-TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.*
+TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.* lib?san.so.*
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_ARM_EABIHF),yy)
 TOOLCHAIN_EXTERNAL_LIBS += ld-linux-armhf.so.*
 else