Commit Graph

2324 Commits

Author SHA1 Message Date
Colin Cross
54956abf1f Merge changes I545a832a,I85a51b04
* changes:
  Remove empty DepsMutator methods
  Replace *[]string with []string in product variables
2019-02-04 17:38:05 +00:00
Yi Kong
b5c34d7f40 Use llvm-{strip,objcopy} by default
... except for Darwin Mach-O, as it is not supported by llvm-strip.

Test: m checkbuild
Bug: 119221035
Change-Id: I021637b6dd3530bff1f563f2ec7c2168e1083b7e
2019-02-04 18:20:28 +08:00
Jiyong Park
03f7c2110c Use bootstrap linker for asan build
am: a2aca28750

Change-Id: I6b45d6863a72be558fda41faf4ac1d315f1066e1
2019-02-03 07:37:16 -08:00
Jiyong Park
a2aca28750 Use bootstrap linker for asan build
This change the asan version of
https://android-review.googlesource.com/c/platform/build/soong/+/879237

Bug: 123725034
Test: forrest run on asan_cf_x86_pasan
Test: SANITIZE_TARGET=address m init_second_stage
inspect /system/bin/init with readelf
DT_INTERP is set to /system/bin/bootstrap/linker_asan

Change-Id: I0fabe08cc63126aadec18ca8e9f2973c33411a4f
2019-02-02 13:28:57 +09:00
Evgenii Stepanov
a60c43aa23 [hwasan] Remove deprecated compiler flag (NFC)
am: 93c3f5368d

Change-Id: I0f2de3a2db53d8a2a963711aaae4fe1a53407ee3
2019-02-01 18:56:43 -08:00
Colin Cross
5f692ec219 Remove empty DepsMutator methods
Add an empty DepsMutator to ModuleBase so it doesn't have to be
implemented on every module that doesn't need it.

Test: all soong tests
Change-Id: I545a832a0dbf27386d3080377a75ea482cd9ce59
2019-02-01 17:17:58 -08:00
Evgenii Stepanov
93c3f5368d [hwasan] Remove deprecated compiler flag (NFC)
-hwasan-with-ifunc=0 matches the default value of the flag, and there
are no plans to change that.

Test: SANITIZE_TARGET=hwaddress keeps working
Change-Id: Ie46ffa6ae3c42a9677c3a9a3b5cdc6fb62c2c2f0
2019-02-01 22:56:03 +00:00
Pirama Arumuga Nainar
8edd1c3632 Merge "Switch to clang-r349610"
am: 42b87a2e56

Change-Id: If67d4fd64234ae0ab727556121a6a4cc21941631
2019-02-01 11:07:54 -08:00
Pirama Arumuga Nainar
42b87a2e56 Merge "Switch to clang-r349610" 2019-02-01 16:49:36 +00:00
Jiyong Park
7581398376 Merge "Fix: runtime apex is not instrumented with sanitizer"
am: 101d7600b2

Change-Id: I836b00a51dce1626de7f3c01cb349d080a62801f
2019-01-31 21:52:36 -08:00
Treehugger Robot
101d7600b2 Merge "Fix: runtime apex is not instrumented with sanitizer" 2019-02-01 05:45:22 +00:00
Jiyong Park
837c1c1e31 Add unstrippedOutputFilePath to the linker interface
am: af6d895941

Change-Id: If00bdc8e45c6f29a8a760ec3edd297d1db2c73a3
2019-01-31 21:38:29 -08:00
Jiyong Park
8222663f1b Fix: runtime apex is not instrumented with sanitizer
Fixing the problem that IsSanitizerEnabled always returns false due to
the different sanitizer names from config.SanitizerDevice() and
sanitizerType.String().

Bug: 123708856
Test: SANITIZE_TARGET=hwaddress m com.android.runtime.release
$ ls -al out/soong/.intermediates/art/build/apex/com.android.runtime.release/android_common_hwasan_com.android.runtime.release/image.apex/lib | wc -l
34
$ ls -al out/soong/.intermediates/art/build/apex/com.android.runtime.release/android_common_hwasan_com.android.runtime.release/image.apex/lib64 | wc -l
35
$ ls -al out/target/product/blueline/apex/com.android.runtime.release/lib | wc -l
34
$ ls -al out/target/product/blueline/apex/com.android.runtime.release/lib64 | wc -l
35

Test: inspect out/soong/build.ninja
- Variant of com.android.runtime.release is "android_common_hwasan_com.android.runtime.release"
- Dependencies of com.android.runtime.release are hwasan variants: e.g.,
  out/soong/.intermediates/bionic/libc/libc/android_arm64_armv8-2a_kryo385_core_shared_hwasan_com.android.runtime.release/libc.so

Test: ls out/soong/.intermediates/art/build/apex/com.android.runtime.release/android_common_hwasan_com.android.runtime.release/image.apex/lib64/*.so  | xargs readelf -d | grep libclang_rt.hwasan | wc -l
29

Change-Id: Idbb1f68a3ea6bdd02351d6f6048c3eedb9cf32d2
2019-02-01 11:26:04 +09:00
Jiyong Park
af6d895941 Add unstrippedOutputFilePath to the linker interface
Test: m
Change-Id: I85a0cbda6ebb9838451ed8c607c2087460b7b742
2019-02-01 11:04:58 +09:00
Ivan Lozano
054d752f4a Merge "XOM dependency check skipping static binaries."
am: 2ccd9b83d0

Change-Id: I002f77ac5d41856f3a19ac4505ca5ee292a6d4d1
2019-01-31 13:50:33 -08:00
Treehugger Robot
2ccd9b83d0 Merge "XOM dependency check skipping static binaries." 2019-01-31 21:42:42 +00:00
Ivan Lozano
59a7ae9bdf XOM dependency check skipping static binaries.
The execute-only memory dependency check is skipped for static binaries.
Make sure we check dependencies in this case.

Bug: 123603191
Test: readelf on static binary with xom-incompatible dependencies
Change-Id: I7ddd3058811cdf4e9cf862163e1bf5add4981b32
2019-01-31 10:09:13 -08:00
Pirama Arumuga Nainar
03b58e2210 Switch to clang-r349610
Bug: http://b/122481018

The '-keep' option of llvm-strip has changed to '-keep-section'.  Update
scripts/strip.sh accordingly.

Test: Tested on various targets in AOSP and internal branch.  Googlers
      see http://go/clang-r349610-testing
Change-Id: Ibfc97ecdcdc305c97a4169cead1e1e3cddda9c4c
2019-01-31 16:32:34 +00:00
Victor Chang
d48fd64691 exclude_shared_libs should exlude headers in {static|shared}.export_*_lib_headers
am: 51271c1fb4

Change-Id: I57a019a97078ebabfc8809b022bd29c35bbf8f06
2019-01-31 03:14:31 -08:00
Victor Chang
51271c1fb4 exclude_shared_libs should exlude headers in {static|shared}.export_*_lib_headers
Bug: 122882789
Test: m droid vts
Change-Id: I33ec75fa908e557eeadc91c5ca1a5e180bc9f31b
2019-01-31 11:05:03 +00:00
Jiyong Park
356278b9fa "bootstrap: true" modules are using bootstrap Bionic
am: a4b9dd08c0

Change-Id: Ifbed24778563452c2a8bf821fa02d59fe2b2a9ca
2019-01-30 20:55:49 -08:00
Jiyong Park
e9601d6446 bootstrap bionic are moved to ./bootstrap subdir
am: 429660f3c8

Change-Id: Iae5d9adb9ed3177f99958688ecd601713d186675
2019-01-30 20:55:40 -08:00
Jiyong Park
a4b9dd08c0 "bootstrap: true" modules are using bootstrap Bionic
If the bootstrap property is set to true, a binary configured to refer
to the bootstrap linker at /system/bin/bootstrap/linker[64]. This is for
very early processes that are executed before the init makes the linker
by bind-mounting it.

Bug: 120266448
Test: m init_second_stage and use readelf on the built file
DT_INTERP is set to /system/bin/bootstrap/linker64 and

Change-Id: I67487701192f127679cc8127ddc9f53e102ba9c4
2019-01-31 13:44:20 +09:00
Jiyong Park
429660f3c8 bootstrap bionic are moved to ./bootstrap subdir
Bootstrap bionic (the bionic in the system partition that is for the
early processes before the runtime APEX is ready) is now located under
./bootstrap subdirectory. i.e.,
* /system/lib[64]/bootstrap/lib{c|dl|m}.so

Before this change, the bootstrap bionic were self bind-mounted. This is
causing problem with `adb sync` because the path which is a mount point
couldn't be unlinked and thus rewriting is not done.

Now, the mount points and mount sources are clearly separated.

Bug: 120266448
Test: m libc.bootstrap libm.bootstrap libdl.bootstrap
Following files are found under system and recovery/root/system
./lib[64]/bootstrap/libc.so, libdl.so, libm.so

Change-Id: I90399b3181988814ce07875df8c1a36599f3337f
2019-01-31 13:44:20 +09:00
Logan Chien
cf6869990c Merge "Add a header_abi_checker section"
am: 4c20135b19

Change-Id: I414a82c81c1c874595668e2a2c2da74b0cb3dda0
2019-01-30 18:19:56 -08:00
Logan Chien
4c20135b19 Merge "Add a header_abi_checker section" 2019-01-31 02:05:51 +00:00
Jiyong Park
dc9872a0d3 Fix: deps to sanitizer runtime libs are with correct 'image' variant
am: 3b1746a212

Change-Id: Ie04156a9528e39d378d7eddec3500e789381303b
2019-01-30 09:24:27 -08:00
Jiyong Park
c49fa7b522 Merge "Reland "Symbols for libs in APEXes are available""
am: 3a30e13683

Change-Id: I89cfa808ab2f32f9bf4c3d305c9e3f43c0d6faa2
2019-01-30 09:08:28 -08:00
Jiyong Park
3b1746a212 Fix: deps to sanitizer runtime libs are with correct 'image' variant
This change fixes a bug that sanitizer runtime libs for non-core variant
(e.g. recovery, vendor, etc.) are not installed. It happened because the
dependency to the sanitizer runtime lib was without 'image' variant,
which in most case caused only the core variant - which is the first in
the image variants - of the lib to be installed.

Fixing the issue by correctly selecting image variant depending on the
location of the lib having dependency to the runtime lib.

Bug: 123525879
Test: SANITIZE_TARGET=hwaddress m out/target/product/blueline/boot.img
Test: SANITIZE_TARGET=address m out/target/product/blueline/boot.img
libclang_rt.*.so is under
out/target/product/blueline/root/recovery/system/lib64

Change-Id: Iea7d718d4971e36521f0a3f712a454de944cd7ac
2019-01-31 01:58:26 +09:00
Logan Chien
e3d7a0d062 Add a header_abi_checker section
This commit adds a header_abi_checker section so that the library owner
can have a fine-grained control over the ABIs that must be checked.

For example, a library "libexample" may have following configurations:

    cc_library {
        name: "libexample",
        header_abi_checker: {
            symbol_file: "libexample.map.txt",
            exclude_symbol_versions: ["LIBEXAMPLE_PRIVATE"],
            exclude_symbol_tags: ["platform", "apex"],
        },
    }

Bug: 122845490
Test: Add header_abi_checker to libc to filter out LIBC_PRIVATE
Change-Id: I60cfea868f815afe6213c242ed0ca818161d55c6
2019-01-30 22:18:59 +08:00
Jiyong Park
719b4467aa Reland "Symbols for libs in APEXes are available"
This reverts commit eaebd76656.

Bug: 120846816
Test: build/soong/build_test.bash -dist -products mainline_system_arm64
Test: lunch aosp_cf_x86_pasan-userdebug; m && SANITIZE_TARGET=address m

Change-Id: I0d2f3eba33c2d1d034d13839c1bd23970adb9f85
2019-01-30 12:34:46 +09:00
George Burgess IV
5106157118 Merge "config: swap to glibc 2.17"
am: f4803454b0

Change-Id: I7671fe1c1a8bd380aa338cc981cca954fa7d59b6
2019-01-29 14:39:52 -08:00
George Burgess IV
f4803454b0 Merge "config: swap to glibc 2.17" 2019-01-29 22:24:58 +00:00
Alex Light
1a90a8a5c0 Merge "Update compdb to put full path to compiler"
am: 4087dd660f

Change-Id: I9bc32323ed59d55922a8555556f1f9c2807b48de
2019-01-29 12:57:53 -08:00
Alex Light
4087dd660f Merge "Update compdb to put full path to compiler" 2019-01-29 20:52:27 +00:00
Alex Light
4c3b29cd80 Merge "Add support for symlink_preferred_arch in apex"
am: 5956b2b3cb

Change-Id: I0070c0782784b11f9e4d860e15921ba81b9fa3d7
2019-01-29 09:51:36 -08:00
Alex Light
5956b2b3cb Merge "Add support for symlink_preferred_arch in apex" 2019-01-29 17:41:25 +00:00
Alex Light
e812818656 Update compdb to put full path to compiler
Some language servers (vscode) seem to have started to rely on the
compiler being an absolute path recently. This updates the compdb
generator to match this expectation.

Bug: https://github.com/Microsoft/vscode-cpptools/issues/3112
Test: m nothing && m SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
Test: Open vscode
Change-Id: Id146d69c2b808b23896132bbd4bc38ed5c7fd9c7
2019-01-29 17:27:37 +00:00
Orion Hodson
2946369186 Merge "Remove libnativehelper from global includes"
am: 6703e6f390

Change-Id: I2c35da64b0886c0a6a0d24f8432ef9f8ff92319a
2019-01-29 06:41:33 -08:00
Treehugger Robot
6703e6f390 Merge "Remove libnativehelper from global includes" 2019-01-29 14:30:16 +00:00
Jiyong Park
f85699e747 Merge "Create sanitizer variants of APEX only when SANITIZE_TARGET is set"
am: 62f6fcbbb9

Change-Id: Id0f028a8c59f6b99403eb6088532f1ff34e5fb2a
2019-01-28 21:36:13 -08:00
Jiyong Park
b5d6b973f7 Merge "stubs lib can export headers lib"
am: b55752827a

Change-Id: I5060665330da4906d42f9bb9e9e7e5de98256e6e
2019-01-28 21:30:09 -08:00
Logan Chien
5258d3a8ad Merge "Fix a typo related to abidiffs"
am: a9403f279c

Change-Id: Iaefd92f7d7734c5b76d60308b49c36f6bad2bd0d
2019-01-28 21:27:13 -08:00
Jiyong Park
7cb4725f99 Merge "Add __ANDROID_APEX__"
am: 0425aa13ec

Change-Id: I0496dc489bb0805730a392a732724e98a4de6cc6
2019-01-28 21:07:28 -08:00
Alex Light
3d67359f2f Add support for symlink_preferred_arch in apex
Some modules rely on symlink_preferred_arch to have expected files
present. This change makes apexs include these symlinks.

Test: m com.android.runtime.debug
      pushd $(mktemp -d)
      mkdir mnt
      unzip $OUT/apex/system/com.android.runtime.debug.apex
      sudo mount -o loop,ro apex_payload.img mnt
      Ensure that mnt/bin/dalvikvm and mnt/bin/dex2oatd both exist and
      are symlinks to mnt/bin/dalvikvm64 and mnt/bin/dex2oatd32
      respectively.

Bug: 119942078
Bug: 122373634
Bug: 123079311
Change-Id: I47868fbedc5bdd3141a836c488f79e91e0a6ddfe
2019-01-29 03:21:47 +00:00
Treehugger Robot
62f6fcbbb9 Merge "Create sanitizer variants of APEX only when SANITIZE_TARGET is set" 2019-01-29 02:46:31 +00:00
Treehugger Robot
b55752827a Merge "stubs lib can export headers lib" 2019-01-29 01:52:30 +00:00
Logan Chien
a9403f279c Merge "Fix a typo related to abidiffs" 2019-01-29 00:52:31 +00:00
Jiyong Park
7e636d0b98 stubs lib can export headers lib
Add a dependency from a stubs lib to headers libs so that the headers
can be re-exported.

Bug: 122717287
Test: m; a test added to apex_test.go
Change-Id: I8d48c072815c6b02d343ef09cb44dfc6d1af8e64
2019-01-29 07:38:42 +09:00
Jiyong Park
388ef3f5aa Create sanitizer variants of APEX only when SANITIZE_TARGET is set
This fixes a problem that APEX is unconditionally mutated for all
sanitizer types. This can make an APEX to include sanitized version
of a lib even when SANITIZE_TARGET is not set. It can happen when lib X
is directly depended on by an APEX (e.g. via native_shared_libs) and X
has a sanitized variant due to the dependency from another library Y
which is force sanitized (via 'sanitize' property). In that case,
regardless of lib Y is in the APEX or not, the APEX chooses the
sanitized variant of lib X since the dependency from APEX to the lib is
created with AddFarVariationDependency.

Fixing this problem by mutating the APEX for a sanitizer type only when
the device is requested to be sanitized.

Bug: 122717287
Test: add libnetd_client to com.android.runtime APEX.
Inspect build.ninja to verify that libnetd_client.so in the runtime APEX
is not a sanitized one.

Change-Id: I918bc8407137d74c5456142b3a29de13df68c0b3
2019-01-29 07:10:31 +09:00