[CFI] Enable cfi-icall type generalization

Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature. This
condition can be too strict, a common form of 'abstraction' relies on
function pointers being cast to generalize argument pointer types to
void*. For example, qsort() accepts two const void*s but the
implementations are likely to implement the comparison function using
pointers to the specific type being sorted.

This function relaxes cfi-icall type checking for code that uses this
pattern by using the new -fsanitize-cfi-icall-generalize-pointers
argument. It considers all pointer types equal as long as their
qualifiers match.


Bug: 785442
Change-Id: Ic9487908b6372898f031502c84284d008a3fdec1
Reviewed-on: https://chromium-review.googlesource.com/777555
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Johann Koenig <johannkoenig@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#518446}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 521fd17a903cdae78c797770348320d99064b0cc
diff --git a/BUILD.gn b/BUILD.gn
index 21dffd3..843c2b5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -66,6 +66,7 @@
   config("yasm_config") {
+    configs = [ "//build/config/sanitizers:cfi_icall_generalize_pointers" ]
     include_dirs = [