Commit graph

14 commits

Author SHA1 Message Date
Elliott Hughes
aa8db1b9d1 Fix/update notices.
Auto-generate NOTICE files for all the directories, and for each one
individually rather than mixing libc and libm together.

Test: N/A
Change-Id: I7e251194a8805c4ca78fcc5675c3321bcd5abf0a
2021-02-16 15:06:50 -08:00
Elliott Hughes
f762275e6a Show coverage for libm too.
Test: manual
Change-Id: Idf50d918ad53ff2d5a3097dfcbd5a392d6f0ed31
2020-08-12 10:25:45 -07:00
Elliott Hughes
7f354436f2 Improve the coverage script.
This now works for ARM as well as Intel.

Also combine both the 32-bit and 64-bit results (since we have code
that's only executed in one variant or the other, the union of the two
seems like what we actually want to measure).

Also make the script executable.

Test: ./bionic/build/coverage.sh
Change-Id: I4e3a7f4cd60fda060b956a960cfb9b703d3670e7
2020-08-11 10:00:30 -07:00
Pirama Arumuga Nainar
abf40321a1 Add a script to generate coverage.
1. Prereqs: Coverage-enabled build.
  $ lunch <target>
  $ m NATIVE_COVERAGE_PATHS="bionic" CLANG_COVERAGE=true
  $ m NATIVE_COVERAGE_PATHS="bionic" CLANG_COVERAGE=true bionic-unit-tests
2. Flash image and set $ANDROID_SERIAL
3. $ bionic/build/coverage.sh

HTML report is generated to /tmp/bionic-coverage

Test: build/coverage.sh
Change-Id: I33c7d47d218a68a250076f063cfbdbaab91acc74
2020-08-05 15:53:19 -07:00
Ryan Prichard
3cfb89d451 run-on-host fixes
* Fix the path to bionic-benchmarks-glibc

 * Add symlinks for the toybox symlink commands. Each symlink bypasses the
   intermediate symlink in ${OUT}/system/bin and points to the final
   toybox binary. Suppress a bunch of warnings by skipping symlinks for
   non-existent files.

   The new spawn benchmarks try to run /system/bin/true. (They also try to
   run /vendor/bin/true and print an error.)

 * Quote "$@"

 * Use soong_ui.bash --dumpvars-mode to set a bunch of variables, rather
   than get_build_var, which invokes Soong once per variable. This reduces
   the "build/run-on-host.sh" runtime from 4s to 1.3s.

 * build/run-on-host.sh isn't executable and is only useful when it's
   sourced into another shell, so remove its shebang to reduce confusion.

Bug: none
Test: \
  . build/envsetup.sh
  lunch aosp_x86_64-userdebug
  . bionic/build/run-on-host.sh
  prepare MODULES-IN-bionic MODULES-IN-external-toybox
  /system/bin/true

Change-Id: I59e9a6aca77d35b16bdf51759c5fc7e725bfc67c
2019-09-24 15:36:31 -07:00
Elliott Hughes
4da99ffe5e Fix running tests/benchmarks on the host.
This was broken by all the mainline modules stuff. It's quite a bit
hairier to set up now, given that we don't have an apexd on the host.
An alternative might be to actually set up a fake /apex that points to
the bootstrap directories?

Test: ./benchmarks/run-on-host.sh 64
Test: ./tests/run-on-host.sh 64
Change-Id: If2c277ba492c7c443cdf51526ea42f56568e2ea6
2019-04-26 17:45:17 -07:00
Elliott Hughes
8ceb95c506 Fix running the tests on the host again.
Bug: N/A
Test: ran the tests on the host under glibc
Change-Id: Id05a896bdd11b231304ed1a08ef24e1a661ee20d
2019-03-26 14:47:08 -07:00
Jiyong Park
036e09c36e Don't install *.mountpoint targets
The *.mountpoint targets that installs /bionic/lib/lib*.so and
/bionic/bin/linker* are no longer needed.

Now, /system/lib/lib*.so and /system/bin/linker* are simply symlinks to
the corresponding files in the runtime apex. For example,

/system/lib/libc.so -> /apex/com.android.runtime/lib/bionic/libc.so

This is made possible because we now activate APEXes even before the
data partition is mounted. Before the data partition mounting, the
APEXes from the system partition are ativated. After the data partition
is mounted, updated APEXes in the partition (if any) are activated. As a
result, the symlink always points to the valid path regardless of
whether /data is mounted or not.

Bug: 125549215
Test: device boots
Change-Id: Ie7d83686abe00b3c436f9f9db75d4244200a0fc9
2019-03-14 07:35:52 +09:00
Jiyong Park
88d03200d4 Fix: symbols/bionic/lib64/libc.so is the wrong variant
The new module type bionic_mountpoint wasn't mutated by the sanitizer.
As a result, it has been taking non-sanitized symbol libraries even for
sanitized builds. Fixing the issue by making the module type to
implement the cc.Sanitizeable interface so that it can be mutated by the
sanitizer.

Bug: 124469750
Test: SANITIZE_TARGET=hwaddress m
Inspect Android-<target>.mk and check that LOCAL_SOONG_UNSTRIPPED_BINARY
for libc.mountpoint module is pointing to a hwasan variant of libc.so

Change-Id: I10c863c0dbd361463648a4b7d897a4f88a9c85cb
2019-02-15 12:15:27 +09:00
Jiyong Park
acb4d21a2a Symbols files under $(OUT)/symbols/bionic/
We need symbol files for /bionic/* paths.

New property "mountsource" is added to specify the "real" module that
the bionic mountpoint module is a mountpoint for. The real module
provides path to the unstripped elf file, which is installed to the
symbols/bionic/* path.

Bug: 123985838
Test: m libc.mountpoint libm.mountpoint libdl.mountpoint
linker.mountpoint
$(OUT)/symbols/bionic/bin/linker, bionic/lib[64]/lib{c|dl|m}.so exist

Change-Id: I43f074f0076b576f214fe92a98689a413efd3daa
2019-02-11 16:05:48 +09:00
Jiyong Park
a5f914aef1 Add bionic mount points under /bionic
This change adds following files and symlinks:

Files:
/bionic/lib[64]/lib{c|dl|m}.so
/bionic/bin/linker[64]

Symlinks:
/system/lib[64]/lib{c|dl|m}.so -> /bionic/lib[64]/lib{c|dl|m}.so
/system/bin/linker[64] -> /bionic/bin/linker[64]
/system/bin/linker_asan[64] -> /bionic/bin/linker[64]

The files serve as mount points for either the bootstrap Bionic or the
default Bionic from the runtime APEX. init does the bind-mounting during
booting.

The symlinks are there to not change the ordinary paths to the bionic
files; there are many places that the paths are implied or hard-coded,
e.g., dlopen("/system/lib/libc.so") or DT_INTERP pointing to
/system/bin/linker in the vendor prebuilts.

Bug: 120266448
Test: m blueline, cf_x86, aosp_arm
The aforementioned files and symlinks are found

Change-Id: I97e38c29409ac0610dde285db8df6e94a7930094
2019-01-31 13:44:20 +09:00
Colin Cross
2722ebb30b Convert bionic benchmarks and tests to Android.bp
The compile-time tests and a few custom libraries for dynamic linker
testing are still compiled in make.

Also converts the make rules to run tests on the host to shell scripts
in tests/run-on-host.sh and benchmarks/run-on-host.sh

Change-Id: I6f174b3a69d58c4ed74d29f4e79332d483681534
2016-07-14 12:30:12 -07:00
Dmitriy Ivanov
c7cbde320c Fix warning: overriding commands for target
Change-Id: I00fb4d6a8ff388722b75de9a0f4316619aaf9320
2014-12-03 09:51:37 -08:00
Dmitriy Ivanov
06b1b8ceac Extract bionic-prepare-run-on-host to inc file.
Make benchmark run-on-host depend on bionic-prepare-run-on-host.

Change-Id: I0bdbf561b2580d607a49b7c83cc273320ac55429
2014-12-02 15:15:34 -08:00