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

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 08:10:53 PDT 2015


Author: davide
Date: Tue Oct 27 10:10:53 2015
New Revision: 251408

URL: http://llvm.org/viewvc/llvm-project?rev=251408&view=rev
Log:
[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.

Modified:
    lld/trunk/ELF/Options.td
    lld/trunk/test/elf2/libsearch.s

Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=251408&r1=251407&r2=251408&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Tue Oct 27 10:10:53 2015
@@ -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">;

Modified: lld/trunk/test/elf2/libsearch.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/libsearch.s?rev=251408&r1=251407&r2=251408&view=diff
==============================================================================
--- lld/trunk/test/elf2/libsearch.s (original)
+++ lld/trunk/test/elf2/libsearch.s Tue Oct 27 10:10:53 2015
@@ -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




More information about the llvm-commits mailing list