Ninja and shell escape command line flags
Strings like cflags in Android.bp files are parsed by blueprint, written to build.ninja files, parsed by ninja, and then passed to /bin/sh -c. This had resulted in a combination of blueprint (\"), ninja ($$), and shell (\$) escaping being necessary. Update Soong to automatically handle ninja and shell escaping in cflags and ldflags. Bug: 31221587 Test: m -j Change-Id: Ibe087b2788b355b73c3225b5928870619a0a53bc
This commit is contained in:
@@ -17,6 +17,8 @@ package cc
|
||||
import (
|
||||
"android/soong/android"
|
||||
"fmt"
|
||||
|
||||
"github.com/google/blueprint/proptools"
|
||||
)
|
||||
|
||||
// This file contains the basic functionality for linking against static libraries and shared
|
||||
@@ -167,7 +169,7 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||
|
||||
CheckBadLinkerFlags(ctx, "ldflags", linker.Properties.Ldflags)
|
||||
|
||||
flags.LdFlags = append(flags.LdFlags, linker.Properties.Ldflags...)
|
||||
flags.LdFlags = append(flags.LdFlags, proptools.NinjaAndShellEscape(linker.Properties.Ldflags)...)
|
||||
|
||||
if ctx.Host() {
|
||||
rpath_prefix := `\$$ORIGIN/`
|
||||
|
Reference in New Issue
Block a user