Skip to content
Snippets Groups Projects
Commit 30035fe1 authored by Renato Golin's avatar Renato Golin
Browse files

Allow -target= and --target options

Using clang as a cross-compiler with the 'target' option could be confusing
for those inexperienced in the realm of cross compiling.

This patch would allow the use of all these four variants of the target option:
-target <triple>
--target <triple>
-target=<triple>
--target=<triple>

Patch by Gabor Ballabas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231787 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1acd9038
Branches
No related tags found
No related merge requests found
...@@ -1540,7 +1540,7 @@ def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">, ...@@ -1540,7 +1540,7 @@ def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">,
"system header.">; "system header.">;
def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>; def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>;
def s : Flag<["-"], "s">; def s : Flag<["-"], "s">;
def target : Joined<["--"], "target=">, Flags<[DriverOption, CoreOption]>, def target : Joined<["-", "--"], "target=">, Flags<[DriverOption, CoreOption]>,
HelpText<"Generate code for the given target">; HelpText<"Generate code for the given target">;
def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[DriverOption]>, def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[DriverOption]>,
HelpText<"Use the gcc toolchain at the given directory">; HelpText<"Use the gcc toolchain at the given directory">;
...@@ -1713,7 +1713,7 @@ def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<march_EQ>, ...@@ -1713,7 +1713,7 @@ def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
// aliases for options that are spelled using the more common Unix / GNU flag // aliases for options that are spelled using the more common Unix / GNU flag
// style of double-dash and equals-joined flags. // style of double-dash and equals-joined flags.
def gcc_toolchain_legacy_spelling : Separate<["-"], "gcc-toolchain">, Alias<gcc_toolchain>; def gcc_toolchain_legacy_spelling : Separate<["-"], "gcc-toolchain">, Alias<gcc_toolchain>;
def target_legacy_spelling : Separate<["-"], "target">, Alias<target>; def target_legacy_spelling : Separate<["-", "--"], "target">, Alias<target>;
// Special internal option to handle -Xlinker --no-demangle. // Special internal option to handle -Xlinker --no-demangle.
def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">, def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">,
......
...@@ -7,3 +7,9 @@ ...@@ -7,3 +7,9 @@
// Also check that the legacy spelling works. // Also check that the legacy spelling works.
// RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \ // RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \
// RUN: -o %t.o -### 2>&1 | FileCheck %s // RUN: -o %t.o -### 2>&1 | FileCheck %s
//
// RUN: %clang -no-canonical-prefixes -target=unknown-unknown-unknown -c %s \
// RUN: -o %t.o -### 2>&1 | FileCheck %s
//
// RUN: %clang -no-canonical-prefixes --target unknown-unknown-unknown -c %s \
// RUN: -o %t.o -### 2>&1 | FileCheck %s
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment