Wed 22 Jun 2005 05:49:25 AM UTC, original submission:
When processing a referenced lib A, ilalink tries to be helpful by auto-referencing libs B that A requires but which might not be directly required.
The problem is, if B isn't in one of the lib paths (-L) ilalink gives up right away, EVEN IF that lib might be directly referenced in a subsequent -l/path/to/lib switch.
Maybe the auto-indirect-referencing should be done in a separate pass, after all direct references have been processed?
Regardless, neither Mono's mcs nor Microsoft's csc exhibit the same problem.
Kudos on the great work, guys.
Ron
Starting point:
This block at line 814'ish of ilalink/link_library.c, in function ILLinkerAddLibrary(), which recursively calls itself straight away for each indirectly-referenced lib without waiting to see if it's referenced manually later on:
/* Add assemblies that were referenced by this library, because
this library may contain TypeRef's in its public signatures
to some other assembly, and we need to import them too */
if(result)
{
assem = 0;
while((assem = (ILAssembly *)ILImageNextToken
(image, IL_META_TOKEN_ASSEMBLY_REF, (void *)assem)) != 0)
{
if(!ILLinkerAddLibrary(linker, ILAssembly_Name(assem)))
{
result = 0;
break;
}
}
}
|