[llvm-bugs] [Bug 34808] New: llvm-ar-generated library + Xcode 9 ranlib result in malformed archive

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 2 14:40:04 PDT 2017


            Bug ID: 34808
           Summary: llvm-ar-generated library + Xcode 9 ranlib result in
                    malformed archive
           Product: tools
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-ar
          Assignee: unassignedbugs at nondot.org
          Reporter: jbc.engelen at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19217
  --> https://bugs.llvm.org/attachment.cgi?id=19217&action=edit
Zip archive with libbug.o object file to reproduce the error

Running ranlib (Xcode 9) on a library generated by llvm-ar results in a
malformed archive.

Using the attached object file libbug.o, there is no error using the system
- rm -f libbug.ar.a
- ar rcs libbug.ar.a libbug.o
- ranlib libbug.ar.a
- nm -g libbug.ar.a (no error)

Now with llvm-ar, we get an error:
- rm -f libbug.llvmar.a
- llvm-ar rcs libbug.llvmar.a libbug.o
- ranlib libbug.llvmar.a (system ranlib, with llvm-ranlib no error happens)
- nm -g libbug.llvmar.a (errors) (also errors with llvm-nm)

The error is:
"nm: libbug.llvmar.a truncated or malformed archive (terminator characters in
archive member ".o" not the correct "`\n" values for the archive member header
at offset 864)"

(bug was discovered in LDC when using the internal archiver (LLVM). See

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171002/38281393/attachment.html>

More information about the llvm-bugs mailing list