Current APEX Namespace is named with APEX name itself, which also uses
.(dot) so linker configuration can keep the syntax safe. Update name of
namespace from APEX by replacing '_' with '.' so keep configuration safe
for future syntax update.
Bug:
148826508
Test: m -j passed
Test: boot succeeded from cuttlefish and walleye
Change-Id: I9185c909678e2e39d539622d51d8f378b819b466
// The default namespace here only links to other namespaces, in particular
// "art" where the real library loading takes place. Any outgoing links from
// "art" also need to be present here.
- ns.GetLink("com.android.art").AllowAllSharedLibs();
+ ns.GetLink("com_android_art").AllowAllSharedLibs();
ns.GetLink("system").AllowAllSharedLibs();
ns.AddRequires(std::vector{"libadbconnection_client.so"});
// Make the namespace visible to allow links to be created at runtime, e.g.
// through android_link_namespaces in libnativeloader. That is not applicable
// to the vendor section.
- Namespace ns(apex.name,
+ Namespace ns(apex.namespace_name,
/*is_isolated=*/true,
/*is_visible=*/!ctx.IsVendorSection());
Namespace BaseContext::BuildApexNamespace(const ApexInfo& apex_info,
bool visible) const {
- Namespace ns(apex_info.name,
+ Namespace ns(apex_info.namespace_name,
/*is_isolated=*/true,
visible);
InitializeWithApex(ns, apex_info);
*/
#pragma once
+#include <algorithm>
#include <map>
#include <string>
#include <vector>
namespace modules {
struct ApexInfo {
std::string name;
+ std::string namespace_name;
std::string path;
std::vector<std::string> provide_libs;
std::vector<std::string> require_libs;
require_libs(std::move(require_libs)),
has_bin(has_bin),
has_lib(has_lib) {
+ this->namespace_name = this->name;
+ std::replace(
+ this->namespace_name.begin(), this->namespace_name.end(), '.', '_');
}
};