After this morning's discussion, I've thought I would have another go at updating roc-tui to use the latest glue. I managed to get much further than previously here is the working branch.
Just had a question about what might be causing the below errors? I haven't changed my roc.rs
which is where all of the extern C functions were defined.
% roc run examples/hello.roc
Undefined symbols for architecture arm64:
"_roc__programForHost_1__Init_caller", referenced from:
__ZN4host3roc15init_and_render17h36fb0f8a51b4df54E in macos-arm64.o
"_roc__programForHost_1__Init_result_size", referenced from:
__ZN4host3roc15init_and_render17h36fb0f8a51b4df54E in macos-arm64.o
"_roc__programForHost_1__Init_size", referenced from:
__ZN4host3roc15init_and_render17h36fb0f8a51b4df54E in macos-arm64.o
"_roc__programForHost_1__Render_caller", referenced from:
__ZN4host3roc15init_and_render17h36fb0f8a51b4df54E in macos-arm64.o
__ZN4host3roc17update_and_render17h5f70680c13fdb020E in macos-arm64.o
"_roc__programForHost_1__Render_size", referenced from:
__ZN4host3roc15init_and_render17h36fb0f8a51b4df54E in macos-arm64.o
__ZN4host3roc17update_and_render17h5f70680c13fdb020E in macos-arm64.o
"_roc__programForHost_1__Update_caller", referenced from:
__ZN4host3roc6update17h5ffdde404467b89aE in macos-arm64.o
__ZN4host3roc17update_and_render17h5f70680c13fdb020E in macos-arm64.o
"_roc__programForHost_1__Update_result_size", referenced from:
__ZN4host3roc6update17h5ffdde404467b89aE in macos-arm64.o
__ZN4host3roc17update_and_render17h5f70680c13fdb020E in macos-arm64.o
"_roc__programForHost_1__Update_size", referenced from:
__ZN4host3roc6update17h5ffdde404467b89aE in macos-arm64.o
__ZN4host3roc17update_and_render17h5f70680c13fdb020E in macos-arm64.o
ld: symbol(s) not found for architecture arm64
examples/example-app: is already signed
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1014:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm not super confident with my Rust here; if this line of effort is useful for glue development I'm happy to support with experimenting with roc-tui
here as an example platform. I'm just not sure if this is an issue with glue or I'm doing something silly with Rust.
Oh, I think the name of all those functions slightly change with one of folkerts prs
Maybe the _1
was removed.
Don't exactly remember.
If you can look at the symbols exposed by the roc object file generated by --no-link
, that should show you the correct names.
These changes may also be helpful
Thank you @Anton and @Brendan Hansknecht, I'm not confident I can make this change. Do you know if the plan is to have glue generate these functions also?
For reference these are the symbols I am seeing, but not sure how to match them up to the Init, Update, and Render parts of my programForHost.
0000000000000e18 T _roc__programForHost_0_caller
0000000000000e5c T _roc__programForHost_0_result_size
0000000000000e6c T _roc__programForHost_0_size
0000000000000dc4 T _roc__programForHost_1_caller
00000000000002c4 T _roc__programForHost_1_exposed
00000000000002b4 T _roc__programForHost_1_exposed_generic
00000000000002d4 T _roc__programForHost_1_exposed_size
0000000000000e00 T _roc__programForHost_1_result_size
0000000000000e10 T _roc__programForHost_1_size
0000000000000e74 T _roc__programForHost_2_caller
0000000000000eb8 T _roc__programForHost_2_result_size
0000000000000ec8 T _roc__programForHost_2_size
Oh, interesting. Looks like we totally Lost the names
Yeah, that is not great
And yeah, long term glue should generate these.
Probably should be able now, but maybe just isn't enabled
Last updated: Jul 06 2025 at 12:14 UTC