aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2019-06-11 13:45:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-06-11 13:45:25 +0000
commitd7607c1c99d445d3aae93c25f492ed7a6fc53c07 (patch)
treeafc6cd437fe68d5a05667b829209206e7c3325de
parenta53ae43180975b2b0c725ccd33a1d79710ca0a5f (diff)
parent9efb8c773f0c2ba32cdf295b6224f4b31bf23aa0 (diff)
downloadbuild_soong-d7607c1c99d445d3aae93c25f492ed7a6fc53c07.tar.gz
build_soong-d7607c1c99d445d3aae93c25f492ed7a6fc53c07.tar.bz2
build_soong-d7607c1c99d445d3aae93c25f492ed7a6fc53c07.zip
Merge "Have `symlink_preferred_arch: true` honor the `stem` property."
-rw-r--r--cc/binary.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/cc/binary.go b/cc/binary.go
index 941f1317..d0909f16 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -106,13 +106,17 @@ func (binary *binaryDecorator) linkerProps() []interface{} {
}
-func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
+func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
stem := ctx.baseModuleName()
if String(binary.Properties.Stem) != "" {
stem = String(binary.Properties.Stem)
}
- return stem + String(binary.Properties.Suffix)
+ return stem
+}
+
+func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
+ return binary.getStemWithoutSuffix(ctx) + String(binary.Properties.Suffix)
}
func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
@@ -398,11 +402,11 @@ func (binary *binaryDecorator) link(ctx ModuleContext,
}
if Bool(binary.Properties.Symlink_preferred_arch) {
- if String(binary.Properties.Stem) == "" && String(binary.Properties.Suffix) == "" {
- ctx.PropertyErrorf("symlink_preferred_arch", "must also specify stem or suffix")
+ if String(binary.Properties.Suffix) == "" {
+ ctx.PropertyErrorf("symlink_preferred_arch", "must also specify suffix")
}
if ctx.TargetPrimary() {
- binary.symlinks = append(binary.symlinks, ctx.baseModuleName())
+ binary.symlinks = append(binary.symlinks, binary.getStemWithoutSuffix(ctx))
}
}