[LLVMbugs] [Bug 466] NEW: llvm::LinkLibraries fails if same library given twice

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Dec 1 16:44:40 PST 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=466

           Summary: llvm::LinkLibraries fails if same library given twice
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com


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:

1. Make sure LinkLibraries filters out duplicates.
2. Turn libc.bc into libc.a (and similarly for all other runtime "libs") so that
if its linked multiple times, its harmless.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list