aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/pie_flags.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-06-24 09:31:39 -0700
committerTobias Bosch <tbosch@google.com>2019-06-28 19:00:23 +0000
commit900dbc92800d8fc927905db29cb302461054cf97 (patch)
treec74ecbfb01ee4ee679090139596aef3546f19d9b /compiler_wrapper/pie_flags.go
parent739e6abb2cd03b60e579df31ad55870a4a00260a (diff)
downloadtoolchain-utils-900dbc92800d8fc927905db29cb302461054cf97.tar.gz
Introduce infrastructure for calling and testing nested
commands, error messages and exit codes. Also: - implements the -Xclang-path= flag as use case of calling a nested command. - adds tests for forwarding errors, comparing against the old wrapper, and exit codes. - captures the source locations of errors in error messages. - compares exit codes of new wrapper and old wrapper. BUG=chromium:773875 TEST=unit test Change-Id: I919e58091d093d68939809f676f799a68ec7a34e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1676833 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper/pie_flags.go')
-rw-r--r--compiler_wrapper/pie_flags.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler_wrapper/pie_flags.go b/compiler_wrapper/pie_flags.go
index 73b3a224..167f1193 100644
--- a/compiler_wrapper/pie_flags.go
+++ b/compiler_wrapper/pie_flags.go
@@ -13,11 +13,11 @@ func processPieFlags(builder *commandBuilder) {
fpie := false
if builder.target.abi != "eabi" {
for _, arg := range builder.args {
- if arg.FromUser {
- if fpieMap[arg.Value] {
+ if arg.fromUser {
+ if fpieMap[arg.value] {
fpie = true
}
- if pieMap[arg.Value] {
+ if pieMap[arg.value] {
pie = true
}
}
@@ -25,15 +25,15 @@ func processPieFlags(builder *commandBuilder) {
}
builder.transformArgs(func(arg builderArg) string {
// Remove -nopie as it is a non-standard flag.
- if arg.Value == "-nopie" {
+ if arg.value == "-nopie" {
return ""
}
- if fpie && !arg.FromUser && arg.Value == "-fPIE" {
+ if fpie && !arg.fromUser && arg.value == "-fPIE" {
return ""
}
- if pie && !arg.FromUser && arg.Value == "-pie" {
+ if pie && !arg.fromUser && arg.value == "-pie" {
return ""
}
- return arg.Value
+ return arg.value
})
}