| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # TODO(fxbug.dev/54160): Keep in sync with //zircon/public/gn/config/instrumentation/BUILD.zircon.gn |
| import("//build/unification/global_variables.gni") |
| |
| # ubsan-trap is pure instrumentation with no runtime. |
| config("ubsan-trap") { |
| if (is_gcc) { |
| compiler_flags = [ |
| "-fsanitize=undefined", |
| "-fsanitize-undefined-trap-on-error", |
| ] |
| } else { |
| compiler_flags = [ "-fsanitize-trap=undefined" ] |
| } |
| asmflags = compiler_flags |
| cflags = compiler_flags |
| ldflags = compiler_flags |
| } |