-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 466 |
| Resolution | FIXED |
| Resolved on | Mar 06, 2010 14:00 |
| Version | 1.0 |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @lattner |
Extended Description
If the same library is passed to LinkLibraries twice in the Libraries parameter,
and that library is not strictly a library (archive), but a bytecode module,
then the function fails with a "duplicate symbol definition" error. This
happens with libraries like libc.bc which really isn't a library.
This doesn't affect anything right now because all the tools ensure that the
list of libraries does not contain duplicates (like -lc -lc). However, the
Linker interface shouldn't depend on that. Where it does become a problem is if
someone puts a -lc on the command line and we enable dependent libraries support
in the linker. We then get an attempt to link -lc twice, once from the command
line use of -lc and once because the linked module specifies that it depends on
-lc.
Two things need to be done to resolve this:
- Make sure LinkLibraries filters out duplicates.
- Turn libc.bc into libc.a (and similarly for all other runtime "libs") so that
if its linked multiple times, its harmless.