Opened 12 years ago
Last modified 11 years ago
#1147 closed defect
Fix malformed TOC linker error on OS X — at Version 1
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | If Time Permits | Milestone: | |
Component: | Build & Packages | Keywords: | osx, build |
Cc: | Patch: |
Description (last modified by )
On OS X, after performing a build and editing some source code, errors like the following occur:
ld: in ../../../binaries/system/libengine.a, malformed archive TOC entry for _MASK__PSRETURN_Scripting_SetupFailed, offset 164452311 is beyond end of file 14363576 for architecture x86_64
or equally disturbing:
ld: in ../../../binaries/system/libengine.a(!<arch> #1/20), archive member '!<arch> #1/20' with length 100644 is not mach-o or llvm bitcode for architecture x86_64
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 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.