blob: 3e641d3baba762ba08e2fd2a85a62b63ecea1374 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2019 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package main
import (
"strings"
)
func processThumbCodeFlags(builder *commandBuilder) {
arch := builder.target.arch
if builder.target.abi != "eabi" && (strings.HasPrefix(arch, "armv7") || strings.HasPrefix(arch, "armv8")) {
// ARM32 specfic:
// 1. Generate thumb codes by default. GCC is configured with
// --with-mode=thumb and defaults to thumb mode already. This
// changes the default behavior of clang and doesn't affect GCC.
// 2. Do not force frame pointers on ARM32 (https://crbug.com/693137).
builder.addPreUserArgs("-mthumb")
builder.transformArgs(func(arg builderArg) string {
if !arg.fromUser && arg.value == "-fno-omit-frame-pointer" {
return ""
}
return arg.value
})
}
}
|