From 4098c7eddfd488fe77508bcde0bbae55b8574e2d Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Mon, 30 Nov 2020 14:42:14 +0900 Subject: [PATCH] Add linkerconfig to Runtime APEX Add linkerconfig to Runtime APEX module. Bug: 165769179 Test: Cuttlefish boot succeeded Change-Id: I31c4bfa2ce88b64d7100f227ec289416db253b13 --- apex/apex.go | 4 +++- cc/cc.go | 2 +- linkerconfig/proto/Android.bp | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apex/apex.go b/apex/apex.go index f127757b3..f8fb3550c 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -2013,7 +2013,9 @@ func (a *apexBundle) checkStaticLinkingToStubLibraries(ctx android.ModuleContext // The dynamic linker and crash_dump tool in the runtime APEX is the only // exception to this rule. It can't make the static dependencies dynamic // because it can't do the dynamic linking for itself. - if apexName == "com.android.runtime" && (fromName == "linker" || fromName == "crash_dump") { + // Same rule should be applied to linkerconfig, because it should be executed + // only with static linked libraries before linker is available with ld.config.txt + if apexName == "com.android.runtime" && (fromName == "linker" || fromName == "crash_dump" || fromName == "linkerconfig") { return false } diff --git a/cc/cc.go b/cc/cc.go index 6deb1b404..5f028b8a3 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1074,7 +1074,7 @@ func (c *Module) ExcludeFromRecoverySnapshot() bool { func isBionic(name string) bool { switch name { - case "libc", "libm", "libdl", "libdl_android", "linker": + case "libc", "libm", "libdl", "libdl_android", "linker", "linkerconfig": return true } return false diff --git a/linkerconfig/proto/Android.bp b/linkerconfig/proto/Android.bp index c04887e9b..4d971288d 100644 --- a/linkerconfig/proto/Android.bp +++ b/linkerconfig/proto/Android.bp @@ -7,6 +7,10 @@ cc_library_static { type: "lite", }, srcs: ["linker_config.proto"], + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], } python_library_host {