aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper
diff options
context:
space:
mode:
authorJustin TerAvest <teravest@chromium.org>2020-01-10 16:09:58 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-13 20:44:30 +0000
commit9b603275e1de3b0e0c905543d4b501c83c1f1990 (patch)
treed71e8d88cdf1f5a1ef35dd97c253363d9c8beb40 /compiler_wrapper
parent6c213eaaa629554cbfdc14a2bc88aa7dc6c5caf5 (diff)
downloadtoolchain-utils-9b603275e1de3b0e0c905543d4b501c83c1f1990.tar.gz
compiler_wrapper: strip march=tremont for gcc
As for goldmont, tremont is too new a march for the version of gcc that is used. Thus, the flags processor for gcc should translate that request back to silvermont. This is needed to use the new march with clang. BUG=b:147468258 TEST=go test Change-Id: Idc6b04f40fc7f0a663b1ff8ff57df109a2193dad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1995313 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Commit-Queue: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r--compiler_wrapper/gcc_flags.go1
-rw-r--r--compiler_wrapper/gcc_flags_test.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler_wrapper/gcc_flags.go b/compiler_wrapper/gcc_flags.go
index 8775b23b..397bf82d 100644
--- a/compiler_wrapper/gcc_flags.go
+++ b/compiler_wrapper/gcc_flags.go
@@ -14,6 +14,7 @@ func processGccFlags(builder *commandBuilder) {
"-march=goldmont": "-march=silvermont",
"-march=goldmont-plus": "-march=silvermont",
"-march=skylake": "-march=corei7",
+ "-march=tremont": "-march=silvermont",
}
builder.transformArgs(func(arg builderArg) string {
diff --git a/compiler_wrapper/gcc_flags_test.go b/compiler_wrapper/gcc_flags_test.go
index 436f9521..8f8e9023 100644
--- a/compiler_wrapper/gcc_flags_test.go
+++ b/compiler_wrapper/gcc_flags_test.go
@@ -37,6 +37,7 @@ func TestConvertClangToGccFlags(t *testing.T) {
{"-march=goldmont", "-march=silvermont"},
{"-march=goldmont-plus", "-march=silvermont"},
{"-march=skylake", "-march=corei7"},
+ {"-march=tremont", "-march=silvermont"},
}
for _, tt := range tests {