http://llvm.org/bugs/show_bug.cgi?id=20977

            Bug ID: 20977
           Summary: UniversalDriver incorrectly removes the -flavor /
                    -core switches from its command line
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

UniversalDriver.cpp, the getFlavor function.

When UniversalDriver finds -core or -flavor switch, it tries to remove it from
the command line so that it is not passed to the underlying drivers, such as
the GnuLdDriver. The removal logic is incorrect.

E.g., UniversalDriver does the following to remove -core:
argv++;
argc--;
There are two problems with that:
1) the switch does not necessarily go first in the command line - it can be in
the middle or at the end;
2) this ignores the fact that argv[0] is actually the program name, not a
switch or an option. Program name is skipped instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to