File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,5 @@ bindgen/legacy/%.o: $(srcdir)/bindgen/legacy/%.c
14
14
15
15
bindgen/ext.o: $(srcdir)/bindgen/ext.c
16
16
@mkdir -p "$(@D)"
17
- $(CC) -c -o $@ $<
17
+ $(ECHO) compiling $(<)
18
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
Original file line number Diff line number Diff line change 19
19
$objs << "bindgen/legacy/rb-js-abi-host.o"
20
20
$objs << "bindgen/legacy/rb-abi-guest.o"
21
21
end
22
+
23
+ component_type_obj = "$(srcdir)/bindgen/ext_component_type.o"
24
+
25
+ unless $static
26
+ # When building shared library, we need to link the component type object
27
+ # to the shared library instead of the main ruby executable.
28
+ $libs << component_type_obj
29
+ end
30
+
22
31
create_makefile ( "js" ) do |mk |
23
- mk << "EXTRA_OBJS = $(srcdir)/bindgen/ext_component_type.o \n " if use_component_model
32
+ mk << "EXTRA_OBJS = #{ component_type_obj } \n " if use_component_model
24
33
mk
25
34
end
Original file line number Diff line number Diff line change @@ -363,10 +363,15 @@ static inline void __wasm_call_ctors_if_needed(void) {
363
363
__wasm_call_ctors_done = true;
364
364
__wasm_call_ctors ();
365
365
366
+ // Initialize VFS runtime if it's used
367
+ // NOTE: We don't use wasi-vfs for PIC build. Instead, we use
368
+ // Component Model-native wasi-virt.
369
+ # ifndef __PIC__
366
370
__attribute__((weak )) extern void __wasi_vfs_rt_init (void );
367
371
if (__wasi_vfs_rt_init ) {
368
372
__wasi_vfs_rt_init ();
369
373
}
374
+ # endif
370
375
}
371
376
}
372
377
You can’t perform that action at this time.
0 commit comments