Prevent dependency cycle due to system_shared_libs expansion

It was discovered that we were building some objects inconsistently due
to an optimization in cc_library to only build objects once and use them
for both the static and shared libraries. But static libraries didn't
get system_shared_libs set automatically, and we didn't notice that we
would have built the objects differently.

So static libraries now get the default system_shared_libs, we allow
adjusting that for static vs shared in a cc_library, and we disable the
optimization if the linked libraries are configured differently between
static and shared in a single cc_library.

This triggers dependency cycles for static libraries that libc/libdl
use, so fix those cycles here.

Test: treehugger
Change-Id: I3cf7fda161a05ec32e0c1e871999720d12a4d38e
This commit is contained in:
Dan Willemsen 2018-12-03 13:57:20 -08:00
parent 9b849d6391
commit 6b3be172d6
4 changed files with 9 additions and 2 deletions

View File

@ -1 +0,0 @@
subdirs = ["*"]

View File

@ -1623,9 +1623,15 @@ cc_library {
], ],
name: "libstdc++", name: "libstdc++",
static_ndk_lib: true, static_ndk_lib: true,
system_shared_libs: ["libc"],
static_libs: ["libasync_safe"], static_libs: ["libasync_safe"],
static: {
system_shared_libs: [],
},
shared: {
system_shared_libs: ["libc"],
},
//TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
arch: { arch: {
arm: { arm: {

View File

@ -22,6 +22,7 @@ cc_library_static {
include_dirs: ["bionic/libc"], include_dirs: ["bionic/libc"],
stl: "none", stl: "none",
system_shared_libs: [],
sanitize: { sanitize: {
never: true, never: true,

View File

@ -283,6 +283,7 @@ cc_binary {
suffix: "64", suffix: "64",
}, },
}, },
system_shared_libs: [],
target: { target: {
android: { android: {
static_libs: ["libdebuggerd_handler_fallback"], static_libs: ["libdebuggerd_handler_fallback"],