Changes between Version 1 and Version 4 of Ticket #1147


Ignore:
Timestamp:
Mar 5, 2012, 11:51:35 PM (12 years ago)
Author:
historic_bruno
Comment:

Actually I've started running ranlib ../../../binaries/system/*.a as a work around, once I learned of the cause :)

More info: Premake inserts an ar -rcs command into the makefile, which should be doing what we want, according to the ar manpage on Lion:

     -c      Whenever an archive is created, an informational message to that
             effect is written to standard error.  If the -c option is speci-
             fied, ar creates the archive silently.
     -r      Replace or add the specified files to the archive.  If the ar-
             chive does not exist a new archive file is created.  Files that
             replace existing files do not change the order of the files
             within the archive.  New files are appended to the archive unless
             one of the options -a, -b or -i is specified.
     -s      Write an object-file index into the archive, or update an exist-
             ing one, even if no other change is made to the archive.  You may
             use this modifier flag either with any operation, or alone.  Run-
             ning `ar s' on an archive is equivalent to running `ranlib' on
             it.

The last sentence is apparently not true, as running ranlib separately on the archive fixes the error.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1147

    • Property Priority Should HaveNice to Have
    • Property Milestone Alpha 9Alpha 10
  • Ticket #1147 – Description

    v1 v4  
    1313</pre>
    1414}}}
    15 We've been working around this by performing `make clean` every time, but that's a slow and frustrating process. Apparently the problem is the library table of contents needs to be updated after a rebuild, and this isn't happening automatically with `ld`. A suggested fix is [http://stackoverflow.com/questions/7500901/malformed-archived-toc-entry-on-creating-staticlib running ranlib after ar and before ld] which I can confirm works (run `ranlb` on the affected library after you get the error, then `make` again and it works). I don't know about the other suggestion of using the -s option for `ar`, but that's worth testing too.
     15We've been working around this by performing `make clean` every time, but that's a slow and frustrating process. Apparently the problem is the library table of contents needs to be updated after a rebuild, and this isn't happening automatically with `ar`. A suggested fix is [http://stackoverflow.com/questions/7500901/malformed-archived-toc-entry-on-creating-staticlib running ranlib after ar and before ld] which I can confirm works (run `ranlb` on the affected library after you get the error, then `make` again and it works). ~~I don't know about the other suggestion of using the -s option for `ar`, but that's worth testing too.~~