<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 --- - llvm-config --ldflags does not report -stdlib=libc++ -std=c++11"
   href="http://llvm.org/bugs/show_bug.cgi?id=16372">16372</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-config --ldflags does not report -stdlib=libc++ -std=c++11
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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-config
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jeroen.ketema@yahoo.com
          </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>I'm building libclc [1] against an llvm that was configured and compiled with
the --enable-libcpp and --enable-cxx11 options. As far as I understand this
means that everything I build against this version of llvm needs to be compiled
and linked with -stdlib=libc++ and -std=c++11.

Currently, llvm-config only reports -stdlib=libc++ and -std=c++11 with
--cxxflags, but not with --ldflags. This means that although compilation of
libclc works fine, linking fails with missing symbols, because for linking
libclc only looks at the --ldflags output by llvm-config (which is missing
-stdlib=libc++ and -std=c++11). Standard linkage is against a different (older)
C++ library, as I work on OSX.

My setup is as follows: I'm building llvm with --enable-libcpp and
--enable-cxx11 on OSX using clang as supplied with xcode:

$ clang --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)

I also compile libclc using the above compiler, whilst pointing to the correct
llvm-config via a command line argument of its configure script.

Note that the libclc developers suggested me to report this problem here
instead fixing this in libclc by passing all cxxflags during the linking stage.

[1] <a href="http://libclc.llvm.org/">http://libclc.llvm.org/</a></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>