Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 003ace99 authored by Jerome Gaillard's avatar Jerome Gaillard
Browse files

Restrict the symbols exported by libandroid_runtime on host

This explicitly defines which symbols should be exported by
libandroid_runtime on host. This is to avoid potential collisions with
other libraries loaded on a host system.
This also fixes the dist path of the builds.

Flag: NONE host-only change
Bug: 382086021
Test: m libandroid_runtime on host
Change-Id: I3f8c160f0920b56becfe7bf79af7638d534ca200
parent d0194996
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -482,11 +482,22 @@ cc_library_shared_for_libandroid_runtime {
                "libbinder",
                "libhidlbase", // libhwbinder is in here
            ],
            version_script: "platform/linux/libandroid_runtime_export.txt",
        },
        darwin: {
            host_ldlibs: [
                "-framework AppKit",
            ],
            dist: {
                targets: ["layoutlib_jni"],
                dir: "layoutlib_native/darwin",
            },
            exported_symbols_list: "platform/darwin/libandroid_runtime_export.exp",
        },
        linux_glibc_x86_64: {
            ldflags: ["-static-libgcc"],
            dist: {
                targets: ["layoutlib"],
                targets: ["layoutlib_jni"],
                dir: "layoutlib_native/linux",
                tag: "stripped_all",
            },
+38 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2024 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.
#

# symbols needed for the JNI operations
_JNI_OnLoad
_ANativeWindow*

# symbols needed to link with layoutlib_jni
___android_log*
__ZNK7android7RefBase*
__ZN7android4base9SetLogger*
__ZN7android4base10SetAborter*
__ZN7android4base11GetProperty*
__ZN7android4Rect*
__ZN7android5Fence*
__ZN7android7RefBase*
__ZN7android7String*
__ZN7android10VectorImpl*
__ZN7android11BufferQueue*
__ZN7android14AndroidRuntime*
__ZN7android14sp_report_raceEv*
__ZN7android15KeyCharacterMap*
__ZN7android15InputDeviceInfo*
__ZN7android31android_view_InputDevice_create*
__ZN7android53android_view_Surface_createFromIGraphicBufferProducer*
+43 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2024 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.
#

{
  global:
    # symbols needed for the JNI operations
    JNI_OnLoad;
    ANativeWindow*;

    # symbols needed to link with layoutlib_jni
    __android_log*;
    _ZNK7android7RefBase*;
    _ZN7android4base9SetLogger*;
    _ZN7android4base10SetAborter*;
    _ZN7android4base11GetProperty*;
    _ZN7android4Rect*;
    _ZN7android5Fence*;
    _ZN7android7RefBase*;
    _ZN7android7String*;
    _ZN7android10VectorImpl*;
    _ZN7android11BufferQueue*;
    _ZN7android14AndroidRuntime*;
    _ZN7android14sp_report_raceEv*;
    _ZN7android15KeyCharacterMap*;
    _ZN7android15InputDeviceInfo*;
    _ZN7android31android_view_InputDevice_create*;
    _ZN7android53android_view_Surface_createFromIGraphicBufferProducer*;
  local:
    *;
};