<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 --- - clang's build environment does not respect LD_RUN_PATH"
   href="http://llvm.org/bugs/show_bug.cgi?id=18601">18601</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang's build environment does not respect LD_RUN_PATH
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tofergregg@gmail.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 asked our university's IT staff to install a current version of clang/clang++
on one of our machines. He installed 3.4, but was forced to include this snarky
wrapper for using it (he told me I could include the snark! Please don't shoot
the messenger!):

------------------

#!/bin/bash

# clang's build environment does not obey LD_RUN_PATH, so have to use
# this workaround at run time. D41S, argh!
LD_LIBRARY_PATH=/usr/sup/lib64:/usr/sup/lib:/lib64:/usr/lib64:/lib:/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

# At least clang itself obeys LD_RUN_PATH, set it to prevent screwy errors
# later.
LD_RUN_PATH=/usr/sup/lib64:/usr/sup/lib:/lib64:/usr/lib64:/lib:/usr/lib:$LD_LIBRARY_PATH
export LD_RUN_PATH

# clang does not retain the environment it was built under, so have to use
# this workaround at run time.  D41S, argh!
CPATH=/usr/sup/include:/usr/sup/include/c++/4.8.0:CPATH export CPATH
LIBRARY_PATH=/usr/sup/lib64:/usr/sup/lib:/lib64:/usr/lib64:/lib:/usr/lib:$LIBRARY_PATH
export LIBRARY_PATH

# Now that we've worked around most of the stupid, invoke clang++ with
# the invocation that takes care of the rest of the stupid.
/usr/sup/llvm-3.4/bin/clang++ -I/usr/sup/include -I/usr/sup/include/c++/4.8.0
$*

--------------

Other possibly relevant information:
$ which clang++
/usr/sup/bin/clang++

$ clang++ --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.5 (Santiago)

Our IT staff puts a lot of stuff in the /usr/sup/bin directory, and it seems to
me that this is what is causing the headache.

If this isn't a bug, I'd like to pass on to the IT guy what could be done to
remedy this without the wrapper.</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>