15
15
* You should have received a copy of the GNU Lesser General Public License
16
16
* along with crun. If not, see <http://www.gnu.org/licenses/>.
17
17
*/
18
- #include <wasmtime/store.h>
19
18
#define _GNU_SOURCE
20
19
21
20
#include <config.h>
@@ -342,11 +341,6 @@ libwasmtime_run_component (void *cookie, char *const argv[], wasm_engine_t *engi
342
341
wasmtime_context_t * context ,
343
342
const wasmtime_component_t * component ,
344
343
wasmtime_component_instance_t * instance_out );
345
- wasmtime_component_export_index_t * (* wasmtime_component_get_export_index ) (
346
- wasmtime_component_t * component ,
347
- wasmtime_component_export_index_t * index ,
348
- const char * name ,
349
- size_t name_len );
350
344
wasmtime_component_export_index_t * (* wasmtime_component_instance_get_export_index ) (
351
345
const wasmtime_component_instance_t * instance ,
352
346
wasmtime_context_t * context ,
@@ -385,7 +379,6 @@ libwasmtime_run_component (void *cookie, char *const argv[], wasm_engine_t *engi
385
379
wasmtime_component_linker_new = dlsym (cookie , "wasmtime_component_linker_new" );
386
380
wasmtime_component_linker_add_wasip2 = dlsym (cookie , "wasmtime_component_linker_add_wasip2" );
387
381
wasmtime_component_linker_instantiate = dlsym (cookie , "wasmtime_component_linker_instantiate" );
388
- wasmtime_component_get_export_index = dlsym (cookie , "wasmtime_component_get_export_index" );
389
382
wasmtime_component_instance_get_export_index = dlsym (cookie , "wasmtime_component_instance_get_export_index" );
390
383
wasmtime_component_instance_get_func = dlsym (cookie , "wasmtime_component_instance_get_func" );
391
384
wasmtime_component_func_call = dlsym (cookie , "wasmtime_component_func_call" );
@@ -395,6 +388,17 @@ libwasmtime_run_component (void *cookie, char *const argv[], wasm_engine_t *engi
395
388
wasmtime_error_message = dlsym (cookie , "wasmtime_error_message" );
396
389
wasmtime_error_delete = dlsym (cookie , "wasmtime_error_delete" );
397
390
391
+ if (wasm_engine_delete == NULL || wasm_byte_vec_delete == NULL || wasmtime_store_new == NULL
392
+ || wasmtime_store_delete == NULL || wasmtime_store_context == NULL || wasmtime_component_new == NULL
393
+ || wasmtime_wasip2_config_new == NULL || wasmtime_wasip2_config_inherit_stdin == NULL
394
+ || wasmtime_wasip2_config_inherit_stdout == NULL || wasmtime_wasip2_config_inherit_stderr == NULL
395
+ || wasmtime_context_set_wasip2 == NULL || wasmtime_component_linker_new == NULL || wasmtime_component_linker_add_wasip2 == NULL
396
+ || wasmtime_component_linker_instantiate == NULL || wasmtime_component_instance_get_export_index == NULL
397
+ || wasmtime_component_instance_get_func == NULL || wasmtime_component_func_call == NULL || wasmtime_component_export_index_delete == NULL
398
+ || wasmtime_component_delete == NULL || wasmtime_component_linker_delete == NULL || wasmtime_error_message == NULL
399
+ || wasmtime_error_delete == NULL )
400
+ error (EXIT_FAILURE , 0 , "could not find symbol in `libwasmtime.so`" );
401
+
398
402
// Set up wasmtime context
399
403
wasmtime_store_t * store = wasmtime_store_new (engine , NULL , NULL );
400
404
assert (store != NULL );
0 commit comments