Skip to content

Commit

Permalink
Reduce the number of exported symbols from the native lookup library
Browse files Browse the repository at this point in the history
  • Loading branch information
andrisaar committed Feb 13, 2024
1 parent 50cfd97 commit d589d7e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cc/native_sdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ cc_library(
cc_binary(
name = "key_value_lookup",
srcs = ["key_value_lookup.cc"],
linkopts = ["-Wl,--version-script,$(location symbols.map.ld)"],
linkshared = True,
deps = [
"symbols.map.ld",
":native_sdk",
"@com_google_absl//absl/log:check",
],
Expand Down
2 changes: 1 addition & 1 deletion cc/native_sdk/native_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// We call oak_main without arguments, and oak_main then calls read_request,
// processes the request, and then calls write_response. This makes the API
// compatible with Oak Functions.
#define OAK_MAIN void oak_main()
#define OAK_MAIN extern "C" void oak_main()

namespace oak::functions::sdk {

Expand Down
7 changes: 7 additions & 0 deletions cc/native_sdk/symbols.map.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
global:
register_callbacks;
oak_main;
local:
*;
};

0 comments on commit d589d7e

Please sign in to comment.