Commit graph

1917 commits

Author SHA1 Message Date
Jiyong Park
47e4fcb6d3 Don't emit symbol for stubs libraries
The stubs libraries are buildtime-only artifacts. Since they are not
used at runtime, no need to emit symbol files for them

Test: m
Change-Id: I54410e9289b4bf61e23581386b56ade8fba18dfa
2019-02-06 22:40:29 +09:00
Colin Cross
571cccfcbc Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in
build/soong.  A future patch will convert the arguments to
Once* to OnceKey once users outside build/soong have been updated.

Test: onceper_test.go
Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
2019-02-06 01:52:41 +00:00
Dan Willemsen
a55b12bec2 Merge "Stop exporting the windows toolchain to Make" 2019-02-05 20:45:27 +00:00
Kostya Kortchinsky
66b1193d55 Merge "Add option to disable Scudo globally [Soong]" 2019-02-05 14:45:39 +00:00
Jiyong Park
b7c24df220 APEX respects relative_install_path
relative_install_path for cc_library is respected by APEX.

relative_install_path for cc_binary is not yet respected because doing
it will break the path to the dynamic linker in the runtime APEX.
That change should be done along with changes in init, bionic, etc.

Bug: 123721777
Test: m (apex_test.go amended)
Change-Id: I855f8eda0d4255d563861ac96d0d3e2c669e9a2a
2019-02-05 21:00:41 +09:00
Stephen Hines
363cab0bea Merge "Use llvm-{strip,objcopy} by default" 2019-02-05 03:13:14 +00:00
Kostya Kortchinsky
d5275c8657 Add option to disable Scudo globally [Soong]
This adds an option in Soong to turn off Scudo globally.

Bug: 123228023
Test: enable Scudo for tombstoned, lunch marlin_svelte-eng && m -j, and
make sure that Scudo is not linked in
out/target/product/marlin/system/bin/tombstoned
Test: enable Scudo for tombstoned, lunch marlin-userdebug && m -j, and
make sure that Scudo is linked in
out/target/product/marlin/system/bin/tombstoned

Change-Id: I0b0992446953fc4074bde94507b66f92764c8143
Merged-In: I0b0992446953fc4074bde94507b66f92764c8143
2019-02-04 12:29:17 -08:00
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
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
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
42b87a2e56 Merge "Switch to clang-r349610" 2019-02-01 16:49:36 +00:00
Treehugger Robot
101d7600b2 Merge "Fix: runtime apex is not instrumented with sanitizer" 2019-02-01 05:45:22 +00: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
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
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
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
4c20135b19 Merge "Add a header_abi_checker section" 2019-01-31 02:05:51 +00: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
f4803454b0 Merge "config: swap to glibc 2.17" 2019-01-29 22:24:58 +00:00
Alex Light
4087dd660f Merge "Update compdb to put full path to compiler" 2019-01-29 20:52:27 +00: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
Treehugger Robot
6703e6f390 Merge "Remove libnativehelper from global includes" 2019-01-29 14:30:16 +00: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
Dan Willemsen
96ce8e71a3 Stop exporting the windows toolchain to Make
Make no longer supports building for Windows, they must be in Android.bp
files now.

Bug: 122618577
Test: compare build-aosp_arm.ninja before/after
Change-Id: Ie70d8519850da5b1bdddf73788f984eb3f4f0900
2019-01-28 10:59:16 -08:00
Jiyong Park
58e364a373 Add __ANDROID_APEX__
A module can be built multiple times when it is referenced from one
or more APEXes. Sometimes, it is required for the module to behave
differently depending on the context; e.g., do A when built form
APEX M, do B when built for APEX N, and do C when built for platform.

The idea is to have a macro __ANDROID_APEX__ which is set to the
name of the apex that the module is built for. It is undefined when
the module is built for platform.

Bug: 122714993
Test: m (apex_test amended)
Change-Id: I11a89c6a0e799f4810194de7ef9ee472a71ca498
2019-01-28 20:02:27 +09:00
Logan Chien
8f74fe6e14 Fix a typo related to abidiffs
This commit fixes a typo related to abidiffs.  The generated abidiffs
should be copied to `$$DIST_DIR/abidiffs` instead of
`$$DIST_DIR/abidiff`.

(See also. https://android-review.googlesource.com/796458/)

Bug: 123491909
Test: lunch aosp_x86-userdebug && make dist
Change-Id: I89c13580344a27cac5ea0d00497f5bba3227cf61
2019-01-28 14:30:04 +08:00
Orion Hodson
1e7c3d63a9 Remove libnativehelper from global includes
Bug: 119840313
Test: m checkbuild
Change-Id: Id80e26a396c2e289dcd2596a5b799e251d9ccf1b
2019-01-27 11:11:01 +00:00
Colin Cross
eefe9a35b2 Add export_*_lib_headers to static and shared properties
Allow specifying export_static_lib_headers and export_shared_lib_headers
in the static or shared properties of cc_library modules.

Use a named struct for the properties to avoid having to create
a runtime struct type since none of the properties are filtered.
This avoids running into the name length limit in runtime.StructOf.

Fixes: 122882789
Test: m checkbuild
Change-Id: Ib0e9933e93981ba44668a19ed748bd12a4dd4257
2019-01-25 21:27:02 +00:00
Jiyong Park
64a44f231d Make sure that ASAN runtime lib is the first DT_NEEDED one
Introduce a new tag earlySharedDepTag which is added in front of the
ordinary sharedDep dependencies. Dependency to the ASAN runtime lib is
added with the new tag.

Bug: 120894259
Bug: 121038155
Test: m; SANITIZE_TARGET=address m
Use readelf -d to see if the runtime lib is in the first DT_NEEDED one.

Change-Id: I90de6ab95df734a99995532d826564b13fe05316
2019-01-25 14:05:51 +09:00
Treehugger Robot
de54534d2a Merge "Revert "Revert "Fix: sanitizerRuntimeMutator is not run for host""" 2019-01-25 04:54:40 +00:00
Dan Willemsen
e4f12785db Merge "Remove armv7-a without neon support" 2019-01-25 03:52:17 +00:00
Pirama Arumuga Nainar
6aa210243c Revert "Revert "Fix: sanitizerRuntimeMutator is not run for host""
Bug: http://b/123254047

This reverts commit 84757ea7ea.

Reason for revert: veridex asan failure is fixed.

Change-Id: Id03180b8d3d1dc1386fd7e4f800d64dc8578139c
2019-01-25 00:21:02 +00:00
Dan Willemsen
f4e0601c7e Remove armv7-a without neon support
Test: treehugger
Change-Id: I8565d84224daedb6a6dde6dfb9c0fe5f5fabb0f6
2019-01-24 15:51:26 -08:00
Doug Horn
c32c6b0d79 Support building for Fuchsia.
This CL adds configs for the arm64 and x64 fuchsia
device targets, sets up the necessary linker flags,
and disables some functionality that is not currently
supported on Fuchsia.

Bug: 119831161
Test: Compile walleye, internal validation against
fuchsia_arm64-eng and fuchsia_x86_64-eng.
Change-Id: I2881b99d2e3a1995e2d8c00a2d86ee101a972c94
2019-01-24 18:59:29 +00:00
Dan Albert
84757ea7ea Revert "Fix: sanitizerRuntimeMutator is not run for host"
This reverts commit 1c29b0e6ec.

Reason for revert: Broke aosp_x86_64

Change-Id: I581200f1c271c3e1a39d5cdad84c782977b13054
2019-01-23 23:33:25 +00:00
George Burgess IV
7294cdced0 config: swap to glibc 2.17
**Please do not revert this change without consulting with either
srhines@ or gbiv@ first. It's a large change, and if it only causes
simple/small breakages, we plan to fix those as they pop up.**

This CL swaps the host Android Linux toolchain to gcc 4.8.3 + glibc
2.17, landed in Ieeed444801160e3d288bbad7d871067e81411118.

Bug: 111358231
Test: We've done extensive testing on internal master. Please see
      Ieeed444801160e3d288bbad7d871067e81411118.
Change-Id: If991a603a3dce33b55086672c27a11992f0f3123
2019-01-23 14:02:10 -08:00