Re: [PATCH] kasan: don't emit builtin calls when sanitization is off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 01/19/2018 05:54 PM, Andrey Konovalov wrote:

> diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
> index dbbd4382f15a..db473309f136 100644
> --- a/scripts/Makefile.kasan
> +++ b/scripts/Makefile.kasan
> @@ -39,4 +39,7 @@ else
>  endif
>  
>  CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
> +
> +CFLAGS_KASAN_NOSANITIZE := $(call cc-option, -fno-builtin)
> +

I think it should be fine to drop cc-option here. Even ancient versions of GCC have -fno-builtin.

>  endif
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 1ca4dcd2d500..015aa9dbad86 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -121,7 +121,7 @@ endif
>  ifeq ($(CONFIG_KASAN),y)
>  _c_flags += $(if $(patsubst n%,, \
>  		$(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \
> -		$(CFLAGS_KASAN))
> +		$(CFLAGS_KASAN), $(CFLAGS_KASAN_NOSANITIZE))
>  endif
>  
>  ifeq ($(CONFIG_UBSAN),y)
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux