Only ask for WAMR-specific build options for WAMR builds

This commit is contained in:
2026-06-09 13:51:40 +02:00
parent c5c5172f65
commit 454a85043f
3 changed files with 40 additions and 27 deletions

View File

@ -57,14 +57,17 @@ my @allocator_variants = (
"Pool allocator (Alloc_With_Pool)",
"Allocator with usage (Alloc_With_Allocator)",
);
my ($selected_allocator_variant) =
TUI::select_from_list( "Select WAMR Allocator Variant",
0, @allocator_variants );
die "No allocator variant selected" unless $selected_allocator_variant;
local $ENV{WAMR_USE_ALLOCATOR} =
( $selected_allocator_variant eq $allocator_variants[0] )
? "false"
: "true";
my $selected_allocator_variant;
if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes ) {
($selected_allocator_variant) =
TUI::select_from_list( "Select WAMR Allocator Variant",
0, @allocator_variants );
die "No allocator variant selected" unless $selected_allocator_variant;
local $ENV{WAMR_USE_ALLOCATOR} =
( $selected_allocator_variant eq $allocator_variants[0] )
? "false"
: "true";
}
# ========================================================================================= #
# Select XIP variant
@ -90,13 +93,17 @@ my @mmap_variants = (
"Place mmap_space in .text.wamr_mmap",
"Let the linker decide where mmap_space is located"
);
my ($selected_mmap_variant) =
TUI::select_from_list( "Select WAMR Mmap.Text Variant", 0, @mmap_variants );
die "No variant selected" unless $selected_mmap_variant;
local $ENV{WAMR_USE_MMAP_IN_TEXT} =
( $selected_mmap_variant eq $mmap_variants[0] )
? "true"
: "false";
my $selected_mmap_variant;
if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes ) {
($selected_mmap_variant) =
TUI::select_from_list( "Select WAMR Mmap.Text Variant",
0, @mmap_variants );
die "No variant selected" unless $selected_mmap_variant;
local $ENV{WAMR_USE_MMAP_IN_TEXT} =
( $selected_mmap_variant eq $mmap_variants[0] )
? "true"
: "false";
}
# ========================================================================================= #
# Select .text.wamr_aot variant
@ -187,8 +194,12 @@ my %catch_flag_map = (
"--catch-outer" => "--catch-outerspace",
"--catch-text" => "--catch-write-textsegment",
);
my @selected_catch_tags =
TUI::select_from_list( "Select FAIL Flags", 1, sort keys %catch_flag_map );
my @selected_catch_flags;
if ( grep { $_ eq "fail" } @selected_targets ) {
@selected_catch_flags =
TUI::select_from_list( "Select FAIL Flags", 1,
sort keys %catch_flag_map );
}
# ========================================================================================= #
# Build everything
@ -200,11 +211,13 @@ foreach my $experiment (@selected_experiments) {
foreach my $target (@selected_targets) {
foreach my $mode (@selected_modes) {
my $allocator_info =
( ( $mode eq "aot" || $mode eq "interp" )
&& $selected_allocator_variant eq $allocator_variants[0] )
? "alloc_pool"
: "alloc_usage";
my $allocator_info = "";
if ( $mode eq "aot" || $mode eq "interp" ) {
$allocator_info =
$selected_allocator_variant eq $allocator_variants[0]
? "alloc_pool"
: "alloc_usage";
}
my $xip_info =
( $mode eq "aot"
&& $selected_xip_variant
@ -241,7 +254,7 @@ foreach my $experiment (@selected_experiments) {
&& $selected_linear_pool_variant eq $linear_pool_variants[0] )
? "wamr_linear_pool"
: "";
my $flags_info = join " ", @selected_catch_tags;
my $flags_info = join " ", @selected_catch_flags;
my $info_str = join " ",
grep { length } (
@ -262,7 +275,7 @@ foreach my $experiment (@selected_experiments) {
"$local_root/build-$experiment/runner_flags";
open( my $fhandle, '>', $runner_flags_path )
or die "Cannot write $runner_flags_path: $!";
print $fhandle "$catch_flag_map{$_}\n" for @selected_catch_tags;
print $fhandle "$catch_flag_map{$_}\n" for @selected_catch_flags;
close($fhandle);
system(

View File

@ -152,9 +152,9 @@ sub build {
rmtree($bd);
make_path($bd);
copy_auxiliary( $module, $bd );
build_libiwasm( $module, $bd, $target );
if ( $mode eq 'aot' || $mode eq 'interp' ) {
build_libiwasm( $module, $bd, $target );
compile_wasm_module( $module, $bd );
if ( $mode eq 'aot' ) {
compile_wasm_aot( $module, $bd, $target );

View File

@ -180,8 +180,8 @@ sub import_trace {
"$fail_prune", "--database-option-file $remote_db_conf",
"-v $experiment", "-b %%",
#'-p NoPruner',
'-p BasicPruner',
'-p NoPruner',
# '-p BasicPruner',
"--overwrite", ">$remote_builds_dir/$experiment/2_prune.log 2>&1"
);
say "Prune command: $prune_command";