summaryrefslogtreecommitdiff
path: root/native_bridge_support.mk
blob: 7e5d243fdafe8fddc7fe7ea662040376f39ce038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#
# Copyright 2020 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# This makefile exports
#
# NATIVE_BRIDGE_PRODUCT_PACKAGES: Add this to PRODUCT_PACKAGES for your project to facilitate
# native bridge support.
#
# NATIVE_BRIDGE_PRODUCT_PACKAGES_ARM: arm32-only product packages.
#
# NATIVE_BRIDGE_PRODUCT_PACKAGES_RISCV64_READY: products packages ready for riscv64 translation.
# Currently same as NATIVE_BRIDGE_PRODUCT_PACKAGES excluding render script.
#
# NATIVE_BRIDGE_MODIFIED_GUEST_LIBS: List of modified guest libraries that require host counterpart.
#

# Note: When modifying this variable, please also update the `phony_deps` of
#       `berberis_riscv64_to_x86_64_defaults` in
#       frameworks/libs/binary_translation/Android.bp.
NATIVE_BRIDGE_PRODUCT_PACKAGES := \
    libnative_bridge_vdso.native_bridge \
    native_bridge_guest_app_process.native_bridge \
    native_bridge_guest_linker.native_bridge

# TODO(b/141167717): using "bootstrap" to make APEX libraries compatible with native bridge:
#
# If library is APEX-enabled:
#
#   Then "libraryname" is not installed in the  /system/lib since it's
#   supposed to be installed into APEX.
#
#   However, "libraryname.bootstrap" goes into /system/lib/bootstrap.
#
#   Native bridge isn't compatible with APEX yet thus "libraryname.native_bridge"
#   is not installed anywhere at all.
#
#   However, "libraryname.bootstrap.native_bridge" gets installed into
#   /system/lib/$GUEST_ARCH/ - as we need for native bridge.
#
# Note: this doesn't affect native libraries at all.
#
# These two libs cannot be built directly since they are not part of the official NDK,
# but they are poperly built as the requirements for libicu.bootstrap:
# libicui18n.bootstrap
# libicuuc.bootstrap

# Note: When modifying this variable, please also update the `phony_deps` of
#       `berberis_riscv64_to_x86_64_defaults` in
#       frameworks/libs/binary_translation/Android.bp.
# Original guest libraries.
NATIVE_BRIDGE_ORIG_GUEST_LIBS := \
    libandroidicu.bootstrap \
    libcompiler_rt \
    libcrypto \
    libcutils \
    libdl.bootstrap \
    libdl_android.bootstrap \
    libicu.bootstrap \
    liblog \
    libm.bootstrap \
    libsqlite \
    libssl \
    libstdc++ \
    libsync \
    libutils \
    libz

# Note: When modifying this variable, please also update the `phony_deps` of
#       `berberis_riscv64_to_x86_64_defaults` in
#       frameworks/libs/binary_translation/Android.bp.
# These libraries need special support on the native bridge implementation side.
NATIVE_BRIDGE_MODIFIED_GUEST_LIBS := \
    libaaudio \
    libamidi \
    libandroid \
    libandroid_runtime \
    libbinder_ndk \
    libc \
    libcamera2ndk \
    libEGL \
    libGLESv1_CM \
    libGLESv2 \
    libGLESv3 \
    libjnigraphics \
    libmediandk \
    libnativehelper \
    libnativewindow \
    libneuralnetworks \
    libOpenMAXAL \
    libOpenSLES \
    libvulkan \
    libwebviewchromium_plat_support

# Original guest libraries are built for native_bridge
NATIVE_BRIDGE_PRODUCT_PACKAGES += \
    $(addsuffix .native_bridge,$(NATIVE_BRIDGE_ORIG_GUEST_LIBS))

# Modified guest libraries are built for native_bridge and
# have special build target prefix
NATIVE_BRIDGE_PRODUCT_PACKAGES += \
    $(addprefix libnative_bridge_guest_,$(addsuffix .native_bridge,$(NATIVE_BRIDGE_MODIFIED_GUEST_LIBS)))

# TODO(b/277625560): Deprecate after we deside what to do with renderscript
NATIVE_BRIDGE_PRODUCT_PACKAGES_RISCV64_READY := $(NATIVE_BRIDGE_PRODUCT_PACKAGES)

# Renderscript specific files/libraries
NATIVE_BRIDGE_PRODUCT_PACKAGES += \
    libclcore.bc

# libclcore_neon.bc is arm32 only.
NATIVE_BRIDGE_PRODUCT_PACKAGES_ARM := \
    libclcore_neon.bc

NATIVE_BRIDGE_RS_ORIG_GUEST_LIBS += \
    libRS \
    libRSDriver \
    libnative_bridge_guest_libRSSupport

NATIVE_BRIDGE_PRODUCT_PACKAGES += \
    $(addsuffix .native_bridge,$(NATIVE_BRIDGE_RS_ORIG_GUEST_LIBS))

NATIVE_BRIDGE_ORIG_GUEST_LIBS :=
NATIVE_BRIDGE_RS_ORIG_GUEST_LIBS :=