diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 660ccfcc2277c..b31e021e42a8a 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,19 @@ +2021-07-18 David Kilzer + + Ignore weak external symbols in clang coverage builds using check-for-weak-vtables-and-externals + + + + 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 WKWebView javascript injection doesn't work if app includes WKAppBoundDomains diff --git a/Tools/Scripts/check-for-weak-vtables-and-externals b/Tools/Scripts/check-for-weak-vtables-and-externals index 8bcdee28782e9..48d65f103dbd8 100755 --- a/Tools/Scripts/check-for-weak-vtables-and-externals +++ b/Tools/Scripts/check-for-weak-vtables-and-externals @@ -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 (.*)$/) { diff --git a/Tools/coverage/coverage.xcconfig b/Tools/coverage/coverage.xcconfig index da54c18b6c5bf..0ef22c17f72f6 100644 --- a/Tools/coverage/coverage.xcconfig +++ b/Tools/coverage/coverage.xcconfig @@ -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;