Commit graph

739 commits

Author SHA1 Message Date
Dan Willemsen
18ffd5891e Remove import_includes/export_includes
Now that ONE_SHOT_MAKEFILE no longer exists, we don't have to rely on
the filesystem to store this informtion.

This removes ~16.7k files from our build graph
(aosp-master/aosp_arm64-eng), though only about 600 of them were being
used in a normal build.

Test: treehugger
Change-Id: I3ac12f5ea7f11d25064109a0599bc5be1976fba5
2019-08-01 14:56:45 -07:00
Dan Willemsen
8b8b9b6bf8 Merge changes from topic "rm_ONE_SHOT_MAKEFILE"
* changes:
  Remove [jni_]link_type files
  Remove support for ONE_SHOT_MAKEFILE
2019-08-01 21:11:02 +00:00
Dan Willemsen
5c3fc2a792 Remove support for ONE_SHOT_MAKEFILE
Test: treehugger
Change-Id: Ie73418c186ec4c0e1c91078c133de8f8113295bf
2019-07-31 18:08:47 -07:00
Pirama Arumuga Nainar
bf2af95f73 Explicitly add lld's relr relocation flags for Android Pie and above
Bug: http://b/119086751

https://android-review.googlesource.com/c/837025 disabled lld relocation
packing globally and enabled it for soong modules targeting pie and
above.  Turn it on for Android.mk modules as well.

Test: grep for -Wl,pack-dyn-relocs=android in
      out/build-aosp_<device>.ninja

Change-Id: I81b8625073aa6b364219b8cf3122b69c95ec7589
2019-07-30 22:36:29 -07:00
Peter Collingbourne
e3606ae651 Specify the API level via the triple instead of __ANDROID_API__.
Clang derives the value of __ANDROID_API__ from the triple these days. In a
future version of clang I plan to start making the behaviour of the HWASAN pass
dependent on the API level in the triple, so it's going to need to be accurate.

Test: walleye-userdebug boots
Change-Id: I23f570bd8ee4fb3167729a75a5e859efe1883a46
2019-07-25 17:43:04 -07:00
Jeffrey Vander Stoep
972695d81d Merge "Renderscript: change extension .rs to .rscript" 2019-07-18 02:02:00 +00:00
Jeff Vander Stoep
c44aa3be41 Renderscript: change extension .rs to .rscript
Reserve .rs extension for Rust.

Bug: 137365032
Test: make checkbuild
Test: cd frameworks/compile/slang/tests
    ./slang_tests.py
Test: atest CtsRenderscriptTestCases
Test: CtsRsCppTestCases

Change-Id: Ibfccb4f52b74f9ac95c373f48d775254ba77288d
Merged-In: Ibfccb4f52b74f9ac95c373f48d775254ba77288d
2019-07-17 18:57:49 +00:00
Pirama Arumuga Nainar
b8f898ef88 Add libprofile-extras to all link steps when NATIVE_COVERAGE is enabled.
libprofile-extras has a wrapper to getenv() that appends the effective
userid (euid) of the current process to GCOV_PREFIX.  This avoids
conflicts and permissions issues when multiple processes try to
create/access the same directories and files under /data/misc/trace.

This library needs to be added and the -Wl,--wrap,getenv flag needs to
be passed to all link steps.  Since Android.mk does not propagate flags
and libraries across dependencies, this change just adds the library and
flag to all non-static-library Android.mk modules.  As a consequence,
*ALL* binaries created via Android.mk will have the signal handler and
property watcher thread in libprofile-extras but they are no-ops in
non-coverage-enabled binaries.

The dependency is added early enough in core/binary.mk so that the
LOCAL_SOONG_LINK_TYPE resolutions occur correctly.

Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...

Change-Id: I4d5f849c15e9a278253f2148185ddf3ab2878e2f
2019-07-08 15:13:31 -07:00
Dan Willemsen
b441630067 Depend on NDK libraries
Bug: 130111713
Test: treehugger
Test: build system image with RBE
Change-Id: Ibbe4e11a7681c52d2197ce35ae47d4939ca246b6
2019-06-12 21:35:46 +00:00
Dan Willemsen
c5b7c4fbef Add dependencies on the toolchain (clang, etc)
Historically, we've relied on the path to the clang compiler changing in
order to trigger rebuilds instead of direct dependencies on the compiler
itself. That's somewhat more reliable, since the actual $(CLANG) file is
often a script that doesn't actually change during every update.

In Soong, we've added the dependency anyway, so do it here as well. This
makes it easier for my RBE experiments to identify when we intend to use
clang and to send the entire compiler.

Test: treehugger
Test: build a system image with RBE, find that every command that needed
the compiler gets it.
Change-Id: I3838b5d77884394a8c0f7a1ba133142102602084
2019-06-12 21:34:52 +00:00
George Burgess IV
40ecaea185 Merge "Remove our clang-tidy wrapper"
am: 6afe016825

Change-Id: I628822559916c1b36b326fa4ed9d614fae696c34
2019-04-05 17:17:10 -07:00
George Burgess IV
09e5d9b2ba Remove our clang-tidy wrapper
Looks like the reason for it existing has been fixed. It should probably
just be removed.

Bug: None
Test: WITH_TIDY=1 m
Change-Id: Ic001393da7211cd6ef2bbd5af6ef13c7fe8e00e7
2019-04-04 16:21:53 -07:00
Vic Yang
38f68f7a2a Merge changes from topic "vndk-no-vendor-variant"
am: 30dda1da5e

Change-Id: I646d55e6195a24530bf22d1e7588b2dd99b27eba
2019-03-20 21:39:57 -07:00
Vic Yang
51512c558c Add support for no-vendor-variant VNDK
When TARGET_VNDK_USE_CORE_VARIANT is set to true, the vendor variant of
VNDK libraries are by default not installed.  Instead, the core variant
will be used by vendor binaries at runtime.

To ensure the core variant of VNDK libraries are installed, we also add
a flag LOCAL_VNDK_DEPEND_ON_CORE_VARIANT to indicate that the vendor
variant module depends on the core variant module.  This flag should be
set by Soong for all VNDK libraries without the vendor variant
installed.  When the flag is set, the vendor variant binary is also
compared against the core variant binary to ensure they are
functionally identical.

As we are merging the two variants for some libraries, we need a new
link type to denote a module is usable as both native:vndk and
native:platform.  We add native:platform_vndk for this.

Bug: 119423884
Test: With the corresponding Soong change, build with
      TARGET_VNDK_USE_CORE_VARIANT set to true.
Test: Add a dummy VNDK library and a dummy vendor binary that depends
      on it.  Build with no-vendor-variant VNDK and check the core
      variant is installed.
Test: Add conditional compilation based on __ANDROID_VNDK__ in the
      dummy VNDK library and check build fails.

Change-Id: I40000f2728e8193212113c1ee950e9d697f2d40d
2019-03-20 10:23:04 -07:00
Dan Willemsen
5d340e1552 Merge "Deprecate *.c[pp].arm"
am: fb8c9673e7

Change-Id: I45b1d106affd02ea2e9c77fd462d1d6e7269377f
2019-02-25 14:57:01 -08:00
Dan Willemsen
46267cb4d8 Deprecate *.c[pp].arm
There never were too many users of this, and I've just converted the
last ones to Soong.

Test: diff build-aosp_arm.ninja
Test: treehugger
Change-Id: Ida6d486a62d0b521c1cd67f5f18c0ad0dbe957e3
2019-02-21 18:02:13 -08:00
Xin Li
0e2ccf21c9 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: Ic9e8ff5af22140dc6ef8ff87a09f9292f9d30dc5
2019-02-21 09:32:40 -08:00
Yu Shan
655f17cf88 Add 32BIT and 16BIT nanopb library.
Add 32BIT and 16BIT compile time flag for nanopb library to support
16BIT or 32BIT size, default is 8BIT. User need to use the corresponding
library when define the PB_FIELD_* flag during compilation.

Change-Id: I0d25bcdf62d6b47733e1ad4bddbd4dfce2192b5d
Test: None
Bug: 122292884
2019-02-19 12:01:43 -08:00
Pirama Arumuga Nainar
5aab10f40d Merge "Enable coverage only when LOCAL_SDK_VERSION > 23" 2019-02-14 00:05:57 +00:00
Dan Willemsen
f264690860 Remove support for building Windows modules in Make
These now must be defined in Android.bp files.

Bug: 122618577
Test: compare build-aosp_arm.ninja before/after
Test: codesearch for LOCAL_MODULE_HOST_OS.*windows
Change-Id: I14451c7753299692940e026f85687b4c3331bb07
2019-02-05 00:19:41 -08:00
Ivan Lozano
0679bddedd Merge "Enable execute-only memory layouts by default." am: 77cd60adcb
am: b8b096a569

Change-Id: I9be726e692c74445552b2cb266c2679e133c7b98
2019-01-15 15:53:43 -08:00
Ivan Lozano
c244c21573 Enable execute-only memory layouts by default.
This enables execute-only memory (XOM) layouts to be used by default in
the build system. As of now, there's only support for ARM64 devices, so
this only affects those. Since userland XOM requires kernel support,
devices without the necessary support will continue to allow pages
marked execute-only to be read and they should be unaffected by this.

Bug: 77958880
Test: Device with and without kernel support boot.
Test: Binary throws segfault when reading from XOM on supported device.
Test: Debugger works and stack traces are still generated correctly.
Test: Teamfooding, stable during regular usage.

Change-Id: I8db4235c8e60eea6d701bdf3c43b79a06d6b01cd
2019-01-15 13:05:59 -08:00
Dan Willemsen
e0a9fc9d8a Merge changes I68c8a566,Ib8a588e5 am: 73e13b5030
am: e6ef8196a9

Change-Id: Ief40b3772b8cc00ee1beff746fcfc164be972d19
2019-01-10 20:42:24 -08:00
Dan Willemsen
11ee341199 All all_objects to LOCAL_INTERMEDIATE_TARGETS
This fixes the WITH_TIDY flakes that we've been seeing, as we've been
relying on a particular order of target-specific variable inheritance.

Change-Id: I68c8a56620c29a41e45f26e5ea81a5313490c1cf
Fixes: 122637600
Test: WITH_TIDY=true m libhellojni_jni
2019-01-10 13:21:07 -08:00
Dan Willemsen
e24da82ffd Reorder binary.mk to move LOCAL_INTERMEDIATE_TARGETS later
I'll be adding more intermediate targets in this file, so move all of
the uses closer to the end.

Bug: 122637600
Test: build-aosp_arm64.ninja is the same before and after
Change-Id: Ib8a588e570cb2a61bab75118db6e480d6afceaa8
2019-01-10 13:10:17 -08:00
Dan Willemsen
afbfff0d2d Merge "Stop trying to read depfile from vtsc" am: 82f2cb078f
am: d372e54742

Change-Id: Icf04b6a21e42e80ea95bdefc9b6484edf55d425e
2019-01-10 10:08:07 -08:00
Dan Willemsen
5125746561 Stop trying to read depfile from vtsc
vtsc just ignores the -d argument and apparently can't write a depfile.
So for now, just stop assuming it produces one.

Bug: 121058584
Bug: 120496070
Test: NINJA_ARGS="-w missingdepfile=err" m libvts_interfacespecification
Change-Id: Ie1483fbeead9f710d8a6636df07ce44bbc4a6e2d
2019-01-09 16:40:58 -08:00
Pirama Arumuga Nainar
9305e203f0 Enable coverage only when LOCAL_SDK_VERSION > 23
Bug: http://b/116873221

The coverage runtime (libclang_rt.profile) needs stderr, which is
exported by bionic only after API level 23.

Test: Build with coverage on globally
Change-Id: I1bdfbbf248d1743d529e9f40f0b52da92bb20ef7
2018-12-20 13:49:52 -08:00
Xin Li
3449df5704 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Ib1b590fc605b17e3a3901e65f62d5f7ad2257f6a
2018-12-11 14:03:11 -08:00
Ivan Lozano
6750532978 Merge "Disable AArch64 XOM when not using lld." 2018-11-29 15:58:39 +00:00
Dan Albert
638ca85aec Merge "Don't use libandroid_support post-21." 2018-11-28 16:19:01 +00:00
Ivan Lozano
f9f03e0119 Disable AArch64 XOM when not using lld.
AArch64 execute-only memory is only supported when using lld as the
linker. There's still a few modules which don't use lld, so in those
cases we need to disable this option.

Bug: 77958880
Test: Module with LOCAL_USE_CLANG_LLD false builds without XOM
Test: Module without LOCAL_USE_CLANG_LLD defined builds with XOM

Change-Id: I5dfe3cd1e1cac2b3ead13912af9f7fe896d507e9
2018-11-27 14:53:33 -08:00
Dan Albert
e6d958aed7 Don't use libandroid_support post-21.
Test: m checkbuild
Bug: http://b/119587551
Change-Id: If3a3556ad27e632778efda43da8384a40eedee5a
2018-11-27 13:59:28 -08:00
Ivan Lozano
fda9a6f38e Add support for AArch64 XOM binaries.
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new LOCAL_XOM property. Also adds
support for an ENABLE_XOM build flag for global builds.

Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: I6af9e3615d0a9fdff802eae50e6ad94311ec8046
2018-11-21 09:05:08 -08:00
Yi Kong
f41d24acb3 Merge changes I52805f5d,Ifb16ed87
* changes:
  Allow projects to exclude from libcrt_builtins
  Move libgcc to libcrt.builtins
2018-11-13 21:56:47 +00:00
Jaewoong Jung
e8cb1954bb Add -CROSS suffix to cross host OS notice targets.
This fixes a bug where cross host OS notice dependecies were incorrectly
added and caused missing file errors.

Bug: 36073965
Test: Manual build + inspection
Change-Id: I3983ad6158acf939842f836fe3f44cecf9187087
2018-11-08 16:53:02 -08:00
Yi Kong
95fd9d171d Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

Bug: 29275768
Bug: 119007754
Test: m checkbuild
Change-Id: Ifb16ed87afc3391f8830d771971315515f929235
Merged-In: Ifb16ed87afc3391f8830d771971315515f929235
(cherry picked from commit b9d8932279)
2018-11-08 13:40:34 -08:00
Dan Willemsen
7a5c5d730f Update for flags passed from Soong
Obsolete more GCC-specific flags, TARGET_(arm|thumb)_CFLAGS now contains
pre-filtered clang flags, and GLOBAL_CLANG_CFLAGS_NO_OVERRIDE now
contains all flags instead of just the clang additional flags.

Test: m
Change-Id: I068f155041e681068d38e1a5b6b04d354b85ccee
2018-10-07 19:43:23 -07:00
Chih-Hung Hsieh
1d9f04ff53 Strip spaces in my_tidy_flags.
Test: make with WITH_TIDY=1 DEFAULT_TIDY_HEADER_DIRS="d1/d2|external/*"
Bug: 32668284
Change-Id: I7443210444d65d7e31b91b312bc518e40167305d
2018-09-21 10:30:31 -07:00
Colin Cross
a70669e4a5 Merge "Don't set -pie for windows modules" 2018-09-20 00:00:42 +00:00
Colin Cross
feb4a7e4ae Don't set -pie for windows modules
Adding -pie to LOCAL_LDFLAGS for host linking leaves it around
when doing the host cross Windows linking, resulting in a warning:
clang-7: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Add it later in binary.mk after the flags have been copied to the
single-use my_ldflags.

Bug: 115776263
Test: m checkbuild
Change-Id: I70d71fa1ec6445631dc7e89ef61927a3304375e2
2018-09-19 15:18:17 -07:00
Dan Willemsen
8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Treehugger Robot
007f27aa4a Merge "fix: linktype for recovery modules in ASAN build is native:platform" 2018-09-12 23:54:48 +00:00
Jiyong Park
a52b6e9ba8 fix: linktype for recovery modules in ASAN build is native:platform
When ASAN is on, recovery modules are instaled to
$(OUT_DIR)/target/product/.../data/asan/recovery/root. However, since
this is not under $(TARGET_RECOVERY_OUT), their linktype is incorrectly
determined as native:platform, instead of native:recovery.

To fix this, use get_non_asan_path to have consistent paths when
determining the linktype.

Bug: 115361480
Test: m -j; SANITIZE_TARGET=address m -j

Change-Id: I75edb1fe193d8a1a8099d4f5cf498910ca868d38
2018-09-12 10:05:58 +09:00
Colin Cross
8fb525db71 Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Relands I8b37dda2b449b6b5d48d5b983f43de452f494a1e with fixes for
builds with GENERATE_BREAKPAD_SYMBOLS=true

Bug: 113936524
Test: m checkbuild
Change-Id: Id41cd76ccb1b5bb6ac43b41ae3e8f1ce46d7ad7e
2018-09-10 14:46:52 -07:00
Colin Cross
635733b816 Revert "Add soong_cc_prebuilt.mk"
This reverts commit 1bb943b97c.

Reason for revert: broke mac builds
Bug: 113936524

Change-Id: I5b3d8eb1314eb322a5f9c578623ac89e2ad25706
2018-09-10 21:35:55 +00:00
Colin Cross
1bb943b97c Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Bug: 113936524
Test: m checkbuild
Change-Id: I8b37dda2b449b6b5d48d5b983f43de452f494a1e
2018-09-10 11:04:05 -07:00
Dan Willemsen
f063839de9 Remove GCC support from Make
Test: out/build-aosp_arm64.ninja is the same before/after
Test: build_test on downstream branches
Change-Id: If7f8c12f2f288b1e589689361f9457acae634882
2018-09-06 15:40:00 -07:00
Chih-hung Hsieh
385ba5c434 Merge "Filter out unknown arguments with clang-tidy.sh." 2018-08-28 18:18:32 +00:00
Chih-Hung Hsieh
be5dd2023e Filter out unknown arguments with clang-tidy.sh.
* Call clang-tidy.sh defined in PATH_TO_CLANG_TIDY_SHELL.
* Add dependency to clang-tidy and clang-tidy.sh.

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I90175ea1489272d8d4fc0f9ba4e5bbfdc7399d82
2018-08-28 09:45:39 -07:00