blob: c5982c34560d45419340170d0743d0be11761a15 [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.
import("//build/zircon/zircon_cpu.gni")
import("//build/zircon/zx_library.gni")
zx_library("jitterentropy") {
sources = [ "jitterentropy-base.c" ]
include_dirs = [ "arch/$zircon_cpu" ]
deps = [ "//zircon/kernel/lib/arch" ]
# According to its documentation, jitterentropy must be compiled at
# optimization level -O0.
#
# TODO(fxbug.dev/24745): 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 -= [ "//build/config:default_optimize" ]
configs += [
":config",
"//build/config:optimize_none",
]
configs += [ "//build/config:Wno-conversion" ]
}
config("config") {
visibility = [ ":*" ]
cflags = [
# The original Makefile also specifies -fwrapv.
"-fwrapv",
]
}