ld: table of contents for archive out of date?
ld: table of contents for archive out of date?
- Subject: ld: table of contents for archive out of date?
- From: Craig Rodrigues <email@hidden>
- Date: Wed, 28 Sep 2005 13:28:45 -0400
Hi,
I have the following scenario.
I have a third party library binary only static library
checked into our revision control system.
When I check out our code from our revision control system
and try to build, the linker complains with:
ld: table of contents for archive: ../lib/libsomelib.a is out of date; rerun ranlib(1) (can't load from it)
If I run ranlib on libsomelib.a, then I can get this to work,
but this doesn't seem right to me.
One problem I have is that in our revision control system, we have a policy where
we are not supposed to modify third party binaries like this (source yes,
binaries, no).
I can circumvent all this to get this to work, but this also doesn't
seem right.
If I read the bottom of the libtool man page:
BUGS
With the way libraries used to be created, errors were possible if the
library was modified with ar(1) and the table of contents was not
updated by rerunning ranlib(1). Thus the link editor, ld, warns when
the modification date of a library is more recent than the creation
date of its table of contents. Unfortunately, this means that you get
the warning even if you only copy the library.
Is this use case still valid? Is this warning useful at all?
I prefer the linker to fail if it cannot find symbols to link to,
not if it doesn't like the timestamp of the library I am linking to.
Would the following fix be appropriate for the linker?
--- pass1.c.orig Wed Sep 28 13:26:19 2005
+++ pass1.c Wed Sep 28 13:26:28 2005
@@ -1306,11 +1306,6 @@
"ranlib(1) (can't load from it)", file_name);
return;
}
- if(stat_buf.st_mtime > strtol(symdef_ar_hdr->ar_date, NULL, 10)){
- error("table of contents for archive: %s is out of date; rerun "
- "ranlib(1) (can't load from it)", file_name);
- return;
- }
symdef_length = strtol(symdef_ar_hdr->ar_size, NULL, 10) - ar_name_size;
/*
* The contents of a __.SYMDEF file is begins with a word giving the
--
Craig Rodrigues
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden