import native symbols in lib.h

lib.h gets included into the host module and the wasm module. For the
host module the attributes will be ignored.
This commit is contained in:
2026-04-24 10:45:55 +02:00
parent 348aac20ae
commit 5aab319424
4 changed files with 18 additions and 15 deletions

View File

@ -198,10 +198,10 @@ sub read_experiment_info {
open( my $fhandle, '<', "$local_archive_dir/$exp/0.info" ) open( my $fhandle, '<', "$local_archive_dir/$exp/0.info" )
or die "Failed to open 0.info: $!"; or die "Failed to open 0.info: $!";
my $info = <$fhandle>; my $info = <$fhandle>;
chomp $info; chomp $info if defined $info;
close($fhandle); close($fhandle);
return $info; return defined $info ? $info : "";
} }
sub read_marker_info { sub read_marker_info {
@ -251,7 +251,9 @@ sub select_experiment {
my $info = read_experiment_info($exp); my $info = read_experiment_info($exp);
push @exp_with_notes, push @exp_with_notes,
defined $info ? sprintf( "%-50s (Note: %s)", $exp, $info ) : $exp; ( defined $info && length($info) > 0 )
? sprintf( "%-50s (Note: %s)", $exp, $info )
: $exp;
} }
my @selected_experiments = my @selected_experiments =

View File

@ -433,11 +433,8 @@ my %handlers = (
'98. Delete Archived Experiments' => sub { '98. Delete Archived Experiments' => sub {
# Delete archived experiments # Delete archived experiments
my @experiments = Util::find_subdirs($local_archive_dir); my @selected_experiments = Util::select_experiment(1);
my @selected_experiments =
TUI::select_from_list( "Select Archived Experiments to Delete",
1, @experiments );
die "No experiment selected" unless @selected_experiments;
system( 'rm', '-rf', "$local_archive_dir/$_" ) system( 'rm', '-rf', "$local_archive_dir/$_" )
for @selected_experiments; for @selected_experiments;
}, },

View File

@ -15,7 +15,6 @@ WASI_CFLAGS := "\
-Wl,--initial-memory=65536 \ -Wl,--initial-memory=65536 \
-Wl,--export=__heap_base \ -Wl,--export=__heap_base \
-Wl,--export=__data_end \ -Wl,--export=__data_end \
-Wl,--allow-undefined \
" "
CROSS_CFLAGS_NOWASM := "\ CROSS_CFLAGS_NOWASM := "\
-O0 \ -O0 \

View File

@ -60,12 +60,17 @@ extern "C" {
#endif #endif
// Those functions are defined in the host program // Those functions are defined in the host program
void NOINLINE fail_start_trace(void); // Mark start of injection void NOINLINE IMPORT("fail_start_trace")
void NOINLINE fail_stop_trace(void); // Mark end of injection fail_start_trace(void); // Mark start of injection
void NOINLINE fail_marker_positive(void); // Everything ok void NOINLINE IMPORT("fail_stop_trace")
void NOINLINE fail_marker_detected(void); // Everything ok fail_stop_trace(void); // Mark end of injection
void NOINLINE fail_marker_negative(void); // Invalid code void NOINLINE IMPORT("fail_marker_positive")
void NOINLINE print(const char *msg); fail_marker_positive(void); // Everything ok
void NOINLINE IMPORT("fail_marker_detected")
fail_marker_detected(void); // Everything ok
void NOINLINE IMPORT("fail_marker_negative")
fail_marker_negative(void); // Invalid code
void NOINLINE IMPORT("print") print(const char *msg);
#ifdef __cplusplus #ifdef __cplusplus
} }