blob: b80ddbd3fbc2e0a65b377bf9b929b01834a6d81d [file] [log] [blame]
# 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.
zx_library("jitterentropy") {
kernel = true
sources = [ "jitterentropy-base.c" ]
include_dirs = [ "arch/$zircon_cpu" ]
deps = [ "$zx/kernel/lib/arch" ]
# According to its documentation, jitterentropy must be compiled at
# optimization level -O0.
#
# TODO(SEC-14): Test the code generated at various optimization
# levels. If there is a significant difference in entropy quality,
# replace the relevant C code by assembly code to protect against future
# compiler changes.
configs -= [ "$zx/public/gn/config:default_optimize" ]
configs += [
":config",
"$zx/public/gn/config:optimize_none",
]
}
config("config") {
visibility = [ ":*" ]
cflags = [
# The original Makefile also specifies -fwrapv.
"-fwrapv",
]
}