<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - C++11 atomics fail to link"
   href="http://llvm.org/bugs/show_bug.cgi?id=19393">19393</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>C++11 atomics fail to link
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>dragonegg
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>baldrick@free.fr
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>scott+llvm+bugzilla@pakin.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12362" name="attach_12362" title="Minimal reproducer, courtesy of Aleksandr Drozd">attachment 12362</a> <a href="attachment.cgi?id=12362&action=edit" title="Minimal reproducer, courtesy of Aleksandr Drozd">[details]</a></span>
Minimal reproducer, courtesy of Aleksandr Drozd

When using std::atomic, this works:

    $ g++ -std=c++11 -o atomics atomics.cpp

This doesn't:

    $ g++ -fplugin=/usr/local/lib/dragonegg.so -std=c++11 -o atomics
atomics.cpp
    /tmp/ccYWBxLQ.o: In function `std::__atomic_base<int>::store(int,
std::memory_order)':
   
atomics.cpp:(.text._ZNSt13__atomic_baseIiE5storeEiSt12memory_order[_ZNSt13__atomic_baseIiE5storeEiSt12memory_order]+0x44):
undefined reference to `__atomic_store_4'
    /tmp/ccYWBxLQ.o: In function
`std::__atomic_base<int>::load(std::memory_order) const':
   
atomics.cpp:(.text._ZNKSt13__atomic_baseIiE4loadESt12memory_order[_ZNKSt13__atomic_baseIiE4loadESt12memory_order]+0x38):
undefined reference to `__atomic_load_4'
    collect2: error: ld returned 1 exit status

Here's what I'm running:

    $ g++ --version | head -1
    g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
    $ svn info | grep Revision
    Revision: 205933
    $ uname -a
    Linux morbo 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux

I've attached a minimal reproducer.

Thanks in advance for your attention,
-- Scott</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>