• Peter Collingbourne's avatar
    Add a hwasan_platform build flag. · 788e705b
    Peter Collingbourne authored
    This flag specifies whether to target the platform's copy of the HWASan
    runtime, rather than one bundled with the application.
    
    I decided to make this a build flag rather than change the default because
    there are use cases for both settings.
    
    - Builds with hwasan_platform=true may only be used on HWASANified builds of
      the platform.
    - Builds with hwasan_platform=false are only expected to work on
      non-HWSANified builds of the platform. They may work in HWASANified builds,
      but this is not guaranteed because the compiler is allowed to target the
      bundled runtime library which may have a different ABI to the platform's
      copy.
    
    Moreover, hwasan_platform=false requires the compiler to emit additional
    code into each function which can hurt performance and binary size.
    
    Bug: 916828
    Change-Id: I45c9ccdc0a5cf1b3c6a729263204a023b40ba15f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1642787
    Commit-Queue: Peter Collingbourne <pcc@chromium.org>
    Reviewed-by: default avatarNico Weber <thakis@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#666092}
    788e705b
BUILD.gn 19 KB