| # Copyright 2019 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxbug.dev/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| source_set("stack") { |
| # configs += [ "//build/unification/config:zircon-migrated" ] |
| testonly = true |
| sources = [ "stack-test.cc" ] |
| deps = [ |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/runtime", |
| ] |
| |
| cflags = [ "-fstack-protector-all" ] |
| |
| if (current_cpu == "arm64") { # && !is_gcc |
| cflags += [ "-fsanitize=shadow-call-stack" ] |
| } |
| |
| if (select_variant + [ "gcc" ] - [ "gcc" ] != select_variant) { |
| cflags += [ "-fno-sanitize=safe-stack" ] |
| } |
| } |