[PATCH] D14133: [Driver] Accept both -m <emulation> and -m<emulation>

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 15:11:40 PDT 2015


atanasyan created this revision.
atanasyan added reviewers: ruiu, rafael.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
Herald added a subscriber: dsanders.

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

Repository:
  rL LLVM

http://reviews.llvm.org/D14133

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

Index: test/elf2/emulation.s
===================================================================
--- test/elf2/emulation.s
+++ test/elf2/emulation.s
@@ -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 {
Index: test/elf/Mips/opt-emulation.test
===================================================================
--- test/elf/Mips/opt-emulation.test
+++ test/elf/Mips/opt-emulation.test
@@ -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)
Index: lib/Driver/GnuLdOptions.td
===================================================================
--- lib/Driver/GnuLdOptions.td
+++ lib/Driver/GnuLdOptions.td
@@ -71,7 +71,7 @@
 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">,
Index: ELF/Options.td
===================================================================
--- ELF/Options.td
+++ ELF/Options.td
@@ -60,7 +60,7 @@
 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">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14133.38602.patch
Type: text/x-patch
Size: 2332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151027/ec50bca5/attachment.bin>


More information about the llvm-commits mailing list