| # Copyright 2019 The Fuchsia Authors |
| # |
| # Use of this source code is governed by a MIT-style |
| # license that can be found in the LICENSE file or at |
| # https://opensource.org/licenses/MIT |
| |
| source_set("boringssl") { |
| visibility = [ "../*" ] |
| |
| public = [ |
| "//third_party/boringssl/src/include/openssl/base.h", |
| "//third_party/boringssl/src/include/openssl/chacha.h", |
| "//third_party/boringssl/src/include/openssl/sha.h", |
| ] |
| public_configs = [ ":config" ] |
| sources = [ |
| "//third_party/boringssl/src/crypto/chacha/chacha.c", |
| "//third_party/boringssl/src/crypto/fipsmodule/sha/sha256.c", |
| "zircon-mem.c", |
| ] |
| |
| # This gets the main source's include_dirs and cflags for warnings. |
| configs += [ "//third_party/boringssl:boringssl_config" ] |
| |
| deps = [ "//zircon/kernel/lib/libc" ] |
| } |
| |
| config("config") { |
| visibility = [ ":*" ] |
| |
| defines = [ |
| "BORINGSSL_NO_CXX", |
| |
| # The assembly code uses vector registers, which is not allowed in |
| # kernel code. |
| "OPENSSL_NO_ASM", |
| "OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED", |
| ] |
| |
| # Zircon code that depends on BoringSSL should have a |
| # "#define BORINGSSL_NO_CXX" statement before any "#include <openssl/...>" |
| # statements to avoid pulling in C++ headers. |
| include_dirs = [ |
| "//third_party/boringssl/src/include", |
| ".", |
| ] |
| |
| if (is_gcc) { |
| # Some of the boringssl code plays fast and loose with array sizes in the |
| # type system, but is actually safe at runtime. |
| cflags = [ "-Wno-stringop-overflow" ] |
| } |
| } |