Loading bp2build/cc_library_conversion_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -2437,3 +2437,18 @@ cc_library { }, ) } func TestCcLibraryEscapeLdflags(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, blueprint: soongCcProtoPreamble + `cc_library { name: "foo", ldflags: ["-Wl,--rpath,${ORIGIN}"], include_build_directory: false, }`, expectedBazelTargets: makeCcLibraryTargets("foo", attrNameToString{ "linkopts": `["-Wl,--rpath,$${ORIGIN}"]`, }), }) } cc/bp2build.go +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion var linkerFlags []string if len(props.Ldflags) > 0 { linkerFlags = append(linkerFlags, props.Ldflags...) linkerFlags = append(linkerFlags, proptools.NinjaEscapeList(props.Ldflags)...) // binaries remove static flag if -shared is in the linker flags if isBinary && android.InList("-shared", linkerFlags) { axisFeatures = append(axisFeatures, "-static_flag") Loading Loading
bp2build/cc_library_conversion_test.go +15 −0 Original line number Diff line number Diff line Loading @@ -2437,3 +2437,18 @@ cc_library { }, ) } func TestCcLibraryEscapeLdflags(t *testing.T) { runCcLibraryTestCase(t, bp2buildTestCase{ moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, blueprint: soongCcProtoPreamble + `cc_library { name: "foo", ldflags: ["-Wl,--rpath,${ORIGIN}"], include_build_directory: false, }`, expectedBazelTargets: makeCcLibraryTargets("foo", attrNameToString{ "linkopts": `["-Wl,--rpath,$${ORIGIN}"]`, }), }) }
cc/bp2build.go +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion var linkerFlags []string if len(props.Ldflags) > 0 { linkerFlags = append(linkerFlags, props.Ldflags...) linkerFlags = append(linkerFlags, proptools.NinjaEscapeList(props.Ldflags)...) // binaries remove static flag if -shared is in the linker flags if isBinary && android.InList("-shared", linkerFlags) { axisFeatures = append(axisFeatures, "-static_flag") Loading