<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:44109618;
mso-list-type:hybrid;
mso-list-template-ids:1255027458 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Kostya,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Our linux machine is running Ubuntu 14.04.4 LTS with clang 3.7.1 and does the following:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">mkdir build<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cd build<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:10.5pt;font-family:Symbol;color:#333333"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:10.5pt;font-family:"Courier New";color:#333333">cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_TIMESTAMPS=OFF
-DLLVM_VERSION_SUFFIX= -DLLVM_BUILD_RUNTIME=ON -DLLVM_LIT_ARGS=--verbose --no-progress-bar --xunit-xml-output=xunit.xml -DCMAKE_BUILD_TYPE=Release ../llvm<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">ninja all<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">That should do it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Kostya Serebryany [mailto:kcc@google.com]
<br>
<b>Sent:</b> Thursday, August 30, 2018 18:45<br>
<b>To:</b> Yung, Douglas<br>
<b>Cc:</b> LLVM Commits<br>
<b>Subject:</b> Re: [compiler-rt] r340983 - [hwasan] get rid of some macros, remove the fixed shadow mapping<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Looking... <o:p></o:p></p>
<div>
<p class="MsoNormal">Meanwhile, how do I reproduce your build?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Aug 30, 2018 at 6:03 PM <<a href="mailto:douglas.yung@sony.com">douglas.yung@sony.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi Kostya,<br>
<br>
Your commit is breaking our internal linux builder that uses clang 3.7.1 to build:<br>
<br>
FAILED: : && /usr/lib/ccache/clang++ -fPIC -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -std=c++11 -O3 -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=gold -m64 -nodefaultlibs -Wl,--version-script,/home/siadmin/jenkins/w/opensource/opensource_build/build/projects/compiler-rt/lib/hwasan/clang_rt.hwasan-dynamic-x86_64.vers
-shared -Wl,-soname,<a href="http://libclang_rt.hwasan-x86_64.so" target="_blank">libclang_rt.hwasan-x86_64.so</a> -o lib/clang/8.0.0/lib/linux/<a href="http://libclang_rt.hwasan-x86_64.so" target="_blank">libclang_rt.hwasan-x86_64.so</a> projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan.cc.o
projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_allocator.cc.o projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_dynamic_shadow.cc.o projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_interceptors.cc.o
projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_linux.cc.o projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_poisoning.cc.o projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_report.cc.o
projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_thread.cc.o projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic.x86_64.dir/hwasan_new_delete.cc.o projects/compiler-rt/lib/interception/CMakeFiles/RTInterception.x86_64.dir/interception_linux.cc.o
projects/compiler-rt/lib/interception/CMakeFiles/RTInterception.x86_64.dir/interception_mac.cc.o projects/compiler-rt/lib/interception/CMakeFiles/RTInterception.x86_64.dir/interception_win.cc.o projects/compiler-rt/lib/interception/CMakeFiles/RTInterception.x86_64.dir/interception_type_test.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_allocator.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_common.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_deadlock_detector1.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_deadlock_detector2.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_errno.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_file.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flags.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_fuchsia.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libc.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_s390.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_mac.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_openbsd.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_persistent_allocator.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_linux.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_netbsd.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_openbsd.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_solaris.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_posix.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_printf.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_common.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_bsd.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_linux.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_mac.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_solaris.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_rtems.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_solaris.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_stoptheworld_mac.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_suppressions.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_tls_get_addr.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_thread_registry.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_win.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_mips64.S.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_termination.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_common_libcdep.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_allocator_checks.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_linux_libcdep.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_mac_libcdep.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_posix_libcdep.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_stoptheworld_linux_libcdep.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonCoverage.x86_64.dir/sancov_flags.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonCoverage.x86_64.dir/sanitizer_coverage_fuchsia.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonCoverage.x86_64.dir/sanitizer_coverage_libcdep_new.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonCoverage.x86_64.dir/sanitizer_coverage_win_sections.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_allocator_report.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stackdepot.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stacktrace.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stacktrace_libcdep.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stacktrace_printer.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_stacktrace_sparc.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_libbacktrace.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_libcdep.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_mac.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_markup.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_posix_libcdep.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_report.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_symbolizer_win.cc.o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonSymbolizer.x86_64.dir/sanitizer_unwind_win.cc.o projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_diag.cc.o projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_init.cc.o
projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_flags.cc.o projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_handlers.cc.o projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_monitor.cc.o projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_value.cc.o
projects/compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic_version_script_dummy.x86_64.dir/dummy.cc.o -lstdc++ -lgcc_s -lc -ldl -lrt -lm -lpthread -Wl,-rpath,"\$ORIGIN/../lib" && :<br>
/home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_dynamic_shadow.cc:121: error: undefined reference to '__hwasan_shadow'<br>
/home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_dynamic_shadow.cc:124: error: undefined reference to '__hwasan_shadow'<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
<br>
Can you take a look?<br>
<br>
Douglas Yung<br>
<br>
> -----Original Message-----<br>
> From: llvm-commits [mailto:<a href="mailto:llvm-commits-bounces@lists.llvm.org" target="_blank">llvm-commits-bounces@lists.llvm.org</a>] On<br>
> Behalf Of Kostya Serebryany via llvm-commits<br>
> Sent: Wednesday, August 29, 2018 15:42<br>
> To: <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> Subject: [compiler-rt] r340983 - [hwasan] get rid of some macros,<br>
> remove the fixed shadow mapping<br>
> <br>
> Author: kcc<br>
> Date: Wed Aug 29 15:42:16 2018<br>
> New Revision: 340983<br>
> <br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=340983&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=340983&view=rev</a><br>
> Log:<br>
> [hwasan] get rid of some macros, remove the fixed shadow mapping<br>
> <br>
> Modified:<br>
> compiler-rt/trunk/lib/hwasan/hwasan.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_allocator.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_dynamic_shadow.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_linux.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_mapping.h<br>
> compiler-rt/trunk/lib/hwasan/hwasan_poisoning.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_report.cc<br>
> compiler-rt/trunk/lib/hwasan/hwasan_thread.cc<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan.cc?rev=340983&r1=340982&r2=340983&view=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan.cc Wed Aug 29 15:42:16 2018<br>
> @@ -167,12 +167,6 @@ void __hwasan_shadow_init() {<br>
> if (hwasan_shadow_inited) return;<br>
> if (!InitShadow()) {<br>
> Printf("FATAL: HWAddressSanitizer cannot mmap the shadow<br>
> memory.\n");<br>
> - if (HWASAN_FIXED_MAPPING) {<br>
> - Printf("FATAL: Make sure to compile with -fPIE and to link with<br>
> -pie.\n");<br>
> - Printf("FATAL: Disabling ASLR is known to cause this error.\n");<br>
> - Printf("FATAL: If running under GDB, try "<br>
> - "'set disable-randomization off'.\n");<br>
> - }<br>
> DumpProcessMap();<br>
> Die();<br>
> }<br>
> @@ -230,12 +224,12 @@ void __hwasan_init() {<br>
> <br>
> void __hwasan_print_shadow(const void *p, uptr sz) {<br>
> uptr ptr_raw = UntagAddr(reinterpret_cast<uptr>(p));<br>
> - uptr shadow_first = MEM_TO_SHADOW(ptr_raw);<br>
> - uptr shadow_last = MEM_TO_SHADOW(ptr_raw + sz - 1);<br>
> + uptr shadow_first = MemToShadow(ptr_raw);<br>
> + uptr shadow_last = MemToShadow(ptr_raw + sz - 1);<br>
> Printf("HWASan shadow map for %zx .. %zx (pointer tag %x)\n",<br>
> ptr_raw,<br>
> ptr_raw + sz, GetTagFromPointer((uptr)p));<br>
> for (uptr s = shadow_first; s <= shadow_last; ++s)<br>
> - Printf(" %zx: %x\n", SHADOW_TO_MEM(s), *(tag_t *)s);<br>
> + Printf(" %zx: %x\n", ShadowToMem(s), *(tag_t *)s);<br>
> }<br>
> <br>
> sptr __hwasan_test_shadow(const void *p, uptr sz) {<br>
> @@ -245,11 +239,11 @@ sptr __hwasan_test_shadow(const void *p,<br>
> if (ptr_tag == 0)<br>
> return -1;<br>
> uptr ptr_raw = UntagAddr(reinterpret_cast<uptr>(p));<br>
> - uptr shadow_first = MEM_TO_SHADOW(ptr_raw);<br>
> - uptr shadow_last = MEM_TO_SHADOW(ptr_raw + sz - 1);<br>
> + uptr shadow_first = MemToShadow(ptr_raw);<br>
> + uptr shadow_last = MemToShadow(ptr_raw + sz - 1);<br>
> for (uptr s = shadow_first; s <= shadow_last; ++s)<br>
> if (*(tag_t*)s != ptr_tag)<br>
> - return SHADOW_TO_MEM(s) - ptr_raw;<br>
> + return ShadowToMem(s) - ptr_raw;<br>
> return -1;<br>
> }<br>
> <br>
> @@ -305,7 +299,7 @@ template <ErrorAction EA, AccessType AT,<br>
> __attribute__((always_inline, nodebug)) static void CheckAddress(uptr<br>
> p) {<br>
> tag_t ptr_tag = GetTagFromPointer(p);<br>
> uptr ptr_raw = p & ~kAddressTagMask;<br>
> - tag_t mem_tag = *(tag_t *)MEM_TO_SHADOW(ptr_raw);<br>
> + tag_t mem_tag = *(tag_t *)MemToShadow(ptr_raw);<br>
> if (UNLIKELY(ptr_tag != mem_tag)) {<br>
> SigTrap<0x20 * (EA == ErrorAction::Recover) +<br>
> 0x10 * (AT == AccessType::Store) + LogSize>(p);<br>
> @@ -319,8 +313,8 @@ __attribute__((always_inline, nodebug))<br>
> CHECK_NE(0, sz);<br>
> tag_t ptr_tag = GetTagFromPointer(p);<br>
> uptr ptr_raw = p & ~kAddressTagMask;<br>
> - tag_t *shadow_first = (tag_t *)MEM_TO_SHADOW(ptr_raw);<br>
> - tag_t *shadow_last = (tag_t *)MEM_TO_SHADOW(ptr_raw + sz - 1);<br>
> + tag_t *shadow_first = (tag_t *)MemToShadow(ptr_raw);<br>
> + tag_t *shadow_last = (tag_t *)MemToShadow(ptr_raw + sz - 1);<br>
> for (tag_t *t = shadow_first; t <= shadow_last; ++t)<br>
> if (UNLIKELY(ptr_tag != *t)) {<br>
> SigTrap<0x20 * (EA == ErrorAction::Recover) +<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_allocator.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_allocator.cc?rev=340983&r1=340982&r2=340983&<br>
> view=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_allocator.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_allocator.cc Wed Aug 29<br>
> 15:42:16 2018<br>
> @@ -178,7 +178,7 @@ static bool PointerAndMemoryTagsMatch(vo<br>
> CHECK(tagged_ptr);<br>
> tag_t ptr_tag =<br>
> GetTagFromPointer(reinterpret_cast<uptr>(tagged_ptr));<br>
> tag_t mem_tag = *reinterpret_cast<tag_t *>(<br>
> - MEM_TO_SHADOW(UntagPtr(tagged_ptr)));<br>
> + MemToShadow(reinterpret_cast<uptr>(UntagPtr(tagged_ptr))));<br>
> return ptr_tag == mem_tag;<br>
> }<br>
> <br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_dynamic_shadow.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_dynamic_shadow.cc?rev=340983&r1=340982&r2=34<br>
> 0983&view=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_dynamic_shadow.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_dynamic_shadow.cc Wed Aug 29<br>
> 15:42:16 2018<br>
> @@ -58,8 +58,6 @@ static uptr MapDynamicShadow(uptr shadow<br>
> <br>
> } // namespace __hwasan<br>
> <br>
> -#if HWASAN_PREMAP_SHADOW<br>
> -<br>
> extern "C" {<br>
> <br>
> INTERFACE_ATTRIBUTE void __hwasan_shadow();<br>
> @@ -117,15 +115,11 @@ void __hwasan_shadow();<br>
> <br>
> } // extern "C"<br>
> <br>
> -#endif // HWASAN_PREMAP_SHADOW<br>
> -<br>
> namespace __hwasan {<br>
> <br>
> uptr FindDynamicShadowStart(uptr shadow_size_bytes) {<br>
> -#if HWASAN_PREMAP_SHADOW<br>
> if (IsPremapShadowAvailable())<br>
> return FindPremappedShadowStart(shadow_size_bytes);<br>
> -#endif<br>
> return MapDynamicShadow(shadow_size_bytes);<br>
> }<br>
> <br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_linux.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_linux.cc?rev=340983&r1=340982&r2=340983&view<br>
> =diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_linux.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_linux.cc Wed Aug 29 15:42:16<br>
> 2018<br>
> @@ -157,7 +157,7 @@ bool InitShadow() {<br>
> kHighMemEnd = GetHighMemEnd();<br>
> <br>
> // Determine shadow memory base offset.<br>
> - InitializeShadowBaseAddress(MEM_TO_SHADOW_SIZE(kHighMemEnd));<br>
> + InitializeShadowBaseAddress(MemToShadowSize(kHighMemEnd));<br>
> <br>
> // Place the low memory first.<br>
> if (SHADOW_OFFSET) {<br>
> @@ -166,20 +166,20 @@ bool InitShadow() {<br>
> } else {<br>
> // LowMem covers as much of the first 4GB as possible.<br>
> kLowMemEnd = (1UL << 32) - 1;<br>
> - kLowMemStart = MEM_TO_SHADOW(kLowMemEnd) + 1;<br>
> + kLowMemStart = MemToShadow(kLowMemEnd) + 1;<br>
> }<br>
> <br>
> // Define the low shadow based on the already placed low memory.<br>
> - kLowShadowEnd = MEM_TO_SHADOW(kLowMemEnd);<br>
> - kLowShadowStart = SHADOW_OFFSET ? SHADOW_OFFSET :<br>
> MEM_TO_SHADOW(kLowMemStart);<br>
> + kLowShadowEnd = MemToShadow(kLowMemEnd);<br>
> + kLowShadowStart = SHADOW_OFFSET ? SHADOW_OFFSET :<br>
> MemToShadow(kLowMemStart);<br>
> <br>
> // High shadow takes whatever memory is left up there (making sure<br>
> it is not<br>
> // interfering with low memory in the fixed case).<br>
> - kHighShadowEnd = MEM_TO_SHADOW(kHighMemEnd);<br>
> - kHighShadowStart = Max(kLowMemEnd, MEM_TO_SHADOW(kHighShadowEnd)) +<br>
> 1;<br>
> + kHighShadowEnd = MemToShadow(kHighMemEnd);<br>
> + kHighShadowStart = Max(kLowMemEnd, MemToShadow(kHighShadowEnd)) + 1;<br>
> <br>
> // High memory starts where allocated shadow allows.<br>
> - kHighMemStart = SHADOW_TO_MEM(kHighShadowStart);<br>
> + kHighMemStart = ShadowToMem(kHighShadowStart);<br>
> <br>
> // Check the sanity of the defined memory ranges (there might be<br>
> gaps).<br>
> CHECK_EQ(kHighMemStart % GetMmapGranularity(), 0);<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_mapping.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_mapping.h?rev=340983&r1=340982&r2=340983&vie<br>
> w=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_mapping.h (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_mapping.h Wed Aug 29 15:42:16<br>
> 2018<br>
> @@ -16,6 +16,7 @@<br>
> #define HWASAN_MAPPING_H<br>
> <br>
> #include "sanitizer_common/sanitizer_internal_defs.h"<br>
> +#include "hwasan_interface_internal.h"<br>
> <br>
> // Typical mapping on Linux/x86_64 with fixed shadow mapping:<br>
> // || [0x080000000000, 0x7fffffffffff] || HighMem ||<br>
> @@ -47,37 +48,28 @@<br>
> // || [0x007477480000, 0x007bbebc7fff] || LowShadow ||<br>
> // || [0x000000000000, 0x00747747ffff] || LowMem ||<br>
> <br>
> -static constexpr __sanitizer::u64 kDefaultShadowSentinel =<br>
> ~(__sanitizer::u64)0;<br>
> +static constexpr u64 kDefaultShadowSentinel = ~(u64)0;<br>
> <br>
> // Reasonable values are 4 (for 1/16th shadow) and 6 (for 1/64th).<br>
> -constexpr __sanitizer::uptr kShadowScale = 4;<br>
> -constexpr __sanitizer::uptr kShadowAlignment = 1ULL << kShadowScale;<br>
> +constexpr uptr kShadowScale = 4;<br>
> +constexpr uptr kShadowAlignment = 1ULL << kShadowScale;<br>
> <br>
> -#if SANITIZER_ANDROID<br>
> -# define HWASAN_FIXED_MAPPING 0<br>
> -#else<br>
> -# define HWASAN_FIXED_MAPPING 1<br>
> -#endif<br>
> -<br>
> -#if HWASAN_FIXED_MAPPING<br>
> -# define SHADOW_OFFSET (0)<br>
> -# define HWASAN_PREMAP_SHADOW 0<br>
> -#else<br>
> -# define SHADOW_OFFSET (__hwasan_shadow_memory_dynamic_address)<br>
> -# define HWASAN_PREMAP_SHADOW 1<br>
> -#endif<br>
> +#define SHADOW_OFFSET (__hwasan_shadow_memory_dynamic_address)<br>
> <br>
> #define SHADOW_GRANULARITY (1ULL << kShadowScale)<br>
> <br>
> -#define MEM_TO_SHADOW(mem) (((uptr)(mem) >> kShadowScale) +<br>
> SHADOW_OFFSET)<br>
> -#define SHADOW_TO_MEM(shadow) (((uptr)(shadow) - SHADOW_OFFSET) <<<br>
> kShadowScale)<br>
> -<br>
> -#define MEM_TO_SHADOW_SIZE(size) ((uptr)(size) >> kShadowScale)<br>
> -<br>
> -#define MEM_IS_APP(mem) MemIsApp((uptr)(mem))<br>
> -<br>
> namespace __hwasan {<br>
> <br>
> +inline uptr MemToShadow(uptr untagged_addr) {<br>
> + return (untagged_addr >> kShadowScale) + SHADOW_OFFSET;<br>
> +}<br>
> +inline uptr ShadowToMem(uptr shadow_addr) {<br>
> + return (shadow_addr - SHADOW_OFFSET) << kShadowScale;<br>
> +}<br>
> +inline uptr MemToShadowSize(uptr size) {<br>
> + return size >> kShadowScale;<br>
> +}<br>
> +<br>
> bool MemIsApp(uptr p);<br>
> <br>
> } // namespace __hwasan<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_poisoning.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_poisoning.cc?rev=340983&r1=340982&r2=340983&<br>
> view=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_poisoning.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_poisoning.cc Wed Aug 29<br>
> 15:42:16 2018<br>
> @@ -22,8 +22,8 @@ namespace __hwasan {<br>
> uptr TagMemoryAligned(uptr p, uptr size, tag_t tag) {<br>
> CHECK(IsAligned(p, kShadowAlignment));<br>
> CHECK(IsAligned(size, kShadowAlignment));<br>
> - uptr shadow_start = MEM_TO_SHADOW(p);<br>
> - uptr shadow_size = MEM_TO_SHADOW_SIZE(size);<br>
> + uptr shadow_start = MemToShadow(p);<br>
> + uptr shadow_size = MemToShadowSize(size);<br>
> internal_memset((void *)shadow_start, tag, shadow_size);<br>
> return AddTagToPointer(p, tag);<br>
> }<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_report.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_report.cc?rev=340983&r1=340982&r2=340983&vie<br>
> w=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_report.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_report.cc Wed Aug 29 15:42:16<br>
> 2018<br>
> @@ -151,7 +151,7 @@ void ReportInvalidFree(StackTrace *stack<br>
> ScopedErrorReportLock l;<br>
> uptr untagged_addr = UntagAddr(tagged_addr);<br>
> tag_t ptr_tag = GetTagFromPointer(tagged_addr);<br>
> - tag_t *tag_ptr =<br>
> reinterpret_cast<tag_t*>(MEM_TO_SHADOW(untagged_addr));<br>
> + tag_t *tag_ptr =<br>
> reinterpret_cast<tag_t*>(MemToShadow(untagged_addr));<br>
> tag_t mem_tag = *tag_ptr;<br>
> Decorator d;<br>
> Printf("%s", d.Error());<br>
> @@ -187,7 +187,7 @@ void ReportTagMismatch(StackTrace *stack<br>
> untagged_addr, pc);<br>
> <br>
> tag_t ptr_tag = GetTagFromPointer(tagged_addr);<br>
> - tag_t *tag_ptr =<br>
> reinterpret_cast<tag_t*>(MEM_TO_SHADOW(untagged_addr));<br>
> + tag_t *tag_ptr =<br>
> reinterpret_cast<tag_t*>(MemToShadow(untagged_addr));<br>
> tag_t mem_tag = *tag_ptr;<br>
> Printf("%s", d.Access());<br>
> Printf("%s of size %zu at %p tags: %02x/%02x (ptr/mem)\n",<br>
> <br>
> Modified: compiler-rt/trunk/lib/hwasan/hwasan_thread.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/lib/hwasan/hwasan_thread.cc?rev=340983&r1=340982&r2=340983&vie<br>
> w=diff<br>
> =======================================================================<br>
> =======<br>
> --- compiler-rt/trunk/lib/hwasan/hwasan_thread.cc (original)<br>
> +++ compiler-rt/trunk/lib/hwasan/hwasan_thread.cc Wed Aug 29 15:42:16<br>
> 2018<br>
> @@ -54,15 +54,15 @@ void HwasanThread::SetThreadStackAndTls(<br>
> <br>
> int local;<br>
> CHECK(AddrIsInStack((uptr)&local));<br>
> - CHECK(MEM_IS_APP(stack_bottom_));<br>
> - CHECK(MEM_IS_APP(stack_top_ - 1));<br>
> + CHECK(MemIsApp(stack_bottom_));<br>
> + CHECK(MemIsApp(stack_top_ - 1));<br>
> }<br>
> <br>
> void HwasanThread::Init() {<br>
> SetThreadStackAndTls();<br>
> if (stack_bottom_) {<br>
> - CHECK(MEM_IS_APP(stack_bottom_));<br>
> - CHECK(MEM_IS_APP(stack_top_ - 1));<br>
> + CHECK(MemIsApp(stack_bottom_));<br>
> + CHECK(MemIsApp(stack_top_ - 1));<br>
> }<br>
> }<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>