// 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", vendor_available: true, 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/fipsmodule/aes-armv4.S", "linux-arm/crypto/fipsmodule/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", vendor_available: true, vndk: { enabled: true, }, 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"], cflags: ["-DOPENSSL_NO_CXX"], 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", vendor_available: true, vndk: { enabled: true, }, host_supported: true, defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"], unique_host_soname: true, shared_libs: ["libcrypto"], } // 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_crypto_test", test_suites: ["device-tests"], 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", test_suites: ["device-tests"], host_supported: true, defaults: ["boringssl_ssl_test_sources", "boringssl_flags"], whole_static_libs: ["boringssl_test_support"], cflags: ["-DBORINGSSL_ANDROID_SYSTEM"], shared_libs: ["libcrypto", "libssl"], }