OSDN Git Service

android-x86/system-linkerconfig.git
4 years agoMerge "Make /linkerconfig/<apexname> directories accessible to others"
Treehugger Robot [Fri, 21 Feb 2020 07:14:12 +0000 (07:14 +0000)]
Merge "Make /linkerconfig/<apexname> directories accessible to others"

4 years agoMake /linkerconfig/<apexname> directories accessible to others
Jiyong Park [Fri, 21 Feb 2020 04:56:52 +0000 (13:56 +0900)]
Make /linkerconfig/<apexname> directories accessible to others

When linkerconfig is exec'ed by init, umask is by default set to 0x0077.
As a result, even though we create the directories with mkdir(...,
0755), they are marked as inaccessible for group and others.

Fixing the issue by explicitly setting umask to 0x0022.

Bug: 144914078
Test: build a device with flattened APEX. Check the mode bits of the
directories of under /linkerconfig.

$ ls -al /linkerconfig
total 96
drwxr-xr-x  9 root root   200 2020-02-21 13:47 .
drwxr-xr-x 22 root root  4096 2020-02-21 13:54 ..
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.adbd
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.art
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.conscrypt
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.media.swcodec
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.os.statsd
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.runtime
drwx--xr-x  2 root root    60 2020-02-21 13:47 com.android.sdkext
-rw-r--r--  1 root root 91651 2020-02-21 13:47 ld.config.txt

Change-Id: Id2f7f8a363ba239943942ba6e3bc984cd8f630b0

4 years agoMerge "Rename APEX Namespace"
Kiyoung Kim [Fri, 21 Feb 2020 01:04:37 +0000 (01:04 +0000)]
Merge "Rename APEX Namespace"

4 years agoMerge "Fix full content test"
Kiyoung Kim [Thu, 20 Feb 2020 23:46:39 +0000 (23:46 +0000)]
Merge "Fix full content test"

4 years agoFix full content test
Kiyoung Kim [Thu, 20 Feb 2020 09:04:23 +0000 (18:04 +0900)]
Fix full content test

Full content test was not working properly because the way of checking
if VNDK is enabled has been changed. This fix generates test context to
mock it available for VNDK.

Test: atest passed
Change-Id: I46064d1d5505dc5c6af438e69faae166dee9dc58

4 years agoRename APEX Namespace
Kiyoung Kim [Wed, 19 Feb 2020 07:26:03 +0000 (16:26 +0900)]
Rename APEX Namespace

Current APEX Namespace is named with APEX name itself, which also uses
.(dot) so linker configuration can keep the syntax safe. Update name of
namespace from APEX by replacing '_' with '.' so keep configuration safe
for future syntax update.

Bug: 148826508
Test: m -j passed
Test: boot succeeded from cuttlefish and walleye
Change-Id: I9185c909678e2e39d539622d51d8f378b819b466

4 years agoAdd com.android.os.statsd to legacy linkerconfig
Garfield Tan [Wed, 19 Feb 2020 01:43:36 +0000 (17:43 -0800)]
Add com.android.os.statsd to legacy linkerconfig

Similar to aosp/1237667, but for legacy stuff.

Bug: None
Test: Legacy stuff boots.
Change-Id: Iad17f5529ea6bb520c0ee5a4071a82ffd7c2cc27

4 years agoMerge "Update linkerconfig for libs in statsd"
Jeffrey Huang [Tue, 18 Feb 2020 18:26:53 +0000 (18:26 +0000)]
Merge "Update linkerconfig for libs in statsd"

4 years agoMerge "Add com.android.os.statsd to linkerconfig"
Treehugger Robot [Tue, 18 Feb 2020 07:54:26 +0000 (07:54 +0000)]
Merge "Add com.android.os.statsd to linkerconfig"

4 years agoAdd com.android.os.statsd to linkerconfig
Tej Singh [Thu, 13 Feb 2020 01:21:01 +0000 (17:21 -0800)]
Add com.android.os.statsd to linkerconfig

Adds com.android.os.statsd to System BuildSection. I believe this is to
get the namespace the proper visibility for jni.

Test: build/boots
Change-Id: Id516e79e12fde608888587ec15ab0f3358f4918d
Merged-In: Id516e79e12fde608888587ec15ab0f3358f4918d
(cherry picked from commit 91454166a50d86d2367c8ec5b4686087ecc13184)

4 years agoMerge "Remove extra using statements"
Treehugger Robot [Tue, 18 Feb 2020 05:20:14 +0000 (05:20 +0000)]
Merge "Remove extra using statements"

4 years agoUpdate linkerconfig for libs in statsd
Jeffrey Huang [Mon, 17 Feb 2020 19:59:58 +0000 (11:59 -0800)]
Update linkerconfig for libs in statsd

Bug: 148605160
Test: m -j
Change-Id: Idb6308e8f518536e97106c445b1945945040a4c3

4 years agoMerge "Fix Camera bug"
Jeffrey Huang [Fri, 14 Feb 2020 21:57:31 +0000 (21:57 +0000)]
Merge "Fix Camera bug"

4 years agoRemove extra using statements
Tom Cherry [Fri, 14 Feb 2020 20:27:19 +0000 (12:27 -0800)]
Remove extra using statements

android::base::Errorf and android::base::ErrnoErrorf are now #define's
instead of functions, so remove their using statements.

Test: build
Change-Id: I7333b916ee87668fb9fd15b9293de5da41c43409

4 years agoFix Camera bug
Jeffrey Huang [Fri, 14 Feb 2020 20:08:20 +0000 (12:08 -0800)]
Fix Camera bug

Bug: 149538115
Test: Flash and take a picture, verified no crash
Change-Id: Idd455f8803cf6f1b1f4c95d854a6077e33bae5e1

4 years agoAllow libincident.so to be linked from apex
Jeffrey Huang [Thu, 13 Feb 2020 23:40:36 +0000 (15:40 -0800)]
Allow libincident.so to be linked from apex

Bug: 145923087
Test: m -j
Change-Id: I787f15750e19c5028b334161c5a7d4fa13003c6f

4 years agoFix linkerconfig_backward_compatibility_test
Jooyung Han [Wed, 12 Feb 2020 23:41:15 +0000 (08:41 +0900)]
Fix linkerconfig_backward_compatibility_test

The current GetValue() falls back to GetProperty(). This makes the test
show different result on different running environment. For consistent
test result, MockVariables() now overrides all product/vendor variables.

Bug: n/a
Test: atest --host linkerconfig_backward_compatibility_test
      atest linkerconfig_backward_compatibility_test

Change-Id: I4b7533e10058b0236a8aef4c54fbb58f3bec0ccc

4 years agoRead vndk libraries txt files from vndk apex
Jooyung Han [Tue, 11 Feb 2020 23:53:51 +0000 (08:53 +0900)]
Read vndk libraries txt files from vndk apex

Vndk apex contains some txt files which list libraries it contains.
- llndk.libraries.txt
- vndksp.libraries.txt
- vndkcore.libraries.txt
- vndkprivate.libraries.txt

These files can be read from vndk apex instead of /system/etc.

Bug: 145184886
Test: build / flash / boot
Change-Id: I2b242b71768af2a30de519ccd4d73b1a86e46382

4 years agoGenerate vendor stuff only if vndk is avilable
Jooyung Han [Tue, 11 Feb 2020 23:43:31 +0000 (08:43 +0900)]
Generate vendor stuff only if vndk is avilable

Linkerconfig runs even when there is no apexes available. When vndk apex
is not available, having vendor section or namespaces requiring vndk
libraries is meaningless.

This is necessary because we'd like to load some variables from vndk
apex, but relying on those variables when vndk apex is not available may
fail to generate linker configuration.

Bug: 145184886
Test: build / flash / boot
Change-Id: I7c77757254a63c8bc7470c4ae87f2db3779e6465

4 years agoMerge "Add required modules for linkerconfig"
Treehugger Robot [Tue, 11 Feb 2020 22:59:27 +0000 (22:59 +0000)]
Merge "Add required modules for linkerconfig"

4 years agoMerge "2 more missing Result::ok() calls in system/linkerconfig"
Treehugger Robot [Tue, 11 Feb 2020 22:35:08 +0000 (22:35 +0000)]
Merge "2 more missing Result::ok() calls in system/linkerconfig"

4 years agoMerge changes I2ead6a77,I6bf2204a
Treehugger Robot [Tue, 11 Feb 2020 21:49:17 +0000 (21:49 +0000)]
Merge changes I2ead6a77,I6bf2204a

* changes:
  Remove ResolveVariables()
  Make ConfigWriter simpler

4 years agoAdd required modules for linkerconfig
Jooyung Han [Tue, 11 Feb 2020 19:21:16 +0000 (04:21 +0900)]
Add required modules for linkerconfig

linkerconfig relies on some txt files.
Adding those modules as required:
- llndk.libraries.txt
- vndkprivate.libraries.txt
- vndkcore.libraries.txt
- vndkcorevariant.libraries.txt
- vndksp.libraries.txt
- sanitizer.libraries.txt

Bug: N/A
Test: m installclean; m linkerconfig
      check if those txt files are installed together

Change-Id: I8ab98591026dad06b3140043c54b7134ca3dac33

4 years ago2 more missing Result::ok() calls in system/linkerconfig
Bernie Innocenti [Tue, 11 Feb 2020 20:09:44 +0000 (05:09 +0900)]
2 more missing Result::ok() calls in system/linkerconfig

Test: cd system/linkerconfig && atest
Change-Id: I2c6f8eb4b81065b90512f88a9f248affecacf019

4 years agoMerge "Use apex_name for the name of linker namespace"
Treehugger Robot [Tue, 11 Feb 2020 19:00:40 +0000 (19:00 +0000)]
Merge "Use apex_name for the name of linker namespace"

4 years agoRemove ResolveVariables()
Jooyung Han [Fri, 7 Feb 2020 16:08:22 +0000 (01:08 +0900)]
Remove ResolveVariables()

ResolveVariables() takes long because it uses regex pattern search and
replace them with values. It can be avoided by resolving variables while
configurations are being built.

For easy transition, "Var()" utility function is introduced which should
be called after LoadVariables(). This will be enforced by moving Var()
into Context so that it only be called when Context is available (which
is, after LoadVariables() is called)

Bug: 149020353
Test: atest --test-mapping system/linkerconfig
      build / flash / boot
Change-Id: I2ead6a77dcc9ec14b4e083897a2818714438beb5

4 years agoMake ConfigWriter simpler
Jooyung Han [Fri, 7 Feb 2020 06:38:16 +0000 (15:38 +0900)]
Make ConfigWriter simpler

- Remove varg WriteLine
- No prefix
- Add WriteVars for writing multiple lines using "="/ "+="

This refactoring is a prep for removing "ResolveVariables()" which is very slow.

Bug: 149020353
Test: atest --test-mapping system/linkerconfig
Change-Id: I6bf2204a9ac0794b0bdf8028999a3543821a26be

4 years agoLast missing Result::ok() calls in system/linkerconfig
Bernie Innocenti [Sat, 8 Feb 2020 19:12:18 +0000 (04:12 +0900)]
Last missing Result::ok() calls in system/linkerconfig

No functionality change.

Test: cd system/linkerconfig && atest
Change-Id: I5ffa14d1d935c8e01c694338400e366a19895ba6

4 years agoUse apex_name for the name of linker namespace
Jooyung Han [Fri, 7 Feb 2020 17:59:10 +0000 (02:59 +0900)]
Use apex_name for the name of linker namespace

Till now short names are used for apex namespaces but there are no
explicit rule for this. Instead of extracting namespace name from apex
name (com.android.foo => foo), we'd better use apex name as it is
because it is well-established identifier for apexes.

Bug: 148826508
Test: build/flash/boot
      atest

Change-Id: I4f77eb85652a999274844436ba14b5c05831cf5b

4 years agoRemove unused files
Jooyung Han [Fri, 7 Feb 2020 17:51:00 +0000 (02:51 +0900)]
Remove unused files

conscrypt and neuralnetworks namespaces are now generated automatically.

Bug: N/A
Test: build
Change-Id: Ic13d3f4206ecfda1937adf2111977b279fba05ef

4 years agoAuto-generate runtime namespace
Jooyung Han [Thu, 6 Feb 2020 11:46:02 +0000 (20:46 +0900)]
Auto-generate runtime namespace

runtime apex provides bionic(libc/libm/libdl) libraries. But actually
they are supposed to be accessed via symlinks in /system/lib (i.e.
system namespace).

By amending soong not to emit those bionic libs as providing libs of
runtime apex, now runtime apex can be auto-generated by linkerconfig.

Bug: 144664390
Test: build / flash / boot
Change-Id: Idda42801a608e5fcb495bfccdd07ca6c0666a53d

4 years agoAuto-generate media namespace
Jooyung Han [Thu, 6 Feb 2020 11:39:02 +0000 (20:39 +0900)]
Auto-generate media namespace

Now, media namespace is auto-generated.
This is done by adding /apex/<name>/lib as permitted path as well as
search path, because media apex needs a permitted path
/com.android.media/lib/extractors.

Bug: 144664390
Test: build / flash / boot
      atest --test-mapping system/linkerconfig
Change-Id: I9186b0768b3bce3ad19f3d14010725af0bbf5861

4 years agoAuto-generate apex namespaces: cronet,nn,conscrypt
Jooyung Han [Thu, 6 Feb 2020 11:17:53 +0000 (20:17 +0900)]
Auto-generate apex namespaces: cronet,nn,conscrypt

Some visible namespaces are now auto-generated using activated apex
info. This is quite a significant change for init/bootstrap stages.
For example, at init stage which has no apexes activated, linkerconfig
dosn't generate apex namespaces at all. Previously, it was statically
generated whether those apexes are available or not.

Amon remaining apexes, media and runtime will be removed soon.

Bug: 144664390
Test: compare generated ld.config.txt between changes
      build / flash / boot
      atest --test-mapping system/linkerconfig
Change-Id: I334071dd59273e194ccdca1ef2cff0b7ee1b5c35

4 years agoMerge "Configuration for special APEX binaries"
Kiyoung Kim [Fri, 7 Feb 2020 03:25:42 +0000 (03:25 +0000)]
Merge "Configuration for special APEX binaries"

4 years agoConfiguration for special APEX binaries
Kiyoung Kim [Wed, 29 Jan 2020 05:56:54 +0000 (14:56 +0900)]
Configuration for special APEX binaries

Some of the linker configuration for APEX binaries are not enough just
to use auto-generated contents. This change implements some of the
additional namespaces for some special APEXes with binaries - ART and
Media SWCodec.

Bug: 147987608
Test: m -j passed
Test: Tested adbd and swcodec(Youtube) on Cuttlefish and Crosshatch
Change-Id: I58345dc31bb97138c9c632039a10ab000e23bcb6

4 years agoConvert system/linkerconfig to Result::ok()
Bernie Innocenti [Thu, 6 Feb 2020 14:16:23 +0000 (23:16 +0900)]
Convert system/linkerconfig to Result::ok()

No functionality changes, this is a mechanical cleanup.

Test: m
Change-Id: I759398fdf01d1703b0c128fb4f34d33a6f1a2027

4 years agoMove part of Context into modules::BaseContext
Jooyung Han [Tue, 4 Feb 2020 10:46:06 +0000 (19:46 +0900)]
Move part of Context into modules::BaseContext

ApexInfo/strict is used in Section::Resolve and it's very generic.
Moving it into BaseContext makes code simpler

Bug: N/A
Test: atest --test-mapping system/linkerconfig
Change-Id: I8acbdb7ed3368b6c10474be1c30a12fbc81c8ca6

4 years agoAdd default "provides" list to system namespace
Jooyung Han [Mon, 3 Feb 2020 10:32:33 +0000 (19:32 +0900)]
Add default "provides" list to system namespace

Contrary to APEX modules, system doesn't have meta data represening
"provides". So adding the "provides" list to system namespaces.

Bug: 144664390
Test: build / flash / boot
Test: atest --test-mapping system/linkerconfig
Change-Id: I808736814221a0d0cff2f163d64da01b398dc265

4 years agoAdd "--strict" flag
Jooyung Han [Mon, 3 Feb 2020 09:07:12 +0000 (18:07 +0900)]
Add "--strict" flag

--strict flag tells linkerconfig to resolve constraints in strict mode.
In strict mode, when a required module is not found, resolution fails.
Otherwise, missing requirements are ignored silently.

Linkerconfig may run at a very early stage when there is no apexes or
only bootstrap apexes are activated. --strict mode can be turned on when
all apexes are activated.

Bug: 144664390
Test: build / flash / boot
Change-Id: I13cab3aabb605338d031f825fe4af5f9a410a715

4 years agoBuild adbd/resolv namespace automatically
Jooyung Han [Mon, 3 Feb 2020 08:35:56 +0000 (17:35 +0900)]
Build adbd/resolv namespace automatically

adbd/resolv APEXes can be generated automatically.

Bug: 144664390
Test: build / flash / boot
Change-Id: I025bf186d7071e6051bd65d94ec9b3185b8c1a43

4 years agoMerge "Pass Context to Build.*Configuration"
Treehugger Robot [Tue, 4 Feb 2020 05:42:40 +0000 (05:42 +0000)]
Merge "Pass Context to Build.*Configuration"

4 years agoMerge "Add libadbd_auth.so to stub library list."
Josh Gao [Mon, 3 Feb 2020 20:15:20 +0000 (20:15 +0000)]
Merge "Add libadbd_auth.so to stub library list."

4 years agoPass Context to Build.*Configuration
Jooyung Han [Mon, 3 Feb 2020 05:23:06 +0000 (14:23 +0900)]
Pass Context to Build.*Configuration

Context is prepared with activated APEX modules and passed to the
configuration builders.

This doesn't change the current behavior, and there will be follow-up
changes which uses Context to generate APEX-related configuration
dynamically.

Bug: 144664390
Test: compare geneated ld.config.txt files with old ones.
Change-Id: Ice4c7e57d8f5894e4b18510a116e5b38da8d8462

4 years agoMerge "Fix handling mkdir failure"
Treehugger Robot [Fri, 31 Jan 2020 07:22:27 +0000 (07:22 +0000)]
Merge "Fix handling mkdir failure"

4 years agoAdd libadbd_auth.so to stub library list.
Josh Gao [Fri, 31 Jan 2020 00:19:29 +0000 (16:19 -0800)]
Add libadbd_auth.so to stub library list.

Test: treehugger
Change-Id: I90cc7906e73f90234fcd13aad42e1affb69ff9dc

4 years agoUse provide/require to link namespaces
Jooyung Han [Wed, 29 Jan 2020 18:29:10 +0000 (03:29 +0900)]
Use provide/require to link namespaces

Add provide/require information for adbd/art/conscrypt/neuralnetworks
namespace and use it to link namespaces.

With this change, this information is hard-coded but will come from
apex_manifest.pb.

Bug: 144659031
Test: Cuttlefish boots
Change-Id: I617818744b6e015c81170b345f9dfa8ca9b993ec

4 years agoFix handling mkdir failure
Jooyung Han [Thu, 30 Jan 2020 03:57:34 +0000 (12:57 +0900)]
Fix handling mkdir failure

The commit(98a691144d433bd05ad0d26f4caab38e8a3d9c39) was simply wrong
because mkdir() returns -1 and set errno instead of returning it.

Bug: n/a
Test: run linkerconfig twice with same target_dir

Change-Id: Iea8a7357219153abd00f342a1d7794b787bf09dc

4 years agoMerge "Link to system namespace using stub libraries"
Kiyoung Kim [Tue, 28 Jan 2020 10:39:38 +0000 (10:39 +0000)]
Merge "Link to system namespace using stub libraries"

4 years agoSort namespaces in a section
Jooyung Han [Tue, 28 Jan 2020 07:30:11 +0000 (16:30 +0900)]
Sort namespaces in a section

The order of namespaces doesn't matter.
It would be easier to compare when they are sorted, especially when we
generate them with dynamic APEX information.

Bug: N/A
Test: atest --test-mapping system/linkerconfig
Change-Id: I5845247152895c2503c49f7eafd52fb5665b24ba

4 years agoSkip log when mkdir fails with EEXIST
Jooyung Han [Tue, 28 Jan 2020 07:22:47 +0000 (16:22 +0900)]
Skip log when mkdir fails with EEXIST

This is useful when running linkerconfig many times with the same
target_directory.

Bug: N/A
Test: run linkerconfig on host
Change-Id: I38b70a5078afdc0f79d26789c04ec2ed075be491

4 years agoDo UpdatePermission only on target.
Jooyung Han [Tue, 28 Jan 2020 06:44:14 +0000 (15:44 +0900)]
Do UpdatePermission only on target.

Otherwise, UpdatePermission fails when running on host.

Bug: N/A
Test: run linkerconfig on host
Change-Id: I37207beb2404daa052b8011075d2c5eaaefa63c2

4 years agoLink to system namespace using stub libraries
Kiyoung Kim [Mon, 13 Jan 2020 02:44:05 +0000 (11:44 +0900)]
Link to system namespace using stub libraries

As stub libraries list is generated, linkerconfig can use this to
generalize list of libraries linked to system namespace from other
(usually APEX) libraries.

Bug: 147210213
Test: m -j passed && Cuttlefish succeeded to boot
Change-Id: I350390a023c0d186da11844152b51b06ace60e8a

4 years agoMerge "Add adbd apex configuration."
Treehugger Robot [Fri, 24 Jan 2020 22:06:11 +0000 (22:06 +0000)]
Merge "Add adbd apex configuration."

4 years agoMerge "Add liblog to system libraries."
Treehugger Robot [Fri, 24 Jan 2020 07:34:10 +0000 (07:34 +0000)]
Merge "Add liblog to system libraries."

4 years agoAdd adbd apex configuration.
Josh Gao [Thu, 23 Jan 2020 02:04:26 +0000 (18:04 -0800)]
Add adbd apex configuration.

The JDWP socket abstraction is moving from a server shared library
in the ART apex loaded by adbd, to a client shared library in the
adbd apex.

Test: manually booted internal, attached jdb to a random app twice
Change-Id: Ic8c9c7470321c965d1d614d7c99179b772dfd8c8

4 years agoAdd liblog to system libraries.
Josh Gao [Thu, 23 Jan 2020 20:36:40 +0000 (12:36 -0800)]
Add liblog to system libraries.

Test: treehugger
Change-Id: I79954cfd6a3a32f0988a24a18954db8f8459fd04

4 years agoMerge "Generate linkerconfig for APEX binaries"
Kiyoung Kim [Wed, 22 Jan 2020 07:58:43 +0000 (07:58 +0000)]
Merge "Generate linkerconfig for APEX binaries"

4 years agoGenerate linkerconfig for APEX binaries
Kiyoung Kim [Mon, 20 Jan 2020 04:33:00 +0000 (13:33 +0900)]
Generate linkerconfig for APEX binaries

Generate linkerconfig for APEX binaries. Dependency can be resolved with
platform namespace which offers stub libraries, and other APEX modules
based on its providing library list.

Bug: 147987608
Test: m -j passed && checked linkerconfig generated per binary APEX
Change-Id: I27a872d5e82618dc0621ed9a86c176171d2f00ab

4 years agoRead product vndk libraries only when available
Kiyoung Kim [Mon, 20 Jan 2020 10:55:40 +0000 (19:55 +0900)]
Read product vndk libraries only when available

Current linkerconfig implementation tries to read vndk library list with
product vndk version even when the version is not specified. This change
will let linkerconfig load those files only when product vndk version is
available.

Test: m -j passed && Checked execution from cuttlefish
Change-Id: Ifb861d7c71a43ac77b27a6c29419b5f965d6097d

4 years agoMerge "Add product section for product interface enforcement"
Treehugger Robot [Wed, 8 Jan 2020 07:42:01 +0000 (07:42 +0000)]
Merge "Add product section for product interface enforcement"

4 years agoScan Active APEXes
Jooyung Han [Mon, 6 Jan 2020 09:09:30 +0000 (18:09 +0900)]
Scan Active APEXes

Added a helper function ScanActiveApexes() which returns active APEXes.

Bug: 144659031
Test: atest --host linkerconfig_modules_unittest
Change-Id: Id953e9b3db7e63641571b8e36377ef2c29e70eb9

4 years agoAdd product section for product interface enforcement
Justin Yun [Mon, 16 Dec 2019 08:47:02 +0000 (17:47 +0900)]
Add product section for product interface enforcement

If ro.product.vndk.version is defined, product partition will have
seprate section from system section.
Modules in /product allowed to use VNDKs only from /system partition.
Modules in /system or /system_ext are not allowed to link to the
libraries in /product.

Bug: 124024578
Bug: 120954888
Test: build with "PRODUCT_PRODUCT_VNDK_VERSION := current"
      check device boot and basic functions

Change-Id: I0f9cd8b27c56c6a786b10aa23ffc4b197cea714d

4 years agoTarget out directory
Kiyoung Kim [Mon, 30 Dec 2019 09:43:00 +0000 (18:43 +0900)]
Target out directory

Linkerconfig will generate more than 1 file, based on APEX modules and
emulation. To support this, linkerconfig should take out target
directory as argument rather than out target file.

Bug: 146993126
Test: m -j passed && Cuttlefish succeeded to boot
Change-Id: Iabc611ad0dc31a5ab5627356a8552796ab452d7e

4 years agoRemove VNDK version for using core variant libraries
Kiyoung Kim [Mon, 30 Dec 2019 01:51:10 +0000 (10:51 +0900)]
Remove VNDK version for using core variant libraries

In current, name of the file contains VNDK using core variant library
list goes with VNDK version like other library list files. However, this
list is dependent on the system image not the VNDK version. To meet this
condition, this file name should not contain VNDK version number to avoid confusion.
This change removes VNDK version number from the file name.

Bug: 142599349
Test: m -j passed && aosp_cf_x86_go_phone booted
Change-Id: Ie167639e5ae2bae2ad269ffde168cfa5ac7de217

4 years agoAdd --legacy for easy of testing
Jooyung Han [Mon, 23 Dec 2019 04:35:00 +0000 (13:35 +0900)]
Add --legacy for easy of testing

Generate linker config for targets which are not treble-ized.
This argument is only for test on host.

Test: m linkerconfig && linkerconfig --legacy --root $OUT --vndk R
Change-Id: Id1ca59de2016de2de6b9a52f1ac217edea7c71f0

4 years agoBuild linker configuration for recovery in build time
Kiyoung Kim [Thu, 19 Dec 2019 06:59:55 +0000 (15:59 +0900)]
Build linker configuration for recovery in build time

As recovery has not enough space for linkerconfig binary, and also
linker configuration for recovery is does not require any environmental
variables, so linker configuration for recovery better be generated
from build time. This change enables to build linker configuration for
recovery from build and install into recovery system/etc.

Bug: 146414198
Test: m -j passed
Test: Checked linker config generated under recovery's system/etc
Change-Id: I08b77aa96191d3ccb67f8b8ca8fd918ca126de92

4 years agoMerge "Do not build linkerconfig for recovery"
Kiyoung Kim [Wed, 18 Dec 2019 00:55:03 +0000 (00:55 +0000)]
Merge "Do not build linkerconfig for recovery"

4 years agoAdd Cronet namespace
Luke Huang [Tue, 17 Dec 2019 05:10:09 +0000 (13:10 +0800)]
Add Cronet namespace

Bug: 139397529
Test: build
Test: manual test with Cronet
Change-Id: I1728747fcb6e04bf528266957695378f8d2b28fa

4 years agoDo not build linkerconfig for recovery
Kiyoung Kim [Tue, 17 Dec 2019 06:23:38 +0000 (15:23 +0900)]
Do not build linkerconfig for recovery

Linkerconfig should be built as static, but recovery does not have
enough space for static binary. As recovery linker configuration is
quite static and simple, this can be generated from build time. As a
first step linkerconfig binary should be removed from recovery.

Bug: 146384333
Test: m -j passed && crosshatch recovery worked with this change
Change-Id: Ia4155c3295feb518bcfd0ab6e6eef8f794e0b1f9

4 years agos/ANROID/ANDROID
Josh Gao [Wed, 11 Dec 2019 23:28:30 +0000 (15:28 -0800)]
s/ANROID/ANDROID

Test: treehugger
Change-Id: If112b4dfd77d772c2feec2c931190d63bea7cb2b

4 years agoMerge "Read apex_manifest and generate Namespace"
Jooyung Han [Tue, 10 Dec 2019 05:09:45 +0000 (05:09 +0000)]
Merge "Read apex_manifest and generate Namespace"

4 years agoRead apex_manifest and generate Namespace
Jooyung Han [Fri, 6 Dec 2019 10:47:30 +0000 (19:47 +0900)]
Read apex_manifest and generate Namespace

Add a small utility to initialize a Namespace with APEX.
Until we can just scan all "activated" APEXes and generate all
namespaces with them, we could use this to fill in namespaces for
APEXes.

Bug: 144659031
Bug: 144659057
Test: atest --host linkerconfig_modules_unittest
Change-Id: If9787ff6c7bc680b5d778b03813103e661a2d0a0

4 years agoMerge "Remove unnecessary shared_lib for neuralnetworks"
Treehugger Robot [Mon, 9 Dec 2019 23:19:24 +0000 (23:19 +0000)]
Merge "Remove unnecessary shared_lib for neuralnetworks"

4 years agoLinker configuration for recovery
Kiyoung Kim [Thu, 5 Dec 2019 07:44:34 +0000 (16:44 +0900)]
Linker configuration for recovery

Implements linker configuration for recovery. Linkerconfig will generate
recovery configuration on --recovery argument.

Bug: 139638519
Test: m -j passed & tested from crosshatch
Change-Id: I02a38bde8075167dd67334d69507f2604b7d3b33

4 years agoRemove unnecessary shared_lib for neuralnetworks
Jooyung Han [Wed, 4 Dec 2019 14:57:58 +0000 (23:57 +0900)]
Remove unnecessary shared_lib for neuralnetworks

Because libneuralnetworks doesn't require libsync.so, remove it from
allowed shared_libs list.

Bug: 144659031
Test: CtsNNAPITestCases
Change-Id: Ica410d01dd54881b2e5cfdd32013c0f11caa0511

4 years agoMerge "Remove unnecessary shared_libs for resolv APEX"
Jooyung Han [Wed, 4 Dec 2019 13:27:36 +0000 (13:27 +0000)]
Merge "Remove unnecessary shared_libs for resolv APEX"

4 years agoRemove unnecessary shared_libs for resolv APEX
Jooyung Han [Tue, 3 Dec 2019 10:38:22 +0000 (19:38 +0900)]
Remove unnecessary shared_libs for resolv APEX

resolv APEX doesn't need libcgrouprc.so, liblog.so, and libvndksupport.so.

Bug: 144659031
Test: m && device boot
      atest --test-mapping system/netd
Change-Id: Ic06008b808a185f5f5662f1758363fe776dbda45

4 years agoAdd path to the boot image in the ART apex.
Ulya Trafimovich [Fri, 15 Nov 2019 14:10:02 +0000 (14:10 +0000)]
Add path to the boot image in the ART apex.

Test: m

Change-Id: Ia92ae90b7d80fab9ad87207c0f699292451e8578

4 years agoAdd jooyung to owners
Kiyoung Kim [Tue, 3 Dec 2019 06:31:17 +0000 (15:31 +0900)]
Add jooyung to owners

Add jooyung@ to OWNERS list.

Test: no test required
Change-Id: I9bd783cadf7c324f728c1264cb082562db0a7678

4 years agoMerge "Add ART module members to linkerconfig owners."
Nicolas Geoffray [Mon, 2 Dec 2019 08:34:05 +0000 (00:34 -0800)]
Merge "Add ART module members to linkerconfig owners."
am: 0c04afcb05

Change-Id: Icee5851c6ddb7c28ae7fba553ae68ec2920cbbd8

4 years agoMerge "Add ART module members to linkerconfig owners."
Nicolas Geoffray [Mon, 2 Dec 2019 08:31:08 +0000 (08:31 +0000)]
Merge "Add ART module members to linkerconfig owners."

4 years agoAdd ART module members to linkerconfig owners.
Nicolas Geoffray [Fri, 29 Nov 2019 09:44:40 +0000 (09:44 +0000)]
Add ART module members to linkerconfig owners.

Test: build/make/tools/checkowners.py -c system/linkerconfig/OWNERS
Change-Id: Icd285aa36ffb560df2700ed09223ca9f082e7ee5

4 years agoAdd /system/lib to the permitted paths for ns of APEXes
Jiyong Park [Mon, 2 Dec 2019 08:15:01 +0000 (00:15 -0800)]
Add /system/lib to the permitted paths for ns of APEXes
am: 406aa34b07

Change-Id: I64fa27f23235959873494bd8fa5adb3a6a83f6cd

4 years agoAdd /system/lib to the permitted paths for ns of APEXes
Jiyong Park [Fri, 22 Nov 2019 13:11:58 +0000 (22:11 +0900)]
Add /system/lib to the permitted paths for ns of APEXes

With b/144533348, there will be symlinks from libs in APEXes to the libs
in the system partition. This is to reduce the size of APEXes when the
APEX is bundled with the platform.

Adding the /system/lib to the permitted paths so that the realpaths of
the symlinks are allowed for the namespaces.

Note that this however does not open all libs in the system partition to
the APEX namespaces, because searching of the libs are NOT done in
/system/lib, but in /apex/<module>/lib directory.

Bug: 144533348
Test: m
Change-Id: Ieb5dd795f6575123db4575f2a078cf136295b832

4 years agoAdd constraints resolution for dependencies
Jooyung Han [Fri, 29 Nov 2019 13:27:16 +0000 (05:27 -0800)]
Add constraints resolution for dependencies
am: b9f20d1929

Change-Id: I7444d7025e31e849b59bd1d48f7919bfa80fb7b2

4 years agoAdd constraints resolution for dependencies
Jooyung Han [Wed, 27 Nov 2019 13:08:46 +0000 (22:08 +0900)]
Add constraints resolution for dependencies

Each namespace may provide some list of libraries to other namespaces
and require some from others. From this constraints, generate mapping
between linker namespaces.

Bug: 144659031
Test: atest --host linkerconfig_modules_unittest
Change-Id: Ib3a948d4c5654557ad03adf8bade98cf527adc0f

4 years agoMerge "Make sure that namespace links are ordered"
Jooyung Han [Tue, 19 Nov 2019 08:45:53 +0000 (00:45 -0800)]
Merge "Make sure that namespace links are ordered"
am: 964d6bddf1

Change-Id: I2e9791e854653ffd0d75d0572be1532538f6bf54

4 years agoMerge "Make sure that namespace links are ordered"
Treehugger Robot [Tue, 19 Nov 2019 08:36:01 +0000 (08:36 +0000)]
Merge "Make sure that namespace links are ordered"

4 years agoMerge "Add runtime to unrestricted."
Christopher Ferris [Sat, 16 Nov 2019 16:36:51 +0000 (08:36 -0800)]
Merge "Add runtime to unrestricted."
am: 637bd4d9bd

Change-Id: I9b9d9b15295b94689a39417d1204c4f50e6a4bc7

4 years agoMerge "Add runtime to unrestricted."
Christopher Ferris [Sat, 16 Nov 2019 16:32:53 +0000 (16:32 +0000)]
Merge "Add runtime to unrestricted."

4 years agoMake sure that namespace links are ordered
Jooyung Han [Fri, 15 Nov 2019 04:48:00 +0000 (13:48 +0900)]
Make sure that namespace links are ordered

Unit test added.

Bug: 144464148
Test: atest --host linkerconfig_modules_unittest
Change-Id: Id23f325b9354d4bf45c4d357e3cda6dbe82ee6d0

4 years agoUse ordered sequences for namespace links
Jooyung Han [Fri, 15 Nov 2019 02:19:20 +0000 (18:19 -0800)]
Use ordered sequences for namespace links
am: b461a7bffd

Change-Id: Id6a72654b0844c92fb1df08946a9791ca9934fbd

4 years agoUse ordered sequences for namespace links
Jooyung Han [Thu, 14 Nov 2019 08:14:17 +0000 (17:14 +0900)]
Use ordered sequences for namespace links

The order of namespace links matters since linker searches in order.

Bug: 144464148
Test: atest --host linkerconfig_contents_fulltest
Test: see manually generated ld.config.txt (sphal ns)
Change-Id: Ice3db7060bb7b1b2ebeba9d3a3fcfa22b623ccc6

4 years agoMerge "vndk-ext should come before vndk(VNDK APEX)"
Jooyung Han [Thu, 14 Nov 2019 06:07:31 +0000 (22:07 -0800)]
Merge "vndk-ext should come before vndk(VNDK APEX)"
am: 1314c36936

Change-Id: Iaf16abaf2c5f4ac25c384f6d68b4e2262707c1b5

4 years agoMerge "vndk-ext should come before vndk(VNDK APEX)"
Treehugger Robot [Thu, 14 Nov 2019 05:56:19 +0000 (05:56 +0000)]
Merge "vndk-ext should come before vndk(VNDK APEX)"

4 years agovndk-ext should come before vndk(VNDK APEX)
Jooyung Han [Thu, 14 Nov 2019 04:27:19 +0000 (13:27 +0900)]
vndk-ext should come before vndk(VNDK APEX)

vndk-ext (/vendor/{LIB}/vndk) should come before vndk
(/apex/com.android.vndk.v{VER}/{LIB}) so that vndk-ext eclipse vndk.

Test: atest --host linkerconfig_contents_fulltest
Test: add vndkext lib to /vendor/{LIB}/vndk and check if it is loaded
correctly.

Change-Id: I554e2d0fdf5429e7e2bb3b3b955d852351d54a9f

4 years agoAdd runtime to unrestricted.
Christopher Ferris [Thu, 14 Nov 2019 01:12:03 +0000 (17:12 -0800)]
Add runtime to unrestricted.

Without this change, malloc debug and malloc hooks will not work
when executed from /data/local/tmp. This would represent a regression
from Q, and it also mean that atest could not run the system tests.

Also add the malloc debug and malloc hooks tests to this directory.

Test: malloc debug and malloc hooks system tests pass.
Change-Id: I5ecaa2710aef97d6b9468aa005bdf0a74f72014a

4 years agoRetain relevant comments from system/core/rootdir/etc/ld.config.txt.
Martin Stjernholm [Thu, 14 Nov 2019 00:58:03 +0000 (16:58 -0800)]
Retain relevant comments from system/core/rootdir/etc/ld.config.txt.
am: 7e36aeaa61

Change-Id: I12a163401f179ff3a393071a1f3b07b85e109f39

4 years agoRetain relevant comments from system/core/rootdir/etc/ld.config.txt.
Martin Stjernholm [Mon, 11 Nov 2019 15:51:25 +0000 (15:51 +0000)]
Retain relevant comments from system/core/rootdir/etc/ld.config.txt.

This CL carries over the comments from the old text config that was deleted
in https://r.android.com/1128832.

Test: N/A - comment changes only
Bug: 138920271
Change-Id: I4309599228cace3d19bba7bc992e80fe2eb66c69

4 years agoAdd runtime namespace
Jiyong Park [Mon, 11 Nov 2019 04:52:40 +0000 (20:52 -0800)]
Add runtime namespace
am: 72410b5474

Change-Id: I984c724a9e153a2fe950a833b660589a61354a1f