From 42d1ba2d92a965772d92b3b466dcbddf583cb2f3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 7 Sep 2016 13:15:25 -0700 Subject: [PATCH] Add -z to valid multi-word linker flags Art uses -z muldefs, allow it to be passed as a property. Change-Id: Ief3b252d4b84762dbd49766ecdbebe00b333f523 --- cc/check.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cc/check.go b/cc/check.go index bb2c9dfc5..4e403a58b 100644 --- a/cc/check.go +++ b/cc/check.go @@ -74,7 +74,14 @@ func CheckBadLinkerFlags(ctx BaseModuleContext, prop string, flags []string) { } else if strings.HasPrefix(flag, "-Wl,--version-script") { ctx.PropertyErrorf(prop, "Bad flag: `%s`, use version_script instead", flag) } else if strings.Contains(flag, " ") { - ctx.PropertyErrorf(prop, "Bad flag: `%s` is not an allowed multi-word flag. Should it be split into multiple flags?", flag) + args := strings.Split(flag, " ") + if args[0] == "-z" { + if len(args) > 2 { + ctx.PropertyErrorf(prop, "`-z` only takes one argument: `%s`", flag) + } + } else { + ctx.PropertyErrorf(prop, "Bad flag: `%s` is not an allowed multi-word flag. Should it be split into multiple flags?", flag) + } } } }