Skip to content

Add getFunction calls for endianness test function signatures#534

Open
leonm1 wants to merge 1 commit intoproxy-wasm:mainfrom
leonm1:fix/null-build
Open

Add getFunction calls for endianness test function signatures#534
leonm1 wants to merge 1 commit intoproxy-wasm:mainfrom
leonm1:fix/null-build

Conversation

@leonm1
Copy link
Copy Markdown
Contributor

@leonm1 leonm1 commented Mar 30, 2026

These missing functions (added through the new function call types in #525) result in the following linker error when compiling against NullVM:

ld: error: undefined symbol: proxy_wasm::NullPlugin::getFunction(std::__u::basic_string_view<char, std::__u::char_traits<char>>, std::__u::function<proxy_wasm::Word (proxy_wasm::ContextBase*, proxy_wasm::Word, unsigned long, float, double)>*)
>>> referenced by null_plugin.cc
>>>               blaze-out/k8-fastbuild/_objs/null_lib/null_plugin.pic.o:(vtable for proxy_wasm::NullPlugin)

ld: error: undefined symbol: proxy_wasm::NullPlugin::getFunction(std::__u::basic_string_view<char, std::__u::char_traits<char>>, std::__u::function<unsigned long (proxy_wasm::ContextBase*, float)>*)
>>> referenced by null_plugin.cc
>>>               blaze-out/k8-fastbuild/_objs/null_lib/null_plugin.pic.o:(vtable for proxy_wasm::NullPlugin)

ld: error: undefined symbol: proxy_wasm::NullPlugin::getFunction(std::__u::basic_string_view<char, std::__u::char_traits<char>>, std::__u::function<float (proxy_wasm::ContextBase*, float, float)>*)
>>> referenced by null_plugin.cc
>>>               blaze-out/k8-fastbuild/_objs/null_lib/null_plugin.pic.o:(vtable for proxy_wasm::NullPlugin)

ld: error: undefined symbol: proxy_wasm::NullPlugin::getFunction(std::__u::basic_string_view<char, std::__u::char_traits<char>>, std::__u::function<double (proxy_wasm::ContextBase*, float, float, float)>*)
>>> referenced by null_plugin.cc
>>>               blaze-out/k8-fastbuild/_objs/null_lib/null_plugin.pic.o:(vtable for proxy_wasm::NullPlugin)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@PiotrSikora
Copy link
Copy Markdown
Member

Could we figure out a test to fix / detect this in this repo? It's the reason for the majority of build errors.

@leonm1
Copy link
Copy Markdown
Contributor Author

leonm1 commented Mar 30, 2026

Could we figure out a test to fix / detect this in this repo? It's the reason for the majority of build errors.

I plan to do so.

}

void NullPlugin::getFunction(std::string_view function_name, WasmCall_lf *f) {
if (!wasm_vm_->integration()->getNullVmFunction(function_name, true, 1, this, f)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 2nd argument is returns_word, which clearly isn't the case here.

Also (and this I something I've missed while reviewing #525), the WasmCall_lf doesn't follow the existing convention of WasmCall<return_type>_<argument_types>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC these are all signatures added for cpp-host testing? Do we need to call getNullVmFunction in that case, or can we just log an error and clear the return pointer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also (and this I something I've missed while reviewing #525), the WasmCall_lf doesn't follow the existing convention of WasmCall<return_type>_<argument_types>.

The calls follow the convention used by WasmCallback, which was chosen since the return types needed more type flexibility than the WasmCallWord<> template provided, just like the WasmCallback types.

IIUC these are all signatures added for cpp-host testing? Do we need to call getNullVmFunction in that case, or can we just log an error and clear the return pointer?

Indeed, I have removed the implementations and changed these functions to log an error about unexpected function calls. These signatures are not part of the Proxy-Wasm spec.

Signed-off-by: Matt Leon <mattleon@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants