mozilla

Compare Revisions

Building SpiderMonkey with UBSan

Change Revisions

Revision 431767:

Revision 431767 by yeukhon on

Revision 431769:

Revision 431769 by Jesse on

Title:
Building SpiderMonkey with UBSan
Building SpiderMonkey with UBSan
Slug:
Building_SpiderMonkey_with_UBSan
Building_SpiderMonkey_with_UBSan
Content:

Revision 431767
Revision 431769
n8      Use this script instead of the MDN one: <a href="/en-US/docn8      1. <a href="https://developer.mozilla.org/en-US/docs/Buildi
>s/" title="/en-US/docs/">https://developer.mozilla.org/en-US/docs>ng_Firefox_with_Address_Sanitizer#LLVM.2FClang" title="https://de
>/Building_Firefox_with_Address_Sanitizer</a>>veloper.mozilla.org/en-US/docs/Building_Firefox_with_Address_Sani
 >tizer#LLVM.2FClang">Compile a recent version of LLVM &amp; Clang<
 >/a>.
9    </p>
10    <p>
11      2. Save the following bash script, fixing LLVM_ROOT to poin
 >t to your installation.
n21    LLVM_ROOT="/home/vagrant/llvm"n24    <strong>LLVM_ROOT="<span style="color:#ff0000;">/home/vagrant
 >/llvm</span>"</strong>
22    SANFLAG="-fsanitize=alignment,bool,bounds,enum,float-cast-ove25    SANFLAG="<strong>-fsanitize=alignment,bool,bounds,enum,float-
>rflow,integer-divide-by-zero,null,object-size,return,shift,signed>cast-overflow,integer-divide-by-zero,null,object-size,return,shif
>-integer-overflow,unreachable,vla-bound -Dxmalloc=myxmalloc" \>t,signed-integer-overflow,unreachable,vla-bound</strong> -Dxmallo
 >c=myxmalloc" \
n27    MOZ_LLVM_HACKS=1 \n30    <strong>MOZ_LLVM_HACKS=1</strong> \
n33      &nbsp;n36      3. Use the script to compile SpiderMonkey.
n36      Corresponding bug on bugzilla:n39      The <strong><a href="http://clang.llvm.org/docs/UsersManual
 >.html#controlling-code-generation" title="http://clang.llvm.org/d
 >ocs/UsersManual.html#controlling-code-generation">sanitize option
 >s</a></strong> chosen above are all of the cheap undefined behavi
 >or checks other than:
nn41    <ul>
42      <li>
43        <strong>vptr</strong>, which requires RTTI, disabled by d
 >efault in SpiderMonkey
44      </li>
45      <li>
46        <strong>float-divide-by-zero</strong>, which Jesse doesn'
 >t think is actually undefined behavior
47      </li>
48    </ul>
t39      <a href="/en-US/docs/" title="/en-US/docs/">https://bugzillt50      Please file bugs with [-fsanitize=X] in the status whiteboa
>a.mozilla.org/show_bug.cgi?id=885631</a>>rd, where X is the relevant sanitize option.

Back to History