Skip to content

[libc runtime lib] libc.bc is not a .a file #838

@llvmbot

Description

@llvmbot
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:

  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillalibc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions