<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ASan] -fno-common generates a comdat with asan options"
   href="https://bugs.llvm.org/show_bug.cgi?id=47925">47925</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ASan] -fno-common generates a comdat with asan options
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Wolfgang_Pieb@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following trivial source generates a comdat for 'bar' when using ASan:

/*==================*/
char bar;
/*==================*/


clang -emit-llvm -S -fsanitize=address -fdata-sections
-fsanitize-address-globals-dead-stripping -c bar.c

bar.ll:

<snip>
@bar = dso_local global { i8, [63 x i8] } zeroinitializer, comdat, align 32
<snip>

Without either -fsanitize-address-globals-dead-stripping or -fdata-sections no
comdat is generated.

The consequence is that we don't find some ODR violations at link time with
these options.

Note that commit
<a href="https://github.com/llvm/llvm-project/commit/3d9a0445cce368b55dc3a573bc91fe902bbb977f">https://github.com/llvm/llvm-project/commit/3d9a0445cce368b55dc3a573bc91fe902bbb977f</a>
changed the default to -fno-common. Before, you would have to give -fno-common
on the command line to trigger this behaviour.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>