Commit graph

22 commits

Author SHA1 Message Date
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