[llvm] r292256 - Enabled -fsanitize-address-use-after-scope for -DLLVM_USE_SANITIZER=Address

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 11:27:32 PST 2017


Thank you!
Sorry, somehow I missed that a host compiler can be something else.

On Wed, Jan 18, 2017 at 11:18 AM Justin Bogner <mail at justinbogner.com>
wrote:

> Vitaly Buka via llvm-commits <llvm-commits at lists.llvm.org> writes:
> > Author: vitalybuka
> > Date: Tue Jan 17 15:04:23 2017
> > New Revision: 292256
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=292256&view=rev
> > Log:
> > Enabled -fsanitize-address-use-after-scope for
> -DLLVM_USE_SANITIZER=Address
> >
> > Subscribers: mgorny, llvm-commits
> >
> > Differential Revision: https://reviews.llvm.org/D28823
> >
> > Modified:
> >     llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> >
> > Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> > URL:
> >
> http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=292256&r1=292255&r2=292256&view=diff
> >
> ==============================================================================
> >
> > --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
> > +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Tue Jan 17 15:04:23
> 2017
> > @@ -588,6 +588,9 @@ if(LLVM_USE_SANITIZER)
> >    else()
> >      message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this
> platform.")
> >    endif()
> > +  if (LLVM_USE_SANITIZER MATCHES "(Undefined;)?Address(;Undefined)?")
> > +    append("-fsanitize-address-use-after-scope" CMAKE_C_FLAGS
> CMAKE_CXX_FLAGS)
>
> This isn't right. -fsanitize-address-use-after-scope is a fairly new
> flag, so this will fail to even be able to build anywhere where the host
> clang isn't bleeding edge. Instead, we should be using
> add_flag_if_supported here, which I've done for you in r292423.
>
> > +  endif()
> >    if (LLVM_USE_SANITIZE_COVERAGE)
> >
> append("-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp"
> CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
> >    endif()
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170118/995aa12c/attachment.html>


More information about the llvm-commits mailing list