From: Rui Ueyama Date: Fri, 9 Sep 2016 00:25:56 +0000 (+0000) Subject: Fix -output option. X-Git-Tag: llvmorg-4.0.0-rc1~10267 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a60058c8f5e9d44fba334230456a3432e0f00483;p=platform%2Fupstream%2Fllvm.git Fix -output option. Usually, options that are longer than one character can be preceded either by "-" or "--", but options starting with "o" are exceptions because they conflict with "-o" option. They have to be preceded by "--". llvm-svn: 281004 --- diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index d4ee652..881d163 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -215,8 +215,8 @@ def alias_fini_fini: J<"fini=">, Alias; def alias_hash_style_hash_style: J<"hash-style=">, Alias; def alias_init_init: J<"init=">, Alias; def alias_l__library: J<"library=">, Alias; -def alias_o_output: J<"output=">, Alias; -def alias_o_output2 : S<"output">, Alias; +def alias_o_output: Joined<["--"], "output=">, Alias; +def alias_o_output2 : Separate<["--"], "output">, Alias; def alias_pie_pic_executable: F<"pic-executable">, Alias; def alias_relocatable_r: Flag<["-"], "r">, Alias; def alias_rpath_R: Joined<["-"], "R">, Alias; diff --git a/lld/test/ELF/driver.test b/lld/test/ELF/driver.test index cc86ff2..804da98 100644 --- a/lld/test/ELF/driver.test +++ b/lld/test/ELF/driver.test @@ -44,6 +44,14 @@ # RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s # ERR6: -shared and -pie may not be used together +## "--output=foo" is equivalent to "-o foo". +# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR7 %s +# ERR7: failed to open /no/such/file + +## "-output=foo" is equivalent to "-o utput=foo". +# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s +# ERR8: failed to open utput=/no/such/file + .globl _start _start: nop