Commit graph

233 commits

Author SHA1 Message Date
Ryan Haining
9a0804475d Merge "Allow dlopen()ing libraries from the netd APEX on pasan build" am: 0c2d673fcc am: 20f1be47d3
am: 137d547e40

Change-Id: Ibc5647f852ff5793df36bb971bf40dd1128d6ad8
2018-12-28 13:43:59 -08:00
Ken Chen
30200f1e24 Allow dlopen()ing libraries from the netd APEX on pasan build
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Bug: b/122073006
Test: builds, boots
Test: system/netd/tests/runtests.sh
Change-Id: If6f13ba9dc249d019b820a7c37cf6d4cdd8d0a7d
2018-12-28 17:20:01 +08:00
Martin Stjernholm
e7268de040 Merge "Revert^2 "Linker namespace configuration for the Runtime APEX."" am: f679c58787 am: 587ebc4bfb
am: 26b91d0eb4

Change-Id: I9705f4a9d323ba8d0cd5485b2a253b3029a47677
2018-12-21 05:53:45 -08:00
Martin Stjernholm
e71d91e729 Revert^2 "Linker namespace configuration for the Runtime APEX."
This reverts commit a0d9f2fd6c.

Original change: Needs to support e.g. app_process in "default" ->
libnativehelper in "runtime" -> platform libs in "default" -> libc etc in "runtime".

Always make sure to switch namespaces when switching library paths between
/system and the APEX, so that internal library dependencies in both
locations are loaded from their own directory. E.g. libc++ and libbase live
in both places, and their dependents must always load the version they were
compiled with.

This CL also adds a temporary workaround to not break hwasan builds
(b/121038155).

Bug: 119867084
Bug: 113373927
Bug: 121038155
Change-Id: I58d09ed091dd82b2162c4a0b51555174d9322e0e
Test: Flash and reboot device
Test: Remount / read-write, then on device: rm -f system/lib{,64}/lib{c,m,dl}.so; system/bin/dex2oat -h; stop && start
Test: mmma bionic/tests/ && adb root && adb shell rm -rf /data/nativetest\* && adb push out/target/product/taimen/data/nativetest* /data/ && adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: cts-tradefed run commandAndExit cts-dev -m CtsJniTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsCompilationTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBionicTestCases (8 failures remain unchanged by this CL)
Test: Patch internal; lunch taimen_hwasan-userdebug && m SANITIZE_TARGET=hwaddress && vendor/google/tools/flashall -w && adb shell /vendor/bin/sh -c ls
2018-12-21 11:15:52 +00:00
Lorenzo Colitti
3618926adc Merge "Allow dlopen()ing libraries from the netd APEX." am: 95a8d0d0c7 am: e93f1bba90
am: 934b08a013

Change-Id: Ief8c006c230faa1fd6758754a98ba1a39f4bc640
2018-12-19 06:44:16 -08:00
Lorenzo Colitti
472c900f6b Allow dlopen()ing libraries from the netd APEX.
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Test: builds, boots
Test: system/netd/tests/runtests.sh
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Change-Id: Ia68df860b7edc92180284f62736146e6029d7655
2018-12-19 16:52:06 +09:00
Andreas Gampe
434e7d6389 Merge "Revert "Linker namespace configuration for the Runtime APEX."" am: ece144857b am: 3138ddb181
am: 3438ac260a

Change-Id: I72166807c00e0d0719519516a484481989a872eb
2018-12-17 15:19:43 -08:00
Andreas Gampe
a0d9f2fd6c Revert "Linker namespace configuration for the Runtime APEX."
This reverts commit f1038896ad.

Reason for revert: Breaks CTS

Bug: 119867084
Bug: 113373927
Bug: 121149887
Change-Id: I44b3e708ff1c87520bcfb64f509bf3ae6871f7bc
2018-12-17 21:22:53 +00:00
Martin Stjernholm
581c9859ee Merge "Linker namespace configuration for the Runtime APEX." am: bd660496c8 am: 49b81b9332
am: ecc3a35e04

Change-Id: I304695b1444d704a759bdd1dd834c7b90d69392a
2018-12-12 08:07:52 -08:00
Martin Stjernholm
f1038896ad Linker namespace configuration for the Runtime APEX.
Needs to support e.g. app_process in "default" -> libnativehelper in
"runtime" -> platform libs in "default" -> libc etc in "runtime".

Always make sure to switch namespaces when switching library paths between
/system and the APEX, so that internal library dependencies in both
locations are loaded from their own directory. E.g. libc++ and libbase live
in both places, and their dependents must always load the version they were
compiled with.

Bug: 119867084,113373927
Test: Flash and reboot device
Test: Remount / read-write, then on device: rm -f system/lib{,64}/lib{c,m,dl}.so; system/bin/dex2oat -h; stop && start
Test: mmma bionic/tests/ && adb root && adb shell rm -rf /data/nativetest\* && adb push out/target/product/taimen/data/nativetest* /data/ && adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: cts-tradefed run commandAndExit cts -m CtsJniTestCases
Change-Id: I6c4fc2f1abea1fb8851546e258ffaaa4ef6fe7d0
2018-12-12 11:44:07 +00:00
Roland Levillain
bf95ac9c7b Merge "Revert "Add Android Runtime APEX lib directories to the system linker configuration."" am: c400ced93d am: 1e08eabf7c
am: c3e04a86dc

Change-Id: Icb8d669f76fa702cc93216f8828f39641a24b613
2018-12-11 06:12:06 -08:00
Treehugger Robot
c400ced93d Merge "Revert "Add Android Runtime APEX lib directories to the system linker configuration."" 2018-12-11 13:41:10 +00:00
Roland Levillain
9b79db5ebf Revert "Add Android Runtime APEX lib directories to the system linker configuration."
This reverts commit 2f56b1fff8.

Reason for revert: Breaks bionic-unit-tests's dlfcn.dladdr_libc
and x86 CtsJniTestCases' JniStaticTest.test_linker_namespaces.

Bug: 113373927
Bug: 120661824
Change-Id: I9b34bcb240a42bf99c6d8b58db4b18a4f6d36961
2018-12-11 10:20:33 +00:00
Roland Levillain
5d0c8664b4 Merge "Add Android Runtime APEX lib directories to the system linker configuration." am: d768a0c13d am: 4bcae06f9b
am: 499bab62a6

Change-Id: Ibf3dfed292685475e04b33b59b76ae08042da2c3
2018-12-10 07:36:16 -08:00
Roland Levillain
d768a0c13d Merge "Add Android Runtime APEX lib directories to the system linker configuration." 2018-12-10 15:04:29 +00:00
Andreas Gampe
3269748028 Merge "Revert "Use apex/com.android.resolv/lib64/libned_resolv.so by default"" am: 40f96aff36 am: aac7fa53d4
am: 432a55e432

Change-Id: Ic2c03f96a0a19c361748404146544ea3e36d55dc
2018-12-07 20:51:49 -08:00
Andreas Gampe
d831773ec6 Revert "Use apex/com.android.resolv/lib64/libned_resolv.so by default"
This reverts commit eb4384c2a0.

Reason for revert: Breaks tests

Bug: 119527674
Bug: 120661824
Change-Id: I2f452f25e7b4e070e766b84cdefdf1800244b150
Test: N/A
2018-12-07 21:46:06 +00:00
chenbruce
4980e769d3 Merge "Use apex/com.android.resolv/lib64/libned_resolv.so by default" am: 87e10ba280 am: 518bd1235c
am: 99c85bc053

Change-Id: Ibc074d4d5b8dc5efe51490d78dd498f163b75733
2018-12-06 23:27:54 -08:00
chenbruce
eb4384c2a0 Use apex/com.android.resolv/lib64/libned_resolv.so by default
netd will use apex/com.android.resolv/lib64/libned_resolv.so to replace
system/lib64/libned_resolv.so.
note:Without disabling selinux, we setenv LD_LIBRARY_PATH in netd.rc but
netd couldn't use libnetd_resolv.so under com.android.resolv/lib64 because
LD_LIBRARY_PATH is ignored when AT_SECURE is on. Directly add path to the
libnetd_resolv apex to /system/etc/ld.config.txt for temporarily.

Bug: 119527674
Test: make; flash; lsof -p $(pidof netd)
Change-Id: I011d2da625151bf43c10497bb84c15f3d8e6ad33
2018-12-05 17:25:24 +08:00
changho.shin
bc511b421f Merge "Support product partition for non-treblized devices" am: 79bd67bb2f am: 7a6df0832a
am: b1c845d003

Change-Id: I1c00c808f75ed9234f517a52288413673ed4e36b
2018-11-30 01:06:35 -08:00
changho.shin
715b1aab50 Support product partition for non-treblized devices
Non-treblized devices use ld.config.legacy.txt, which does not
support product partition, leading to access denial from/to product partition.
Declare directly /product since search paths are resolved in linker config.

Test: m -j with non-treblized device upgraded to P.
Change-Id: Ic142b807f5dbffdfa5c774b3df8d0903b9626b6a
2018-11-28 17:17:05 +09:00
Roland Levillain
2f56b1fff8 Add Android Runtime APEX lib directories to the system linker configuration.
Test: Device boot test with Android Runtime APEX.
Test: Device boot test without Android Runtime APEX.
Bug: 113373927
Change-Id: Iff32fcd79a667b07df839f4e6ef2cdb3cf70e9d3
2018-11-21 19:41:59 +00:00
Anton Hansson
f5986284dc Merge "Add product_services support to ld.config.vndk_lite" am: cf7d0e85d4 am: 13eb788bdc
am: 8c10354e7d

Change-Id: Ia74881217e467e09d0b099b40c4af767e2f85780
2018-09-19 17:46:11 -07:00
Anton Hansson
123c8d261d Merge "Update ld config to use build-time determined paths." am: 70b3fdce20 am: 5933e83e1d
am: 554d01506c

Change-Id: Ibe52f311662013e3100cb1d10b227597ca9a1c1c
2018-09-19 17:43:15 -07:00
Anton Hansson
ece0a74691 Add product_services support to ld.config.vndk_lite
We're moving apps and their libs to product_services for older
devices too, so mimic the rules in the default ld.config related
to product_services.

Also fix a one-off disparity between /product and /product_services
in ld.config.txt.

Bug: 114804489
Test: m out/target/product/marlin/system/etc/ld.config.vndk_lite
Change-Id: I166275c035c85b4d69cff8e9d51af3d6d0ff4857
2018-09-19 02:53:33 +01:00
Anton Hansson
0244428c8e Update ld config to use build-time determined paths.
A few places had /product and /product_services hardcoded. Update
them to use values that get set at build time.

Bug: 114804489
Test: m out/target/product/marlin/system/etc/ld.config.vndk_lite.txt
Change-Id: Ie48dbb2453ae941c1b5ee57f092d12a5497d878f
2018-09-19 00:47:12 +01:00
Steven Moreland
dd8eee871b Add libbinder_ndk to public.libraries.*
Bug: 111445392
Test: atest android.binder.cts.NdkBinderTest
Change-Id: I8ccb1f74654dcb925cd3ac20042cbffd2f594bb9
Merged-In: I8ccb1f74654dcb925cd3ac20042cbffd2f594bb9
2018-09-17 20:05:27 +00:00
Steven Moreland
fbeb8e8c46 Add libbinder_ndk to public.libraries.*
Bug: 111445392
Test: atest android.binder.cts.NdkBinderTest
Change-Id: I8ccb1f74654dcb925cd3ac20042cbffd2f594bb9
(cherry picked from commit fd0dad6825c09b8cc043fd54f679f7782fbf2c26)
2018-09-17 13:04:51 -07:00
Yifan Hong
de39afd1e0 Merge "s/product-services/product_services/g" 2018-08-21 01:07:56 +00:00
Yifan Hong
98d8981cf2 Merge "s/product-services/product_services/g" 2018-08-20 23:18:54 +00:00
Dario Freni
ab5583b585 s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
Merged-In: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
2018-08-20 17:46:42 +00:00
Dario Freni
69071b9143 s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
2018-08-17 14:04:45 -07:00
Elliott Hughes
240aa7ee51 Merge "Add NDK folks to OWNERS for library configuration." am: cdad28c4d5 am: ef1db03ea1
am: 4d11862312

Change-Id: I700f15c2c6e929172503729692d8006b85a2c741
2018-08-17 10:05:44 -07:00
Treehugger Robot
cdad28c4d5 Merge "Add NDK folks to OWNERS for library configuration." 2018-08-17 16:50:35 +00:00
Dario Freni
2af42dce4d Merge "s/PRODUCTSERVICES/PRODUCT_SERVICES/g" am: c0f60b7e4d am: ce965ed421
am: 077ec1e5fe

Change-Id: I33862496f491b3b8b137ae09aaa00f459d2f4032
2018-08-16 23:53:56 -07:00
Dario Freni
ad58bf9b1d s/PRODUCTSERVICES/PRODUCT_SERVICES/g
Attempting to reduce the number of different spellings we have for
"product-services" in the codebase.

Bug: 112431447
Test: m
Change-Id: I8714cc9c1ca63eb54745054aaeebd6b51f203f11
2018-08-17 00:20:11 +01:00
Dario Freni
f0a8d6cd55 Merge "Add support for /product-services partition." into stage-aosp-master am: d99a836380 am: 351d1f3f93
am: 404bcf3ac7

Change-Id: I175dde7c8b4527cc538ce50e58f6969115812fba
2018-07-26 09:36:54 -07:00
Dario Freni
3613710099 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.

Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
Merged-In: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-26 16:27:28 +00:00
Dario Freni
4fa866a467 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.
Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-23 16:14:36 +01:00
Doheon Lee
2cb76c1153 Merge "Determine product partition path on build time" am: 2bf8328c54 am: ac7756307f
am: 3083225f92

Change-Id: I8a287d843e5bd0d4bc662bcab6cfd8152ea935c6
2018-06-19 14:55:38 -07:00
Doheon Lee
cccad0bf84 Determine product partition path on build time
Path of product partitoin can be set as /product or /system/product
whether generate extra product partition or not.
Substitute %PRODUCT% to relevant path to know linker which path should
search and permit.

Bug: 110286945
Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt
Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d
2018-06-19 08:10:14 +00:00
Inseob Kim
dbe48bc748 Merge "Add /system/product/* paths to permitted paths" am: c733e5af3c am: af818a799d
am: ddc022c371

Change-Id: I13dcff96ff483ebd8def1517bfb78b2cf5b9d297
2018-06-18 00:40:07 -07:00
Inseob Kim
3918936b9e Add /system/product/* paths to permitted paths
As linker doesn't resolve paths in permitted paths, /system/product
variants should be added to support devices having product partition
under /system.

Bug: 110286945
Test: m -j succeeds on taimen and libraries under /system can dlopen
libraries under /system/product/apps

Change-Id: Icd102d44511702e4ec66c07a367b59c3d9700a44
2018-06-18 14:16:49 +09:00
Jiyong Park
d3e0245b21 Shared libs are supported in recovery mode am: 011ee12b1d am: 4ebda908de
am: 058aa0c3e1

Change-Id: I6e5af784a2d11888623891ed1ee5e3cd9932cc1b
2018-06-13 17:47:09 -07:00
Jiyong Park
011ee12b1d Shared libs are supported in recovery mode
adbd has been built as a static executable since the same binary was
copied to the recovery partition where shared library is not supported.
However, since we now support shared library in the recovery partition,
adbd is built as a dynamic executable.

In addition, the dependency from adbd to libdebuggerd_handler is removed
as debuggerd is handled by the dynamic linker.

A few more modules in /system/core are marked as recovery_available:
true as they are transitive dependencies of the dynamic linker.

This change also includes ld.config.recovery.txt which is the linker
config file for the recovery mode. It is installed to /etc/ld.config.txt
and contains linker namespace config for the dynamic binaries under
/sbin.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: I363d5a787863f1677ee40afb5d5841321ddaae77
2018-06-10 08:32:24 +09:00
Inseob Kim
daa4760ffb Merge "Support /product/bin" am: 36b61f061d am: 931e0f268a
am: cf5e8f1575

Change-Id: I9ef94a439b75a8f95b07761d3fe3c3b863294e0c
2018-05-31 22:56:29 -07:00
Inseob Kim
25195daaca Support /product/bin
Bug: 80422611
Test: m -j succeeded and permissions of files under /product/bin are set
correctly

Change-Id: I83377d809c47c92da6b226d2853ea6a7462fb127
2018-06-01 08:33:04 +09:00
Inseob Kim
7f5070451c Merge "Support product-specific libraries" am: 39cab7cd25 am: d9debeefd6
am: 4f0e967eaa

Change-Id: Ieb9b4621b0188d9ae07e3bdf70d76a51de93cf0d
2018-05-24 13:22:55 -07:00
Inseob Kim
67cb05654c Support product-specific libraries
Product-specific libraries in /product/lib can be exposed to Android
apps by adding the list of the libs into
/product/etc/public.libraries-<companyname>.txt. The libs MUST be named
as lib<name>.<companyname>.so.

Bug: 73095206
Test: with taimen
mma -j and runtest.sh. The libs are all loaded in system, but not in
vendor. After reinstalling app using adb -r and reopening app, only
libraries listed in .txt are loaded

Change-Id: I7c386813c72a7b225a7f244b6c5fec4ac0660fd3
2018-05-16 01:36:25 +00:00
Ralph Nathan
a18fa73bba Update public.libraries.iot.txt to be up to date.
Adds amidi to the iot public.libraries.txt so it's up to date with the
other files.

Bug: 78226207
Test: none
Change-Id: I28d1135f5da1c9ec907dd27d5ad8df5ee5d99b8b
2018-04-24 08:43:59 -07:00