Only ask for WAMR-specific build options for WAMR builds
This commit is contained in:
@ -57,14 +57,17 @@ my @allocator_variants = (
|
|||||||
"Pool allocator (Alloc_With_Pool)",
|
"Pool allocator (Alloc_With_Pool)",
|
||||||
"Allocator with usage (Alloc_With_Allocator)",
|
"Allocator with usage (Alloc_With_Allocator)",
|
||||||
);
|
);
|
||||||
my ($selected_allocator_variant) =
|
my $selected_allocator_variant;
|
||||||
TUI::select_from_list( "Select WAMR Allocator Variant",
|
if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes ) {
|
||||||
0, @allocator_variants );
|
($selected_allocator_variant) =
|
||||||
die "No allocator variant selected" unless $selected_allocator_variant;
|
TUI::select_from_list( "Select WAMR Allocator Variant",
|
||||||
local $ENV{WAMR_USE_ALLOCATOR} =
|
0, @allocator_variants );
|
||||||
( $selected_allocator_variant eq $allocator_variants[0] )
|
die "No allocator variant selected" unless $selected_allocator_variant;
|
||||||
? "false"
|
local $ENV{WAMR_USE_ALLOCATOR} =
|
||||||
: "true";
|
( $selected_allocator_variant eq $allocator_variants[0] )
|
||||||
|
? "false"
|
||||||
|
: "true";
|
||||||
|
}
|
||||||
|
|
||||||
# ========================================================================================= #
|
# ========================================================================================= #
|
||||||
# Select XIP variant
|
# Select XIP variant
|
||||||
@ -90,13 +93,17 @@ my @mmap_variants = (
|
|||||||
"Place mmap_space in .text.wamr_mmap",
|
"Place mmap_space in .text.wamr_mmap",
|
||||||
"Let the linker decide where mmap_space is located"
|
"Let the linker decide where mmap_space is located"
|
||||||
);
|
);
|
||||||
my ($selected_mmap_variant) =
|
my $selected_mmap_variant;
|
||||||
TUI::select_from_list( "Select WAMR Mmap.Text Variant", 0, @mmap_variants );
|
if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes ) {
|
||||||
die "No variant selected" unless $selected_mmap_variant;
|
($selected_mmap_variant) =
|
||||||
local $ENV{WAMR_USE_MMAP_IN_TEXT} =
|
TUI::select_from_list( "Select WAMR Mmap.Text Variant",
|
||||||
( $selected_mmap_variant eq $mmap_variants[0] )
|
0, @mmap_variants );
|
||||||
? "true"
|
die "No variant selected" unless $selected_mmap_variant;
|
||||||
: "false";
|
local $ENV{WAMR_USE_MMAP_IN_TEXT} =
|
||||||
|
( $selected_mmap_variant eq $mmap_variants[0] )
|
||||||
|
? "true"
|
||||||
|
: "false";
|
||||||
|
}
|
||||||
|
|
||||||
# ========================================================================================= #
|
# ========================================================================================= #
|
||||||
# Select .text.wamr_aot variant
|
# Select .text.wamr_aot variant
|
||||||
@ -187,8 +194,12 @@ my %catch_flag_map = (
|
|||||||
"--catch-outer" => "--catch-outerspace",
|
"--catch-outer" => "--catch-outerspace",
|
||||||
"--catch-text" => "--catch-write-textsegment",
|
"--catch-text" => "--catch-write-textsegment",
|
||||||
);
|
);
|
||||||
my @selected_catch_tags =
|
my @selected_catch_flags;
|
||||||
TUI::select_from_list( "Select FAIL Flags", 1, sort keys %catch_flag_map );
|
if ( grep { $_ eq "fail" } @selected_targets ) {
|
||||||
|
@selected_catch_flags =
|
||||||
|
TUI::select_from_list( "Select FAIL Flags", 1,
|
||||||
|
sort keys %catch_flag_map );
|
||||||
|
}
|
||||||
|
|
||||||
# ========================================================================================= #
|
# ========================================================================================= #
|
||||||
# Build everything
|
# Build everything
|
||||||
@ -200,11 +211,13 @@ foreach my $experiment (@selected_experiments) {
|
|||||||
foreach my $target (@selected_targets) {
|
foreach my $target (@selected_targets) {
|
||||||
foreach my $mode (@selected_modes) {
|
foreach my $mode (@selected_modes) {
|
||||||
|
|
||||||
my $allocator_info =
|
my $allocator_info = "";
|
||||||
( ( $mode eq "aot" || $mode eq "interp" )
|
if ( $mode eq "aot" || $mode eq "interp" ) {
|
||||||
&& $selected_allocator_variant eq $allocator_variants[0] )
|
$allocator_info =
|
||||||
? "alloc_pool"
|
$selected_allocator_variant eq $allocator_variants[0]
|
||||||
: "alloc_usage";
|
? "alloc_pool"
|
||||||
|
: "alloc_usage";
|
||||||
|
}
|
||||||
my $xip_info =
|
my $xip_info =
|
||||||
( $mode eq "aot"
|
( $mode eq "aot"
|
||||||
&& $selected_xip_variant
|
&& $selected_xip_variant
|
||||||
@ -241,7 +254,7 @@ foreach my $experiment (@selected_experiments) {
|
|||||||
&& $selected_linear_pool_variant eq $linear_pool_variants[0] )
|
&& $selected_linear_pool_variant eq $linear_pool_variants[0] )
|
||||||
? "wamr_linear_pool"
|
? "wamr_linear_pool"
|
||||||
: "";
|
: "";
|
||||||
my $flags_info = join " ", @selected_catch_tags;
|
my $flags_info = join " ", @selected_catch_flags;
|
||||||
|
|
||||||
my $info_str = join " ",
|
my $info_str = join " ",
|
||||||
grep { length } (
|
grep { length } (
|
||||||
@ -262,7 +275,7 @@ foreach my $experiment (@selected_experiments) {
|
|||||||
"$local_root/build-$experiment/runner_flags";
|
"$local_root/build-$experiment/runner_flags";
|
||||||
open( my $fhandle, '>', $runner_flags_path )
|
open( my $fhandle, '>', $runner_flags_path )
|
||||||
or die "Cannot write $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);
|
close($fhandle);
|
||||||
|
|
||||||
system(
|
system(
|
||||||
|
|||||||
@ -152,9 +152,9 @@ sub build {
|
|||||||
rmtree($bd);
|
rmtree($bd);
|
||||||
make_path($bd);
|
make_path($bd);
|
||||||
copy_auxiliary( $module, $bd );
|
copy_auxiliary( $module, $bd );
|
||||||
build_libiwasm( $module, $bd, $target );
|
|
||||||
|
|
||||||
if ( $mode eq 'aot' || $mode eq 'interp' ) {
|
if ( $mode eq 'aot' || $mode eq 'interp' ) {
|
||||||
|
build_libiwasm( $module, $bd, $target );
|
||||||
compile_wasm_module( $module, $bd );
|
compile_wasm_module( $module, $bd );
|
||||||
if ( $mode eq 'aot' ) {
|
if ( $mode eq 'aot' ) {
|
||||||
compile_wasm_aot( $module, $bd, $target );
|
compile_wasm_aot( $module, $bd, $target );
|
||||||
|
|||||||
@ -180,8 +180,8 @@ sub import_trace {
|
|||||||
"$fail_prune", "--database-option-file $remote_db_conf",
|
"$fail_prune", "--database-option-file $remote_db_conf",
|
||||||
"-v $experiment", "-b %%",
|
"-v $experiment", "-b %%",
|
||||||
|
|
||||||
#'-p NoPruner',
|
'-p NoPruner',
|
||||||
'-p BasicPruner',
|
# '-p BasicPruner',
|
||||||
"--overwrite", ">$remote_builds_dir/$experiment/2_prune.log 2>&1"
|
"--overwrite", ">$remote_builds_dir/$experiment/2_prune.log 2>&1"
|
||||||
);
|
);
|
||||||
say "Prune command: $prune_command";
|
say "Prune command: $prune_command";
|
||||||
|
|||||||
Reference in New Issue
Block a user