Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 1 addition & 137 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,146 +15,10 @@
################################################################################
#
def boringssl_repositories(bind=True):
# TODO(zlizan): Remove the custom BUILD file when
# https://github.com/lyft/envoy/issues/301 resolved
BUILD = """
# Copyright (c) 2016, Google Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

licenses(["notice"])

exports_files(["LICENSE"])

load(
":BUILD.generated.bzl",
"crypto_headers",
"crypto_internal_headers",
"crypto_sources",
"crypto_sources_linux_x86_64",
"crypto_sources_mac_x86_64",
"ssl_headers",
"ssl_internal_headers",
"ssl_sources",
"tool_sources",
"tool_headers",
)

config_setting(
name = "linux_x86_64",
values = {"cpu": "k8"},
)

config_setting(
name = "mac_x86_64",
values = {"cpu": "darwin"},
)

boringssl_copts = [
# Assembler option --noexecstack adds .note.GNU-stack to each object to
# ensure that binaries can be built with non-executable stack.
"-Wa,--noexecstack",

# This is needed on Linux systems (at least) to get rwlock in pthread.
"-D_XOPEN_SOURCE=700",

# This list of warnings should match those in the top-level CMakeLists.txt.
"-Wall",
"-Werror",
"-Wformat=2",
"-Wsign-compare",
"-Wmissing-field-initializers",
"-Wwrite-strings",
"-Wshadow",
"-fno-common",

# Modern build environments should be able to set this to use atomic
# operations for reference counting rather than locks. However, it's
# known not to work on some Android builds.
# "-DOPENSSL_C11_ATOMIC",
] + select({
":linux_x86_64": [],
":mac_x86_64": [],
"//conditions:default": ["-DOPENSSL_NO_ASM"],
})

crypto_sources_asm = select({
":linux_x86_64": crypto_sources_linux_x86_64,
":mac_x86_64": crypto_sources_mac_x86_64,
"//conditions:default": [],
})

# For C targets only (not C++), compile with C11 support.
boringssl_copts_c11 = boringssl_copts + [
"-std=c11",
"-Wmissing-prototypes",
"-Wold-style-definition",
"-Wstrict-prototypes",
]

# For C targets only (not C++), compile with C11 support.
boringssl_copts_cxx = boringssl_copts + [
"-std=c++11",
"-Wmissing-declarations",
]

cc_library(
name = "crypto",
srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm,
hdrs = crypto_headers,
copts = boringssl_copts_c11,
includes = ["src/include"],
linkopts = select({
":mac_x86_64": [],
"//conditions:default": ["-lpthread"],
}),
visibility = ["//visibility:public"],
)

cc_library(
name = "ssl",
srcs = ssl_sources + ssl_internal_headers,
hdrs = ssl_headers,
copts = boringssl_copts_c11,
includes = ["src/include"],
visibility = ["//visibility:public"],
deps = [":crypto"],
)

cc_binary(
name = "bssl",
srcs = tool_sources + tool_headers,
copts = boringssl_copts_cxx,
visibility = ["//visibility:public"],
deps = [":ssl"],
)

cc_library(
name = "deprecit_base64_bio",
srcs = [
"src/decrepit/bio/base64_bio.c",
],
copts = boringssl_copts_c11,
includes = ["src/include"],
visibility = ["//visibility:public"],
deps = [":crypto"],
)"""

native.new_git_repository(
native.git_repository(
name = "boringssl",
commit = "12c35d69008ae6b8486e435447445240509f7662", # 2016-10-24
remote = "https://boringssl.googlesource.com/boringssl",
build_file_content = BUILD,
)

if bind:
Expand Down
3 changes: 1 addition & 2 deletions src/envoy/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ cc_library(
deps = [
":envoy-ratelimit-pb",
"//external:libssl",
"@boringssl//:deprecit_base64_bio",
"//external:nghttp2",
"//external:spdlog",
"//external:tclap",
Expand Down Expand Up @@ -630,6 +629,6 @@ cc_test(
native.new_git_repository(
name = "envoy_git",
remote = "https://github.com/lyft/envoy.git",
commit = "b74cabb4cba3366ee79ca187715f16db28baf6d3", # 2016-12-19
commit = "6b1336a786ebe56c45a1a349ddf706e0526c1ec1", # 2017-01-03
build_file_content = BUILD,
)