This is an archive of the discontinued LLVM Phabricator instance.

Driver: Enable address-significance tables by default when targeting COFF.
ClosedPublic

Authored by pcc on Aug 21 2018, 10:37 AM.

Diff Detail

Repository
rC Clang

Event Timeline

pcc created this revision.Aug 21 2018, 10:37 AM
rnk added a comment.Aug 21 2018, 12:37 PM

Remind me what the approximate size overhead of this is? I expect it is negligible, as most symbols are not address taken.

pcc added a comment.Aug 22 2018, 5:10 PM

With ELF it was around 0.1% for a self-host of Clang. I also checked the overhead with COFF for Chromium's base_unittests and it was around 0.2% without debug info. I think that's small enough that we can turn this on by default.

rnk accepted this revision.Aug 23 2018, 7:42 AM

Excellent!

This revision is now accepted and ready to land.Aug 23 2018, 7:42 AM
This revision was automatically updated to reflect the committed changes.

This breaks Windows bot
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/33846/steps/run%20check-asan/logs/stdio

742542.065 [0/1/37] Running the AddressSanitizer tests
-- Testing: 607 tests, 16 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50
FAIL: AddressSanitizer-i386-windows :: TestCases/Windows/coverage-basic.cc (332 of 607)
******************** TEST 'AddressSanitizer-i386-windows :: TestCases/Windows/coverage-basic.cc' FAILED ********************
Script:
--
: 'RUN: at line 1';   rm -rf C:\b\slave\sanitizer-windows\build\projects\compiler-rt\test\asan\I386WindowsConfig\TestCases\Windows\Output\coverage-basic.cc.tmp-dir
: 'RUN: at line 2';   mkdir C:\b\slave\sanitizer-windows\build\projects\compiler-rt\test\asan\I386WindowsConfig\TestCases\Windows\Output\coverage-basic.cc.tmp-dir && cd C:\b\slave\sanitizer-windows\build\projects\compiler-rt\test\asan\I386WindowsConfig\TestCases\Windows\Output\coverage-basic.cc.tmp-dir
: 'RUN: at line 3';      C:/b/slave/sanitizer-windows/build/./bin/clang.exe  -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -gcodeview -gcolumn-info   -fms-compatibility-version=19.00.24215.1  -fsanitize-coverage=func C:\b\slave\sanitizer-windows\llvm\projects\compiler-rt\test\asan\TestCases\Windows\coverage-basic.cc -o test.exe
: 'RUN: at line 4';   env ASAN_OPTIONS=coverage=1  ./test.exe
: 'RUN: at line 6';   C:/Python27/python.exe C:/b/slave/sanitizer-windows/llvm/projects/compiler-rt\lib\sanitizer_common\scripts\sancov.py print *.sancov | FileCheck C:\b\slave\sanitizer-windows\llvm\projects\compiler-rt\test\asan\TestCases\Windows\coverage-basic.cc
--
Exit Code: 1120

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "rm" "-rf" "C:\b\slave\sanitizer-windows\build\projects\compiler-rt\test\asan\I386WindowsConfig\TestCases\Windows\Output\coverage-basic.cc.tmp-dir"
$ ":" "RUN: at line 2"
$ "mkdir" "C:\b\slave\sanitizer-windows\build\projects\compiler-rt\test\asan\I386WindowsConfig\TestCases\Windows\Output\coverage-basic.cc.tmp-dir"
$ ":" "RUN: at line 3"
$ "C:/b/slave/sanitizer-windows/build/./bin/clang.exe" "-fsanitize=address" "-mno-omit-leaf-frame-pointer" "-fno-omit-frame-pointer" "-fno-optimize-sibling-calls" "-gline-tables-only" "-gcodeview" "-gcolumn-info" "-fms-compatibility-version=19.00.24215.1" "-fsanitize-coverage=func" "C:\b\slave\sanitizer-windows\llvm\projects\compiler-rt\test\asan\TestCases\Windows\coverage-basic.cc" "-o" "test.exe"
# command output:
   Creating library test.lib and object test.exp

coverage-basic-f4c01a.o : error LNK2001: unresolved external symbol ___sanitizer_cov_trace_pc

test.exe : fatal error LNK1120: 1 unresolved externals
pcc added a comment.Aug 23 2018, 2:19 PM

Thanks, I'll take a look.

pcc reopened this revision.Aug 23 2018, 2:36 PM

I received another report of breakage so I reverted in rC340579.

This revision is now accepted and ready to land.Aug 23 2018, 2:36 PM
pcc added a comment.Aug 23 2018, 4:54 PM

D51199 fixes the above breakage as well as crbug.com/877235. Once it lands, I'll reland this change.

This revision was automatically updated to reflect the committed changes.