Revert "Copy cc_object output files to a name that matches the m..."
Revert submission 2216822
Reason for revert: DroidMonitor: Potential culprit for Bug 247028852
Reverted Changes:
I086bb0d14:Copy cc_object output files to a name that matches...
I868cb8b5b:Drop dependency on musl_linker_script
Ib9b5530d3:Run __libc_start_main directly
I1a197dc5c:Move replacement program headers into bss
If59613374:Support missing PT_PHDR
Icb7d8d3e0:Remove note from relinterp
I05cdee7a4:Remove ldso_trampoline_debugger.c
Change-Id: Iecbc09297b59fae18c6d4068048fc19c23dbf9d8
diff --git a/cc/object.go b/cc/object.go
index 20eef30..65a11e0 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -256,18 +256,13 @@
builderFlags := flagsToBuilderFlags(flags)
if len(objs.objFiles) == 1 && String(object.Properties.Linker_script) == "" {
- output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
- outputFile = output
+ outputFile = objs.objFiles[0]
if String(object.Properties.Prefix_symbols) != "" {
- transformBinaryPrefixSymbols(ctx, String(object.Properties.Prefix_symbols), objs.objFiles[0],
+ output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
+ transformBinaryPrefixSymbols(ctx, String(object.Properties.Prefix_symbols), outputFile,
builderFlags, output)
- } else {
- ctx.Build(pctx, android.BuildParams{
- Rule: android.Cp,
- Input: objs.objFiles[0],
- Output: output,
- })
+ outputFile = output
}
} else {
output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
diff --git a/cc/object_test.go b/cc/object_test.go
index 00f83d4..259a892 100644
--- a/cc/object_test.go
+++ b/cc/object_test.go
@@ -15,7 +15,6 @@
package cc
import (
- "fmt"
"testing"
"android/soong/android"
@@ -108,53 +107,3 @@
expectedOutputFiles := []string{"outputbase/execroot/__main__/bazel_out.o"}
android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
}
-
-func TestCcObjectOutputFile(t *testing.T) {
- testcases := []struct {
- name string
- bp string
- }{
- {
- name: "normal",
- bp: `
- srcs: ["bar.c"],
- `,
- },
- {
- name: "keep symbols",
- bp: `
- srcs: ["bar.c"],
- prefix_symbols: "foo_",
- `,
- },
- {
- name: "partial linking",
- bp: `
- srcs: ["bar.c", "baz.c"],
- `,
- },
- {
- name: "partial linking and prefix symbols",
- bp: `
- srcs: ["bar.c", "baz.c"],
- prefix_symbols: "foo_",
- `,
- },
- }
-
- for _, testcase := range testcases {
- bp := fmt.Sprintf(`
- cc_object {
- name: "foo",
- %s
- }
- `, testcase.bp)
- t.Run(testcase.name, func(t *testing.T) {
- ctx := PrepareForIntegrationTestWithCc.RunTestWithBp(t, bp)
- android.AssertPathRelativeToTopEquals(t, "expected output file foo.o",
- "out/soong/.intermediates/foo/android_arm64_armv8-a/foo.o",
- ctx.ModuleForTests("foo", "android_arm64_armv8-a").Output("foo.o").Output)
- })
- }
-
-}