Commit graph

32 commits

Author SHA1 Message Date
Steven Moreland
54db200b21 try llndk-deprecate
No implementation required - seems to be ignored rather
than a failure

FIXME: should use vendor version, and be squashed into parent CL?

Bug: 300366609
Test: build
Change-Id: I19fd3871085f435c6ec55ac5e15e4769d7f3e450
2023-12-21 02:09:14 +00:00
Kiyoung Kim
ebbf9753e9 Deprecate android_is_in_vendor_process
android_is_in_vnedor_process previously checked if current process is in
system(-ish) section by trying to open vndk namespace. However, this
would not work once VNDK is deprecated. As there is no clear way to
replace this, and there is few usage on this API, it would be better
deprecated, and be implemented from each module if required.

Bug: 300366609
Test: AOSP CF build and boot succeeded
Change-Id: I70c70efb36199e12d4877ea4ecb39dbf94653551
2023-12-21 02:06:56 +00:00
Steven Moreland
5248c5d72a libvndksupport: log sphal namespace fallback
If someone is trying to use the sphal namespace, but it
isn't available, we should probably fix this code or add an
sphal namespace there or similar. Add log for more clarity.

Bug: N/A
Test: boot cuttlefish, this doesn't get logged
Change-Id: I2fd2cddc90f529218c99ede8daf2891d84ceb94c
2023-10-03 17:13:10 +00:00
Jiyong Park
d97e52d888 Replace #apex with #systemapi
Currently, for an API symbol to be accessible to APEXes, it needs to be
marked as either # systemapi or # apex. It was originally just # apex,
but we added # systemapi to clearly identify the origin of the APIs.

The intended use is

* #apex is for APEX-visible symbols that are defined in an APEX
* #systemapi is for APEX-visible symbols that are defined in the
  platform (the non-updatable part)

This intention is documented build/soong/docs/map_files.md, but isn't
enforced at all.

With b/239274367, this is now enforced and therefore the #apex tags in
the platform library are replaced with `#systemapi`

This change does not alter any functionality.

Bug: 239274367
Test: m
Change-Id: Ibdb9122c9969749e055404078bc2280edaa7346d
2022-07-17 17:43:24 +09:00
Jiyong Park
94bddf13e8 Add libvndksupport-tests to TEST_MAPPING
Bug: 208849199
Test: atest libvndksupport-tests, watch TH
Change-Id: I9617601d642b9f45f142c6bb483d6edf720566b6
2022-03-08 09:53:55 +09:00
Kiyoung Kim
b77377e62f Check vendor namespace for SPHAL namespace
Vendor APEX section should not separate SPHAL in generic, and also
default namespace does not contain vendor libs in the scope. This change
updates libvndksupport to check 'vendor' namespace when there is no
sphal namespace for vendor APEX section case.

Bug: 193861508
Test: AOSP CF x86_64 boot succeeded
Change-Id: I04cefc12be4c8ec261efb1688a8307b7061bf068
2021-11-22 10:57:44 +09:00
Colin Cross
176ec1b805 Replace llndk_library with llndk clause in cc_library
Remove the vestigial llndk_library modules and replace them with
properties in the llndk clause of the implementation cc_library.

Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Change-Id: Ie3a1bffcf29bb1b6747f7f708826c61bd43ba5a1
2021-04-21 19:13:41 -07:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Colin Cross
6a2b16693c Make the connection between implementation and llndk_library explicit
Instead of assuming a module with the .llndk suffix exists, add an
llndk_stubs property to every cc_library module that has a
corresponding llndk_library.  Also rename the llndk_library to have
an explicit .llndk suffix.

Bug: 170784825
Test: no changes to build.ninja (excluding comments) or Android-${TARGET_PRODUCT}.mk
Change-Id: Ifba79a1ae64a67a9d7393dac2fb012cd8af8e149
2020-10-19 13:38:05 -07:00
Steven Moreland
e40e4270e8 remove deprecated bp 'subdirs'
noticed some, so thought I would remove them everywhere here

Bug: N/A
Test: N/A
Change-Id: I2978673b158d6c253914ea22f7f0129e446a5f91
2020-01-14 12:18:40 -08:00
Peter Collingbourne
683192270f Stop using weak symbols in libvndksupport.
These weak symbols are no longer necessary because we no longer
need to statically link libvndksupport.

Furthermore, these symbols are not really optional when libvndksupport is
dynamically linked. When the library is linked with --as-needed the linker
may drop the reference to libdl_android.so, which leads to a failure to boot.

Bug: 146456667
Change-Id: I4d2290d8d0206e0d89665d4d872a7c53b3e1531b
2019-12-17 17:52:05 -08:00
Jiyong Park
b2542d2942 Rename # vndk tag to # llndk
The APIs that are tagged with # vndk are actually for LLNDK libraries.
Although LLNDK is part of VNDK, calling those APIs 'vndk' has given
users a wrong perception that the APIs don't need to be kept stable
because that's the norm for most of the VNDK libraries that are not
LLNDK.

In order to eliminate the misunderstanding, rename the tag to 'llndk' so
that people introducing new such API will realize what they are signing
themselves up for.

Bug: 143765505
Test: m
Merged-In: Iae2acdf1ff4097a64a5c6280797c66abb1d5a5e6
(cherry picked from commit 0e957b82c8)
Change-Id: Iae2acdf1ff4097a64a5c6280797c66abb1d5a5e6
2019-11-13 14:32:44 +09:00
Ryan Prichard
8c733615aa Make android_load_sphal_library thread-safe
Also: remove an obsolete comment from linker_test.cpp. The test program is
at /data/nativetest[64]/libvndksupport-tests/libvndksupport-tests, which
may will be in the system or legacy configuration, and either the "sphal"
or "default" namespace will be visible.

Bug: none
Test: run libvndksupport-tests, device boots
Change-Id: I5e33e5bf1402a0368e046b03827c216789b02c96
2019-07-15 13:58:51 -07:00
Ryan Prichard
807d9d62d8 Switch libvndksupport's linker.c to C++
Bug: none
Test: device boots
Change-Id: I64237006a7f903647c8d8f7ca681b1da23ac53a9
2019-07-15 13:43:05 -07:00
dimitry
15f8ce36e2 Enable native_bridge_support for libvndksupport
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libvndksupport
a dependency of libutils greylisted library (available for apps
targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I8186718c5efee25261a9946ffb52df5f675bec26
2019-05-16 14:20:31 +02:00
dimitry
0c11941468 Add dependency on libdl_android
platform private symbols have been moved to libdl_android.so
since they are not intended to be accessible from apps.

Test: make
Bug: http://b/129387775
Change-Id: I883a6d2ca588a258dd43efa766fad4e07428594e
(cherry picked from commit e3d0383d38)
2019-03-28 12:52:27 +01:00
Jayant Chowdhary
a229d3e23e Special case init for android_is_in_vendor_process.
Init is executed without ld.config.<ver>.txt loaded (since sysprop
service isn't up in order for it to read ro.vndk.version and know <ver>). It uses the hard-coded
namespaces in the linker and therefore, does not know about the vndk namespace. That does not mean
it is not a system process.

Bug: 124128212

Test: Boot up device with selinux enforced, use camera to take pictures/ record videos (sanity)
Test: Watch movies on youtube (sanity)

Change-Id: If8701af2ee5dfa3bb36d0ce0a17a23808d184d9f
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2019-03-11 11:18:06 -07:00
Vic Yang
a117f25b4e libvndksupport: Add android_is_in_vendor_process()
In preparation for cleaning up conditionally compiled VNDK libraries,
we need a function that determines if the current process is running in
the system process or the vendor process.

Bug: 119423884
Test: Add a dummy VNDK library that prints different string in system
      vs vendor process.  Use the library in different processs and
      check the output.

Change-Id: Ic00927d8eadd2a21fcba9cb64cc93eaadd5bdd2d
2019-02-12 20:28:38 -08:00
Dongwon Kang
9dff515bdb Exclude libvndksupport from APEXes.
Test: build, boot, and checked mount paths.
Bug: 123948402
Change-Id: I687dde4f3d1a7971f68c7c536de5002dcdaecfa4
2019-02-11 11:14:11 -08:00
Elliott Hughes
dc699a269f bpfmt.
Bug: N/A
Test: builds
Change-Id: I89ad00e1c4c7e0767bc80a7ac7935a4d55e090ac
2018-02-16 17:58:14 -08:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Yifan Hong
1ccdb7d92a libvndksupport: do not use functions from android/dlext.h
... if they are not available. Use weak symbols and do not call the
following functions when they are not defined:

* android_dlopen_ext
* android_get_exported_namespace
Test: links
Test: boots

Change-Id: I653548bac61a0eba001f72bab969b5b858bd1553
2017-11-10 13:19:37 -08:00
Justin Yun
090b593a8d Make libvndksupport look for default namespace as well.
In vendor process, libvndksupport must look for "default" namespace,
instead of "sphal" namespace to open hal libraries.

Bug: 63411330
Test: Boot the device.
Change-Id: I26208b6f47708f83e0679fd72ca7471ade84fff9
Merged-In: I26208b6f47708f83e0679fd72ca7471ade84fff9
2017-11-09 18:07:47 -08:00
Justin Yun
a34bd0561d libvndksupport: Change log level and message.
If no 'sphal' namespace exist, the sphal library may be found in
current namespace.
Change the log level and message to note this.

Bug: 64162324
Test: Check log message for vndksupport tag.
Change-Id: I5ed6ba1e48f99e7d11d80a465177ac9f3a7fbd97
Merged-In: I5ed6ba1e48f99e7d11d80a465177ac9f3a7fbd97
2017-11-09 18:07:41 -08:00
Chih-Hung Hsieh
122352d983 Use -Werror in system/core
* Move -Wall -Werror from cppflags to cflags.
* Fix/suppress warning on unused variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I1e05e96a1d0bcb2ccef1ce456504b3af57167cc5
2017-11-01 11:32:55 -07:00
Jiyong Park
76080e7115 Merge "fix: ATRACE does not work for libs loaded in sphal namespace" into oc-dev am: b560e6db6a
am: 94baf7270a

Change-Id: I5042241c4239800a4b8ff1f18db1ab66b029c5c3
2017-05-31 00:46:42 +00:00
Jiyong Park
0b3c24bd4f fix: ATRACE does not work for libs loaded in sphal namespace
From O, libutils.so is loaded twice. Once in the default namespace and
once in the sphal namespace for vendor libs. However, since the
framework only communicates with the instance loaded in the default
namespace, report_sysprop_change() event is not notified to the instance
in sphal namespace. This causes ATRACE to not work for vendor libs
loaded in sphal namespace.

So, the instance loaded in default namespace now explicitly redirects
the event to the other instance.

Bug: 62084107
Test: start an app, run 'adb shell atrace gfx --stream'. atrace from the
graphics driver are visible.

Change-Id: Ia6c2ca6bcb9a8849ebb09b5c38d60480c92d4571
2017-05-27 15:32:01 +09:00
Justin Yun
17baed1012 libvndksupport: Do not lookup default namespace for sphal failure
Instead of looking up default namespace for the failure of loading
sphal libs, report failure. This is only for the devices that have
sphal namespace.

Bug: 38435840
Test: sailfish builds and boots
Test: libvndksupport-tests passes
Change-Id: Ibbff5f2d5d83f6482f98677a5492777db6416967
2017-05-24 01:32:51 +00:00
Jiyong Park
8902f7571a add libvndksupport
libvndksupport is a new LL-NDK library that provides vendor-visible APIs
for platform-only functionalities of other LL-NDK libraries. Currently,
it provides android_(load|unload)_sphal_library which abstracts the
platform-only APIs of libdl (android_get_exported_namespace, etc.)

Bug: 37323945
Test: sailfish builds and boots
Test: libvndksupport-tests passes

Merged-In: I6d2911b57e009d0c842554933aac87d6573ffcbf
Change-Id: I6d2911b57e009d0c842554933aac87d6573ffcbf
(cherry picked from commit 7130e13262)
2017-05-15 11:35:30 +09:00
Jiyong Park
7130e13262 add libvndksupport
libvndksupport is a new LL-NDK library that provides vendor-visible APIs
for platform-only functionalities of other LL-NDK libraries. Currently,
it provides android_(load|unload)_sphal_library which abstracts the
platform-only APIs of libdl (android_get_exported_namespace, etc.)

Bug: 37323945
Test: sailfish builds and boots
Test: libvndksupport-tests passes

Change-Id: I6d2911b57e009d0c842554933aac87d6573ffcbf
2017-05-11 15:08:56 +09:00