Title: [278444] trunk/Tools
Revision
278444
Author
ddkil...@apple.com
Date
2021-06-03 19:20:59 -0700 (Thu, 03 Jun 2021)

Log Message

Weak external symbols found when building with Release+Coverage configuration
<https://webkit.org/b/226562>
<rdar://problem/78765608>

Reviewed by Jonathan Bedard.

* Scripts/check-for-weak-vtables-and-externals:
- Ignore weak symbols from llvm when building with
  coverage enabled.  This fixes the build.
* Scripts/webkitdirs.pm:
(XcodeOptions):
- Switch to using XcodeCoverageSupportOptions() so
  `make` and `build-webkit` both use the same
  configuration.
(XcodeCoverageSupportOptions):
- Remove old Xcode variables from 2008 in favor of
  passing `-xcconfig Tools/coverage/coverage.xcconfig`.
* coverage/coverage.xcconfig:
(OTHER_CPLUSPLUSFLAGS):
- Remove OTHER_CPLUSPLUSFLAGS since this just caused
  duplicate command-line switches to be used when
  compiling C++ sources.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (278443 => 278444)


--- trunk/Tools/ChangeLog	2021-06-04 02:03:04 UTC (rev 278443)
+++ trunk/Tools/ChangeLog	2021-06-04 02:20:59 UTC (rev 278444)
@@ -1,3 +1,28 @@
+2021-06-03  David Kilzer  <ddkil...@apple.com>
+
+        Weak external symbols found when building with Release+Coverage configuration
+        <https://webkit.org/b/226562>
+        <rdar://problem/78765608>
+
+        Reviewed by Jonathan Bedard.
+
+        * Scripts/check-for-weak-vtables-and-externals:
+        - Ignore weak symbols from llvm when building with
+          coverage enabled.  This fixes the build.
+        * Scripts/webkitdirs.pm:
+        (XcodeOptions):
+        - Switch to using XcodeCoverageSupportOptions() so
+          `make` and `build-webkit` both use the same
+          configuration.
+        (XcodeCoverageSupportOptions):
+        - Remove old Xcode variables from 2008 in favor of
+          passing `-xcconfig Tools/coverage/coverage.xcconfig`.
+        * coverage/coverage.xcconfig:
+        (OTHER_CPLUSPLUSFLAGS):
+        - Remove OTHER_CPLUSPLUSFLAGS since this just caused
+          duplicate command-line switches to be used when
+          compiling C++ sources.
+
 2021-06-03  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r278356.

Modified: trunk/Tools/Scripts/check-for-weak-vtables-and-externals (278443 => 278444)


--- trunk/Tools/Scripts/check-for-weak-vtables-and-externals	2021-06-04 02:03:04 UTC (rev 278443)
+++ trunk/Tools/Scripts/check-for-weak-vtables-and-externals	2021-06-04 02:20:59 UTC (rev 278444)
@@ -68,6 +68,9 @@
             # ASan compiler-rt calls into __asan_mapping_offset and __asan_mapping_scale
             next if /\b___asan/;
 
+            # Ignore weak symbols present when compiling with coverage enabled.
+            next if /\b(___llvm_profile_filename|___llvm_profile_raw_version|_lprofDirMode)/ && coverageIsEnabled();
+
             if (/weak external vtable for (.*)$/) {
                 push @weakVTableClasses, $1;
             } elsif (/weak external (.*)$/) {

Modified: trunk/Tools/Scripts/webkitdirs.pm (278443 => 278444)


--- trunk/Tools/Scripts/webkitdirs.pm	2021-06-04 02:03:04 UTC (rev 278443)
+++ trunk/Tools/Scripts/webkitdirs.pm	2021-06-04 02:20:59 UTC (rev 278444)
@@ -1022,7 +1022,7 @@
         push @options, ("-xcconfig", File::Spec->catfile(sourceDir(), "Tools", "sanitizer", "tsan.xcconfig"));
     }
     push @options, ("-xcconfig", File::Spec->catfile(sourceDir(), "Tools", "sanitizer", "ubsan.xcconfig")) if $ubsanIsEnabled;
-    push @options, ("-xcconfig", sourceDir() . "/Tools/coverage/coverage.xcconfig") if $coverageIsEnabled;
+    push @options, XcodeCoverageSupportOptions() if $coverageIsEnabled;
     push @options, ("GCC_OPTIMIZATION_LEVEL=$forceOptimizationLevel") if $forceOptimizationLevel;
     push @options, "WK_LTO_MODE=$ltoMode" if $ltoMode;
     push @options, @baseProductDirOption;
@@ -1062,10 +1062,7 @@
 
 sub XcodeCoverageSupportOptions()
 {
-    my @coverageSupportOptions = ();
-    push @coverageSupportOptions, "GCC_GENERATE_TEST_COVERAGE_FILES=YES";
-    push @coverageSupportOptions, "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES";
-    return @coverageSupportOptions;
+    return ("-xcconfig", sourceDir() . "/Tools/coverage/coverage.xcconfig");
 }
 
 sub XcodeStaticAnalyzerOption()

Modified: trunk/Tools/coverage/coverage.xcconfig (278443 => 278444)


--- trunk/Tools/coverage/coverage.xcconfig	2021-06-04 02:03:04 UTC (rev 278443)
+++ trunk/Tools/coverage/coverage.xcconfig	2021-06-04 02:20:59 UTC (rev 278444)
@@ -1,3 +1,2 @@
 OTHER_CFLAGS = $(inherited) -fprofile-instr-generate -fcoverage-mapping;
-OTHER_CPLUSPLUSFLAGS = $(inherited) -fprofile-instr-generate -fcoverage-mapping;
 OTHER_LDFLAGS = $(inherited) -fprofile-instr-generate;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to