<html>
    <head>
      <base href="https://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 3.8.1 fails to link i386 macOS due to eprintf.c.o incorrectly being included in libclang_rt.osx.a"
   href="https://llvm.org/bugs/show_bug.cgi?id=28855">28855</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang 3.8.1 fails to link i386 macOS due to eprintf.c.o incorrectly being included in libclang_rt.osx.a
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jeremyhu@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On MacPorts, our clang-3.8 port (built from the 3.8.1 tarballs) fails to link
for i386 macOS because the built libclang_rt.osx.a incorrectly includes
eprintf.c.o


$ clang-mp-3.8 -arch i386 -bundle -undefined error -o libsasldb.plugin
sasldb.lo sasldb_init.lo plugin_common.lo -all_load libsasldb.al -lresolv -v
-Wl,-v
clang version 3.8.1 (tags/RELEASE_381/final)
Target: i386-apple-darwin16.0.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.8/bin
 "/opt/local/bin/ld" -demangle -dynamic -arch i386 -bundle -all_load
-macosx_version_min 10.12.0 -undefined error -undefined error -o
libsasldb.plugin sasldb.lo sasldb_init.lo plugin_common.lo libsasldb.al
-lresolv -v -lSystem
/opt/local/libexec/llvm-3.8/bin/../lib/clang/3.8.1/lib/darwin/libclang_rt.eprintf.a
/opt/local/libexec/llvm-3.8/bin/../lib/clang/3.8.1/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-274
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/
duplicate symbol ___eprintf in:
   
/opt/local/libexec/llvm-3.8/bin/../lib/clang/3.8.1/lib/darwin/libclang_rt.eprintf.a(eprintf.c.o)
   
/opt/local/libexec/llvm-3.8/bin/../lib/clang/3.8.1/lib/darwin/libclang_rt.osx.a(eprintf.c.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

---

The issue is still present recently on the release_39 branch:

~/tmp/bug $ nm -m
/opt/local/libexec/llvm-3.9/lib/clang/3.9.0/lib/darwin/libclang_rt.osx.a | grep
eprint
/opt/local/libexec/llvm-3.9/lib/clang/3.9.0/lib/darwin/libclang_rt.osx.a(eprintf.c.o):
0000000000000000 (__TEXT,__text) private external ___eprintf

~/tmp/bug $ clang-mp-3.9 --version
clang version 3.9.0 (branches/release_39 277311)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin</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>