diff options
author | 2019-06-05 13:31:31 +0100 | |
---|---|---|
committer | 2019-06-10 15:03:44 +0100 | |
commit | 9efb8c773f0c2ba32cdf295b6224f4b31bf23aa0 (patch) | |
tree | 3a0148ac5950361aa5375a6cf88ba4e7849fe551 /cc | |
parent | 50e91c1a7a93077989cc590ea3878c46b3df4ba8 (diff) |
Have `symlink_preferred_arch: true` honor the `stem` property.
If a module defines a `stem` property, use it to name the symlink
created for `symlink_preferred_arch: true` (instead of the module's
name).
Also always require suffixes when using `symlink_preferred_arch: true`.
Test: m
Change-Id: Ia8a56f94d21599194797ef8b259f5f03e08cb16a
Diffstat (limited to 'cc')
-rw-r--r-- | cc/binary.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cc/binary.go b/cc/binary.go index 9bb0b1673..476803fc5 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)) } } |