diff options
Diffstat (limited to 'bpf/bpf.go')
-rw-r--r-- | bpf/bpf.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bpf/bpf.go b/bpf/bpf.go index 60a410d7f..a840fa3df 100644 --- a/bpf/bpf.go +++ b/bpf/bpf.go @@ -18,11 +18,13 @@ import ( "fmt" "io" "path/filepath" + "runtime" "strings" "android/soong/android" "android/soong/bazel" "android/soong/bazel/cquery" + "android/soong/cc" "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -31,6 +33,7 @@ import ( func init() { registerBpfBuildComponents(android.InitRegistrationContext) pctx.Import("android/soong/cc/config") + pctx.StaticVariable("relPwd", cc.PwdPrefix()) } var ( @@ -40,7 +43,7 @@ var ( blueprint.RuleParams{ Depfile: "${out}.d", Deps: blueprint.DepsGCC, - Command: "$ccCmd --target=bpf -c $cFlags -MD -MF ${out}.d -o $out $in", + Command: "$relPwd $ccCmd --target=bpf -c $cFlags -MD -MF ${out}.d -o $out $in", CommandDeps: []string{"$ccCmd"}, }, "ccCmd", "cFlags") @@ -164,6 +167,9 @@ func (bpf *bpf) GenerateAndroidBuildActions(ctx android.ModuleContext) { if proptools.Bool(bpf.properties.Btf) { cflags = append(cflags, "-g") + if runtime.GOOS != "darwin" { + cflags = append(cflags, "-fdebug-prefix-map=/proc/self/cwd=") + } } srcs := android.PathsForModuleSrc(ctx, bpf.properties.Srcs) |