<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 --- - The -Bstatic / -Bdynamic switches should be compatible with GNU ld"
   href="http://llvm.org/bugs/show_bug.cgi?id=20976">20976</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The -Bstatic / -Bdynamic switches should be compatible with GNU ld
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm.mail.list@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>There is a discrepancy in how the -Bstatic switch (disable linking against
shared libs) is treated by lld and GNU ld.

According to the GNU ld docs, the switch affects library searching for -l
options which follow it. This means -Bstatic can be used multiple times in the
command line to disable dynamic linking for particular -l options. For example:

ld -Bstatic -lslib1 -lslib2 -Bdynamic -ldlib1 -Bstatic -lslib3...

Even though the GNU linker won't search for so-files for slib1, slib2 and
slib3, so-file for dlib1 will still be considered as it is preceded by
-Bdynamic.

Lld behaves differently.
-Bdynamic is not recognized at all, whereas -Bstatic applies static linkage on
the output file level. The output file is considered static and it's no longer
possible to link against any shared lib. Lld looks for static archives only if
-Bstatic is met in the command line.</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>