Skip to content

Commit

Permalink
Ignore weak external symbols in clang coverage builds using check-for…
Browse files Browse the repository at this point in the history
…-weak-vtables-and-externals

<https://webkit.org/b/228063>
<rdar://problem/80477138>

Reviewed by Alexey Proskuryakov.

* Scripts/check-for-weak-vtables-and-externals:
- Ignore weak symbols from llvm when building with
  coverage enabled.  This fixes the build.
* coverage/coverage.xcconfig:
(UNEXPORTED_SYMBOL_LDFLAGS_FOR_COVERAGE): Remove.
- Can't use -unexported_symbol and -exported_symbol
  together, so remove this.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@280021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Jul 18, 2021
1 parent 851631a commit e690651
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Tools/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2021-07-18 David Kilzer <[email protected]>

Ignore weak external symbols in clang coverage builds using check-for-weak-vtables-and-externals
<https://webkit.org/b/228063>
<rdar://problem/80477138>

Reviewed by Alexey Proskuryakov.

* Scripts/check-for-weak-vtables-and-externals:
- Ignore weak symbols from llvm when building with
coverage enabled. This fixes the build.
* coverage/coverage.xcconfig:
(UNEXPORTED_SYMBOL_LDFLAGS_FOR_COVERAGE): Remove.
- Can't use -unexported_symbol and -exported_symbol
together, so remove this.

2021-07-16 Kate Cheney <[email protected]>

WKWebView javascript injection doesn't work if app includes WKAppBoundDomains
Expand Down
3 changes: 3 additions & 0 deletions Tools/Scripts/check-for-weak-vtables-and-externals
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ if (!defined $executablePathAge || !defined $buildTimestampAge || $executablePat
# 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 (.*)$/) {
Expand Down
5 changes: 1 addition & 4 deletions Tools/coverage/coverage.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
// Unexport weak external symbols from llvm coverage.
UNEXPORTED_SYMBOL_LDFLAGS_FOR_COVERAGE = -Wl,-unexported_symbol -Wl,___llvm_profile_filename -Wl,-unexported_symbol -Wl,___llvm_profile_raw_version -Wl,-unexported_symbol -Wl,_lprofDirMode;

OTHER_CFLAGS = $(inherited) -fprofile-instr-generate -fcoverage-mapping;
OTHER_LDFLAGS = $(inherited) -fprofile-instr-generate $(UNEXPORTED_SYMBOL_LDFLAGS_FOR_COVERAGE);
OTHER_LDFLAGS = $(inherited) -fprofile-instr-generate;

0 comments on commit e690651

Please sign in to comment.