blob: 0203bccf4d26a0259c1c55a3a80fa5fac692fe5b [file] [log] [blame]
// Note that some host libraries have the same module name as the target
// libraries. This is currently needed to build, for example, adb. But it's
// probably something that should be changed.
// Pull in the autogenerated sources modules
build = ["sources.bp"]
// Used by libcrypto, libssl, bssl tool, and native tests
cc_defaults {
name: "boringssl_flags",
cflags: [
"-fvisibility=hidden",
"-DBORINGSSL_SHARED_LIBRARY",
"-DBORINGSSL_IMPLEMENTATION",
"-DOPENSSL_SMALL",
"-D_XOPEN_SOURCE=700",
"-Wno-unused-parameter",
],
cppflags: [
"-Wall",
"-Werror",
],
conlyflags: ["-std=c99"],
}
// Used by libcrypto + libssl
cc_defaults {
name: "boringssl_defaults",
local_include_dirs: ["src/include"],
export_include_dirs: ["src/include"],
stl: "libc++_static",
sdk_version: "9",
cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
}
//// libcrypto
// This should be removed when clang can compile everything.
libcrypto_sources_no_clang = [
"linux-arm/crypto/aes/aes-armv4.S",
"linux-arm/crypto/aes/bsaes-armv7.S",
]
cc_defaults {
name: "libcrypto_defaults",
host_supported: true,
// Windows and Macs both have problems with assembly files
target: {
windows: {
enabled: true,
cflags: ["-DOPENSSL_NO_ASM"],
host_ldlibs: ["-lws2_32"],
},
darwin: {
cflags: ["-DOPENSSL_NO_ASM"],
},
host: {
host_ldlibs: ["-lpthread"],
},
},
local_include_dirs: ["src/crypto"],
arch: {
arm64: {
clang_asflags: ["-march=armv8-a+crypto"],
},
},
// This should be removed when clang can compile everything.
exclude_srcs: libcrypto_sources_no_clang,
whole_static_libs: ["libcrypto_no_clang"],
}
// Target and host library
cc_library {
name: "libcrypto",
defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
unique_host_soname: true,
}
// Target and host library: files that don't compile with clang. This should
// go away when clang can compile everything with integrated assembler.
cc_library_static {
name: "libcrypto_no_clang",
defaults: ["boringssl_defaults", "boringssl_flags"],
host_supported: true,
target: {
windows: {
enabled: true,
},
},
local_include_dirs: ["src/crypto"],
arch: {
arm: {
clang_asflags: ["-no-integrated-as"],
srcs: libcrypto_sources_no_clang,
},
},
}
// Static library
// This should only be used for host modules that will be in a JVM, all other
// modules should use the static variant of libcrypto.
cc_library_static {
name: "libcrypto_static",
defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
target: {
host: {
// TODO: b/26160319. ASAN breaks use of this library in JVM.
// Re-enable sanitization when the issue with making clients of this library
// preload ASAN runtime is resolved. Without that, clients are getting runtime
// errors due to unresolved ASAN symbols, such as
// __asan_option_detect_stack_use_after_return.
sanitize: {
never: true,
},
},
},
}
//// libssl
// Target static library
// Deprecated: all users should move to libssl
cc_library_static {
name: "libssl_static",
defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
}
// Static and Shared library
cc_library {
name: "libssl",
host_supported: true,
defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
unique_host_soname: true,
shared_libs: ["libcrypto"],
}
// Host static library
cc_library_host_static {
name: "libssl_static-host",
defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
// TODO: b/26160319. ASAN breaks use of this library in JVM.
// Re-enable sanitization when the issue with making clients of this library
// preload ASAN runtime is resolved. Without that, clients are getting runtime
// errors due to unresolved ASAN symbols, such as
// __asan_option_detect_stack_use_after_return.
sanitize: {
never: true,
},
}
// Tool
cc_binary {
name: "bssl",
host_supported: true,
defaults: ["bssl_sources", "boringssl_flags"],
shared_libs: [
"libcrypto",
"libssl",
],
target: {
host: {
// Needed for clock_gettime.
host_ldlibs: ["-lrt"],
},
darwin: {
enabled: false,
},
},
}
// Test support library
cc_library_static {
name: "boringssl_test_support",
host_supported: true,
defaults: ["boringssl_test_support_sources", "boringssl_flags"],
shared_libs: [
"libcrypto",
"libssl",
],
}
// Tests
cc_test {
name: "boringssl_tests",
host_supported: true,
test_per_src: true,
defaults: ["boringssl_tests_sources", "boringssl_flags"],
whole_static_libs: ["boringssl_test_support"],
shared_libs: [
"libcrypto",
"libssl",
],
}
cc_test {
name: "boringssl_crypto_test",
host_supported: true,
defaults: ["boringssl_crypto_test_sources", "boringssl_flags"],
whole_static_libs: ["boringssl_test_support"],
cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
shared_libs: ["libcrypto"],
}
cc_test {
name: "boringssl_ssl_test",
host_supported: true,
defaults: ["boringssl_ssl_test_sources", "boringssl_flags"],
whole_static_libs: ["boringssl_test_support"],
cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
shared_libs: ["libcrypto", "libssl"],
}