Skip to content

Commit

Permalink
Cherry pick PR #4007: Build BoringSSL test tool (#4008)
Browse files Browse the repository at this point in the history
Refer to the original PR: #4007

Adds GN code to always build BoringSSL test tool

b/360241262
  • Loading branch information
kaidokert authored Aug 22, 2024
1 parent 0845058 commit 483ae68
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
27 changes: 27 additions & 0 deletions third_party/boringssl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,30 @@ static_library("crypto_full") {
configs += [ "//starboard/build/config:speed" ]
}
}

if (is_starboard) {
target(final_executable_type, "boringssl_tool") {
testonly = true
sources = [
"src/tool/args.cc",
"src/tool/ciphers.cc",
"src/tool/const.cc",
"src/tool/digest.cc",
"src/tool/file.cc",
"src/tool/generate_ed25519.cc",
"src/tool/genrsa.cc",
"src/tool/internal.h",
"src/tool/pkcs12.cc",
"src/tool/rand.cc",
"src/tool/sign.cc",
"src/tool/speed.cc",
"src/tool/tool.cc",
"src/tool/transport_common.cc",
"src/tool/transport_common.h",
]
deps = [
":crypto",
"//starboard:starboard_group",
]
}
}
1 change: 1 addition & 0 deletions third_party/boringssl/src/tool/tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#ifdef STARBOARD
#include <starboard/client_porting/wrap_main/wrap_main.h>
#define OPENSSL_NO_SOCK // avoid linking errors
#endif

#if defined(OPENSSL_WINDOWS)
Expand Down
4 changes: 3 additions & 1 deletion third_party/boringssl/src/tool/transport_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <ws2tcpip.h>
OPENSSL_MSVC_PRAGMA(warning(pop))

#ifndef STARBOARD
typedef int ssize_t;
#endif
OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib"))
#endif

Expand Down Expand Up @@ -214,7 +216,7 @@ bool Listener::Init(const std::string &port) {
// Windows' IN6ADDR_ANY_INIT does not have enough curly braces for clang-cl
// (https://crbug.com/772108), while other platforms like NaCl are missing
// in6addr_any, so use a mix of both.
#if defined(OPENSSL_WINDOWS)
#if defined(OPENSSL_WINDOWS) && !defined(STARBOARD)
addr.sin6_addr = in6addr_any;
#else
addr.sin6_addr = IN6ADDR_ANY_INIT;
Expand Down

0 comments on commit 483ae68

Please sign in to comment.