diff options
author | 2025-01-19 21:14:36 +0000 | |
---|---|---|
committer | 2025-01-20 11:34:30 -0800 | |
commit | 612ee65f6ac572ed60097c7bd9a7016cce37da41 (patch) | |
tree | eef434c9a8a3b07ce56e2a935fb80d6f93fabf89 /test/default_run.py | |
parent | bd36a3bcd6f81ffad4a62cacd0a54711e33fc5f2 (diff) |
Introduce an "external" variant of libarttest(d).so and use it to fix
and re-enable 817-hiddenapi.
817-hiddenapi and some other run tests have been disabled on target
since https://r.android.com/1689792. A problem has been that (at least
some of) those tests depended on libarttest(d).so being in
java.library.path, so that the .so could be e.g. found and copied from
there by the test.
That's not possible to get to work with libarttest(d).so, since we have
to "register" it with NATIVELOADER_DEFAULT_NAMESPACE_LIBS before
dalvikvm starts.
Instead introduce a new test library libarttest(d)_external.so that
takes the place libarttest(d) had before https://r.android.com/1689792.
I.e. it gets installed in /data/nativetest(64)/art/<arch>, which is
present on java.library.path. It will be loaded in the test's
classloader namespace rather than com_android_art, so it cannot access
ART internals. However, it can access symbols in libarttest(d).so, so
it's possible to export an (unstable) API there that the "external"
library can call across the linker namespace boundary.
Use this approach to fix 817-hiddenapi, and re-enable it again.
Note: Since libarttest(d)_external doesn't have direct access to ART
internal it ought not need to be split into -d and non-d variants. The
only reason that's still the case is that its variants need to depend
on the corresponding variants of libarttest(d).
Test: art/test/testrunner/testrunner.py --target --64 817
in armv8 target chroot
Test: art/test/testrunner/testrunner.py --host 817
Bug: 186654484
Change-Id: I13c186e8d086d07c2480e96a1c1f85651dac7d84
Diffstat (limited to 'test/default_run.py')
-rwxr-xr-x | test/default_run.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/default_run.py b/test/default_run.py index fa6341a31d..86e4996ca1 100755 --- a/test/default_run.py +++ b/test/default_run.py @@ -978,10 +978,11 @@ def default_run(ctx, args, **kwargs): # installation. LD_LIBRARY_PATH = f"{ANDROID_ROOT}/{LIBRARY_DIRECTORY}" - # This adds libarttest(d).so to the default linker namespace when dalvikvm - # is run from /apex/com.android.art/bin. Since that namespace is essentially - # an alias for the com_android_art namespace, that gives libarttest(d).so - # full access to the internal ART libraries. + # This adds libarttest(d).so and various other test libraries to the default + # linker namespace when dalvikvm is run from /apex/com.android.art/bin. + # Since that namespace is essentially an alias for the com_android_art + # namespace, that gives libarttest(d).so full access to the internal ART + # libraries. LD_LIBRARY_PATH = f"/data/{TEST_DIRECTORY}/com.android.art/lib{SUFFIX64}:{LD_LIBRARY_PATH}" dlib = ("" if TEST_IS_NDEBUG else "d") art_test_internal_libraries = [ |