[LLVMbugs] [Bug 12703] New: Using -Wl, <anything> causes Clang to emit an erroneous error message

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 30 01:00:12 PDT 2012


             Bug #: 12703
           Summary: Using -Wl,<anything> causes Clang to emit an erroneous
                    error message
           Product: clang
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: johnw at boostpro.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

You cannot use -Wl or -Xlinker if you also use -o on a compile/link line.  

    /usr/local/bin/clang++ -o system.hh.gch system.hh -Wl,-L/usr/local/lib

Outputs this error:

    clang-3: error: cannot specify -o when generating multiple output files

This prevents me from adding anything to the link line from a simple compile 
command (and yes, I could use -L here instead of -Wl,-L, but this isn't 
actually why I'm using -Wl, I just wanted to make it more obvious that the 
behavior is wrong).

Here is the code that's going wrong, Driver.cpp, around line 1189:

  // It is an error to provide a -o option if we are making multiple output
  // files.
  if (FinalOutput) {
    unsigned NumOutputs = 0;
    for (ActionList::const_iterator it = C.getActions().begin(),
           ie = C.getActions().end(); it != ie; ++it)
      if ((*it)->getType() != types::TY_Nothing)

    if (NumOutputs > 1) {
      FinalOutput = 0;

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list