| # 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. |
| |
| library("jitterentropy") { |
| kernel = true |
| sources = [ |
| "jitterentropy-base.c", |
| ] |
| include_dirs = [ "arch/$zircon_cpu" ] |
| |
| # 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:opt_level" ] |
| configs += [ ":config" ] |
| } |
| |
| config("config") { |
| visibility = [ ":*" ] |
| cflags = [ |
| "-O0", |
| |
| # The original Makefile also specifies -fwrapv. |
| "-fwrapv", |
| ] |
| } |