Skip to content
Permalink
Browse files
set-webkit-configuration should print current settings
<https://webkit.org/b/224190>

Reviewed by Mark Lam.

* Scripts/set-webkit-configuration:
- Reorder switches to put sanitizers together.
- Declare subroutines.
- Call printCurrentSettings() or printUsage() as needed.
(printCurrentSettings): Add.
(printUsage): Add.
* Scripts/webkitdirs.pm:
- Reorder switch variables to match other code.
(coverageIsEnabled): Add for set-webkit-configuration.


Canonical link: https://commits.webkit.org/236190@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
David Kilzer committed Apr 6, 2021
1 parent 94189ea commit 383e57b8b15ec9981c433add4f8788b274465f41
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 8 deletions.
@@ -1,3 +1,20 @@
2021-04-06 David Kilzer <ddkilzer@apple.com>

set-webkit-configuration should print current settings
<https://webkit.org/b/224190>

Reviewed by Mark Lam.

* Scripts/set-webkit-configuration:
- Reorder switches to put sanitizers together.
- Declare subroutines.
- Call printCurrentSettings() or printUsage() as needed.
(printCurrentSettings): Add.
(printUsage): Add.
* Scripts/webkitdirs.pm:
- Reorder switch variables to match other code.
(coverageIsEnabled): Add for set-webkit-configuration.

2021-04-06 Philippe Normand <pnormand@igalia.com>

[WPE] Enable Cog's GTK4 backend
@@ -39,26 +39,30 @@ Usage: $programName [options]
--32-bit Set the default architecture to 32-bit
--64-bit Set the default architecture to 64-bit
--[no-]asan Enable or disable clang address sanitizer
--[no-]coverage Enable or disable LLVM Source-based Code Coverage
--[no-]tsan Enable or disable clang thread sanitizer
--[no-]ubsan Enable or disable clang undefined behavior sanitizer
--[no-]coverage Enable or disable LLVM Source-based Code Coverage
--force-optimization-level=<level> Optimization level: O3, O2, O1, O0, Os, Ofast, Og, or none
--lto-mode=<mode> Set LTO mode: full, thin, or none
--debug Set the default configuration to debug
--release Set the default configuration to release
--reset Reset configurations
EOF

sub printCurrentSettings();
sub printUsage();
sub updateOrDeleteConfigurationFile($$);

my $configuration = passedConfiguration();
my $architecture = passedArchitecture();
my $enableASAN = checkForArgumentAndRemoveFromARGV("--asan");
my $disableASAN = checkForArgumentAndRemoveFromARGV("--no-asan");
my $enableCoverage = checkForArgumentAndRemoveFromARGV("--coverage");
my $disableCoverage = checkForArgumentAndRemoveFromARGV("--no-coverage");
my $enableTSAN = checkForArgumentAndRemoveFromARGV("--tsan");
my $disableTSAN = checkForArgumentAndRemoveFromARGV("--no-tsan");
my $enableUBSAN = checkForArgumentAndRemoveFromARGV("--ubsan");
my $disableUBSAN = checkForArgumentAndRemoveFromARGV("--no-ubsan");
my $enableCoverage = checkForArgumentAndRemoveFromARGV("--coverage");
my $disableCoverage = checkForArgumentAndRemoveFromARGV("--no-coverage");
my $ltoMode;
if (!checkForArgumentAndRemoveFromARGVGettingValue("--lto-mode", \$ltoMode)) {
$ltoMode="";
@@ -87,6 +91,7 @@ if (checkForArgumentAndRemoveFromARGV("--reset")) {
for my $fileName (qw(Architecture ASan Configuration Coverage ForceOptimizationLevel LTO TSan UBSan)) {
unlink File::Spec->catfile($baseProductDir, $fileName);
}
printCurrentSettings();
exit 0;
}

@@ -96,18 +101,18 @@ if ((!$configuration && !$architecture && !$enableASAN && !$disableASAN && !$ena
|| ($enableTSAN && $disableTSAN)
|| ($enableUBSAN && $disableUBSAN)
) {
print STDERR $usage;
printUsage();
exit 1;
}

if ($enableASAN && $enableTSAN) {
print STDERR "ERROR: Address Sanitizer and Thread Sanitzer can't be enabled together.\n";
print STDERR $usage;
printUsage();
exit 1;
}

if ($ltoMode && $ltoMode ne "full" && $ltoMode ne "thin" && $ltoMode ne "none") {
print STDERR $usage;
printUsage();
exit 1;
}

@@ -120,7 +125,7 @@ if ($forceOptimizationLevel
&& $forceOptimizationLevel ne "Os"
&& $forceOptimizationLevel ne "Ofast"
&& $forceOptimizationLevel ne "Og") {
print STDERR $usage;
printUsage();
exit 1;
}

@@ -171,3 +176,28 @@ if ($ltoMode) {
print LTO "$ltoMode";
close LTO;
}

printCurrentSettings();

exit 0;

sub printCurrentSettings()
{
my $result = "Current settings:";
$result .= " Configuration:" . configuration();
$result .= " Arch:" . architecture() if architecture();
$result .= " ASan" if asanIsEnabled();
$result .= " TSan" if tsanIsEnabled();
$result .= " UBSan" if ubsanIsEnabled();
$result .= " Coverage" if coverageIsEnabled();
$result .= " LTOMode:" . ltoMode() if ltoMode();
$result .= " ForceOptimizationLevel:O" . forceOptimizationLevel() if forceOptimizationLevel();

print STDERR $result, "\n";
}

sub printUsage()
{
print STDERR $usage, "\n";
printCurrentSettings();
}
@@ -132,8 +132,8 @@ my %nativeArchitectureMap = ();
my $asanIsEnabled;
my $tsanIsEnabled;
my $ubsanIsEnabled;
my $forceOptimizationLevel;
my $coverageIsEnabled;
my $forceOptimizationLevel;
my $ltoMode;
my $numberOfCPUs;
my $maxCPULoad;
@@ -935,6 +935,12 @@ sub ubsanIsEnabled()
return $ubsanIsEnabled;
}

sub coverageIsEnabled()
{
determineCoverageIsEnabled();
return $coverageIsEnabled;
}

sub forceOptimizationLevel()
{
determineForceOptimizationLevel();

0 comments on commit 383e57b

Please sign in to comment.