[ELF2/Driver] Accept both -L <arg> and -L<arg>.

This matches ld.bfd and ld.gold behavior. The change is simple enough
and avoid trouble to consumers (they don't have to change their Makefiles).
Side note: found while trying to build FreeBSD base system with lld.

llvm-svn: 251408
This commit is contained in:
Davide Italiano 2015-10-27 15:10:53 +00:00
parent ba7d9071fe
commit ce0d48adbb
2 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@ def Bdynamic: Flag<["-"], "Bdynamic">,
def Bstatic: Flag<["-"], "Bstatic">,
HelpText<"Do not link against shared libraries">;
def L : Joined<["-"], "L">, MetaVarName<"<dir>">,
def L : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
HelpText<"Directory to search for libraries">;
def O : Joined<["-"], "O">, HelpText<"Optimize">;

View File

@ -26,7 +26,8 @@
// NOLIB: Unable to find library -lls
// Should use explicitly specified static library
// RUN: ld.lld2 -o %t3 %t.o -L%t.dir -l:libls.a
// Also ensure that we accept -L <arg>
// RUN: ld.lld2 -o %t3 %t.o -L %t.dir -l:libls.a
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=STATIC %s
// STATIC: Symbols [
// STATIC: Name: _static