[lld] r251497 - [Driver] Accept both -m <emulation> and -m<emulation>

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 22:13:12 PDT 2015


Author: atanasyan
Date: Wed Oct 28 00:13:12 2015
New Revision: 251497

URL: http://llvm.org/viewvc/llvm-project?rev=251497&view=rev
Log:
[Driver] Accept both -m <emulation> and -m<emulation>

GNU linkers accept both variants and at least for MIPS target gcc passes
joined variant of the '-m' option.

Differential Revision: http://reviews.llvm.org/D14133

Modified:
    lld/trunk/ELF/Options.td
    lld/trunk/lib/Driver/GnuLdOptions.td
    lld/trunk/test/elf/Mips/opt-emulation.test
    lld/trunk/test/elf2/emulation.s

Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=251497&r1=251496&r2=251497&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Wed Oct 28 00:13:12 2015
@@ -60,7 +60,7 @@ def init : Separate<["-"], "init">, Meta
 def l : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
   HelpText<"Root name of library to use">;
 
-def m : Separate<["-"], "m">,
+def m : JoinedOrSeparate<["-"], "m">,
   HelpText<"Set target emulation">;
 
 def no_allow_shlib_undefined : Flag<["--"], "no-allow-shlib-undefined">;

Modified: lld/trunk/lib/Driver/GnuLdOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdOptions.td?rev=251497&r1=251496&r2=251497&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdOptions.td (original)
+++ lld/trunk/lib/Driver/GnuLdOptions.td Wed Oct 28 00:13:12 2015
@@ -71,7 +71,7 @@ def grp_general : OptionGroup<"opts">,
 def output : Separate<["-"], "o">, MetaVarName<"<path>">,
      HelpText<"Path to file to write output">,
      Group<grp_general>;
-def m : Separate<["-"], "m">, MetaVarName<"<emulation>">,
+def m : JoinedOrSeparate<["-"], "m">, MetaVarName<"<emulation>">,
      HelpText<"Select target emulation">,
      Group<grp_general>;
 def build_id : Flag<["--"], "build-id">,

Modified: lld/trunk/test/elf/Mips/opt-emulation.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/opt-emulation.test?rev=251497&r1=251496&r2=251497&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/opt-emulation.test (original)
+++ lld/trunk/test/elf/Mips/opt-emulation.test Wed Oct 28 00:13:12 2015
@@ -3,6 +3,8 @@
 # RUN: yaml2obj -format=elf %s > %t-obj
 # RUN: lld -flavor gnu -target mipsel -m elf32ltsmip -o %t-exe %t-obj
 # RUN: llvm-readobj -file-headers %t-exe | FileCheck -check-prefix=LE-O32 %s
+# RUN: lld -flavor gnu -target mipsel -melf32ltsmip -o %t-exe %t-obj
+# RUN: llvm-readobj -file-headers %t-exe | FileCheck -check-prefix=LE-O32 %s
 
 # LE-O32:      Class: 32-bit (0x1)
 # LE-O32:      DataEncoding: LittleEndian (0x1)

Modified: lld/trunk/test/elf2/emulation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/emulation.s?rev=251497&r1=251496&r2=251497&view=diff
==============================================================================
--- lld/trunk/test/elf2/emulation.s (original)
+++ lld/trunk/test/elf2/emulation.s Wed Oct 28 00:13:12 2015
@@ -118,6 +118,8 @@
 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %tmipsel
 # RUN: lld -flavor gnu2 -m elf32ltsmip -e _start %tmipsel -o %t2mipsel
 # RUN: llvm-readobj -file-headers %t2mipsel | FileCheck --check-prefix=MIPSEL %s
+# RUN: lld -flavor gnu2 -melf32ltsmip -e _start %tmipsel -o %t2mipsel
+# RUN: llvm-readobj -file-headers %t2mipsel | FileCheck --check-prefix=MIPSEL %s
 # RUN: lld -flavor gnu2 %tmipsel -e _start -o %t3mipsel
 # RUN: llvm-readobj -file-headers %t3mipsel | FileCheck --check-prefix=MIPSEL %s
 # MIPSEL:      ElfHeader {




More information about the llvm-commits mailing list