Commit Graph

664 Commits

Author SHA1 Message Date
George Burgess IV 5ab07d4f14 make: add __clang_analyzer__ to clang-tidy
We have code that acts slightly differently when the static analyzer is
running, so that it can produce more accurate diagnostics (e.g. less
false positives). It uses __clang_analyzer__ to detect the static
analyzer.

When the static analyzer is run via clang-tidy, __clang_analyzer__
doesn't get defined.

Bug: None
Test: WITH_TIDY=1 m. clang-tidy now acts as expected in code made for
the static analyzer

Change-Id: Ib2a815c0bd67553af465b64207bb480fb52cfaf8
2017-05-03 18:10:47 -07:00
Dan Willemsen 2e68205f3e Merge "Exempt UBSAN runtime library from soong_to_convert" am: 94751070e8 am: 0d694416d2
am: 97018accea

Change-Id: I7d14fcfbf6b42611cdce83517328f50ad157885a
2017-05-03 01:28:40 +00:00
Dan Willemsen 0bf506f44a Exempt UBSAN runtime library from soong_to_convert
Soong already uses it, just not as a prebuilt module.

Test: Compare soong_to_convert.txt before/after
Change-Id: I6ffa0d967635d52b7b4f8b2b0465cd50254f22b9
2017-04-25 16:26:43 -07:00
Jiyong Park 073a53d177 Merge "make libprotobuf-cpp-* libs VNDK" am: cd46573189 am: e56c17d779
am: 2fc3e30205

Change-Id: Ie5614a40dc29bfc98db3c107e9f5f02af3712afe
2017-04-21 07:57:01 +00:00
Treehugger Robot cd46573189 Merge "make libprotobuf-cpp-* libs VNDK" 2017-04-21 07:46:20 +00:00
Dan Willemsen 4e9e5d526c Merge "Rewrite link type checking" am: e4d92ef568 am: d76aaed983
am: e834d5f059

Change-Id: I02342b80077a7e1e36e61d1f9384d3b104a982c1
2017-04-20 15:15:19 +00:00
Jiyong Park c8f57d92ff make libprotobuf-cpp-* libs VNDK
libprotobuf-cpp-* libs are VNDK, However, since the '.vendor' prefix is
added before libprotobuf-cpp-* libs are added to my-*-libraries by
LOCAL_PROTOC_OPTIMIZE_TYPE, the clients are still linked against to the
platform version of the protobuf libs. As a result, link type error
occurs.

In order to avoid this, '.vendor' prefix is appended after
my-*-*libraries are all updated.

Test: normal build successfull
Test: add vendor_provided:true to libprotobuf-cpp-* and build successful
with BOARD_VNDK_VERSION=true

Change-Id: I1ed7978f03e0db56b4cbee86e286c0787f7a3afc
2017-04-20 15:41:51 +09:00
Dan Willemsen b47d4e9cf1 Rewrite link type checking
All the new features are turned off for now, since multiple branches and
products need to be verified before they can be turned on. So everything
should behave the same as today, except for no partition-based
warnings.

Instead of the current link type checks that happen during the build,
run as many as possible immediately after loading all the Android.mk
files. If we're allowing missing dependencies ('mm',
ALLOW_MISSING_DEPENDENCIES, tapas, etc), we'll defer the link type
checks to during the build. If we're not allowing missing dependencies,
we'll produce a better error message to the user about the missing
dependencies.

See core/main.mk for a description of the storage format.

This also remove the partition-based type checking. It hasn't worked all
that well, particularly with ASAN builds. The new VNDK checks will
handle the most pressing cases.

Test: Verify all link_type files and dependencies are the same:
  grep link_type: out/build-aosp_arm64.ninja | sed -E "s/ rule[0-9]+//" | sort
Change-Id: Id643658b9d9e84f99f5db0d526aad88c1f5d3417
2017-04-19 22:41:32 -07:00
Vishwath Mohan f1760bde83 Merge "Make PIC/PIE levels compatible for LTO." am: 4be1d8823e am: dc8469e858
am: 648a3380e2

Change-Id: I0ddd3324811be38846da7076dceea77e43cc0fe7
2017-04-18 02:06:07 +00:00
Vishwath Mohan c3b255622d Make PIC/PIE levels compatible for LTO.
The build system currently uses -fPIC for position independent
libraries, and -fpie for position independent executables. However,
these levels are incompatible and conflict when an executable includes
a static lib with the -fPIC flag - such as when building with
LTO. This CL changes the flag for executables to the compatible -fPIE
instead, which is equivalent for all architectures except PowerPC.

Bug: 30227045
Test: ENABLE_CFI=true m -j40 checkbuild # builds and boots
Change-Id: Ieb20bc2528300d88ff05e8787c5840ab6f03fb38
2017-04-17 16:16:33 -07:00
Dan Willemsen bfdfb66954 Merge "Support split /system and /vendor modules from Soong" am: 4e789c2e57 am: 9fc091f756
am: 6ac7ce63e5

Change-Id: I66f86a4215010f0861ea77ee53a5db7fb3153c90
2017-04-12 00:21:59 +00:00
Dan Willemsen 9d2b3280e8 Support split /system and /vendor modules from Soong
Soong modules may be split into both /system and /vendor variants.
Ensure that Make libraries link against the correct version based on
whether LOCAL_USE_VNDK is set.

Bug: 36426473
Bug: 36079834
Test: build-aosp_arm64.ninja files are the same before/after
Test: attempt building with BOARD_VNDK_VERSION:=current
Change-Id: I229bc290373743406275f3ca16081eae04c27987
2017-04-10 15:54:50 -07:00
Dan Willemsen 864955d152 Merge "Add LLNDK support for the VNDK" am: 2d6e79d268 am: 67eb8bb766
am: 7bc488c0ec

Change-Id: I6717b28deac9e8fea5bcfe53885aeea90ca04732
2017-04-07 21:39:01 +00:00
Dan Willemsen ffa3258f6c Add LLNDK support for the VNDK
Instead of using the NDK headers and libraries, add LL-NDK specific
headers and library stubs for VNDK users. This allows us to provide an
expanded liblog interface.

Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j
Change-Id: I0197f44c91218c73b9567a05320c91a2baaae39b
2017-04-07 21:21:24 +00:00
Dan Willemsen 2a8a39398b Add LOCAL_EXPORT_CFLAGS for Soong
This lets Soong pass -isystem or -I as necessary (or potentially, even
other cflags in the future).

This is not available for Android.mk use, nor exposed directly to
Android.bp users.

Test: m -j
Merged-In: Id37d4692d5fbddce467bd777903b20169f44dd6e
Change-Id: Id37d4692d5fbddce467bd777903b20169f44dd6e
2017-04-05 03:36:00 +00:00
Dan Willemsen 05909fae9f Add LOCAL_EXPORT_CFLAGS for Soong
This lets Soong pass -isystem or -I as necessary (or potentially, even
other cflags in the future).

This is not available for Android.mk use, nor exposed directly to
Android.bp users.

Test: m -j
Change-Id: Id37d4692d5fbddce467bd777903b20169f44dd6e
2017-04-05 01:04:18 +00:00
Dan Willemsen 51ad7f244e Merge "Ensure that BOARD_VNDK_VERSION is current" am: 4ef5040cc3 am: a71a8c0ae3
am: 5148a458a2

Change-Id: I6c953a8085f7f33a84b99c1ad5359a8bf8cb8921
2017-03-29 04:45:05 +00:00
Dan Willemsen 2c3289bf37 Ensure that BOARD_VNDK_VERSION is current
BOARD_VNDK_VERSION controls which version of the VNDK is used for the
build. We only support compiling against the current VNDK, and we don't
support installing old prebuilt VNDK libraries yet, so ensure this
variable is set to "current".

Once we support installing old prebuilt VNDK libraries, we'll also need
to disable building modules that use the VNDK.

Test: build-aosp_arm.ninja is the same before/after
Test: Ensure there are no boards that set BOARD_VNDK_VERSION
Test: Set BOARD_VNDK_VERSION := invalid
Change-Id: Ic26c9f44e356a0734f522b4538cb866d5b901d43
2017-03-27 22:55:21 -07:00
Sen Jiang 67b7aaab7d Merge "Remove DBus support." am: cf858d873b am: efcda5173d
am: 3d6b408aea

Change-Id: I183f58049ef63ce8f6bfbd67554199878b7a69cb
2017-03-03 21:02:37 +00:00
Sen Jiang d1f397e8b4 Remove DBus support.
external/dbus and external/dbus-binding-generator was removed from
the manifest.

Bug: 31602715
Test: make checkbuild
Change-Id: Iea0277720acad8ac0fa630b8745f90fb3c3b5f00
2017-03-02 18:00:21 -08:00
Ryan Campbell 8beb26d5cb Merge "Use c and cpp objects for gcov." am: d579b8eb1f am: 425bbada28
am: 74ec2776e8

Change-Id: Ibc591b89c7c674dd9afaa98acff994eec2faa2fd
2017-03-01 03:14:53 +00:00
Ryan Campbell 5a6ea36cb8 Use c and cpp objects for gcov.
Instead of using all_objects and translating .o to .gcno, use
cpp_objects, gen_cpp_objects, c_objects, gen_c_objects, objc_objects,
and objcpp_objects. Fixes bug with .s files breaking coverage builds.

Bug: 35843991
Test: lunch sailfish-userdebug && make -j60 NATIVE_COVERAGE=true
COVERAGE_PATHS="vendor/google_devices/marlin/proprietary/mm-camera/mm-camera2"
Change-Id: Ib2f8eef889f075ec82f79d8c3ae0fe31962b653d
2017-02-28 16:29:06 -08:00
Ryan Campbell dbe80a6445 Merge "Support path exclusion for native coverage." am: e317a2d19e am: 26a4ce0b65
am: ab93845a78

Change-Id: I94106f8b4f9f40dd3cac9fafa5f2d23931975acd
2017-02-28 02:15:26 +00:00
Treehugger Robot e317a2d19e Merge "Support path exclusion for native coverage." 2017-02-28 02:06:57 +00:00
Ryan Campbell b55ff74713 Support path exclusion for native coverage.
Specify list of paths to exclude from coverage instrumentation.

Test: make NATIVE_COVERAGE=true COVERAGE_PATHS=hardware/interfaces
COVERAGE_EXCLUDE_PATHS=hardware/interfaces/graphics
Bug: 35769817

Change-Id: I3747fdddb381101b9ebf51909b9686e820148aad
2017-02-27 09:09:16 -08:00
Josh Gao 5794e3baac Merge "Statically link libwinpthread into windows binaries." am: 61d68b6152 am: aa19e7a2bb
am: f1ed0fb048

Change-Id: Ia1cb660fb8fee069884d4c42ded3a9ec1b002684
2017-02-24 21:14:27 +00:00
Josh Gao 4d9268e704 Statically link libwinpthread into windows binaries.
Statically link libwinpthread.a, so that we don't have to ship a
libwinpthread dll with all of our windows exectuables.

Bug: http://b/31665213
Test: wine adb.exe
Test: wine fastboot.exe
Change-Id: I96414e980d8894f8f6a58c1c7bbd9dc5e0f5169c
2017-02-23 17:56:44 -08:00
Dan Willemsen dc750c31ca Merge "Add Header Library support to Make" am: 4f794fdd50 am: ea2687fab6
am: 4a78c9e50f

Change-Id: I711c810cef8487c2d8e7b53deb9ccaad89592b1d
2017-02-18 06:22:20 +00:00
Dan Willemsen 8dae49c5e1 Add Header Library support to Make
We currently use static libraries without any source files to represent
header libraries, but Soong actually has cc_library_headers. So to
export those in a separate namespace from static libraries, implement
them in Make as well.

This also adds a nice pretty-warning / pretty-error macro that can be
used to print out standard warning messages pointing to the real source
file having the problem.

Test: Use a header library exported by Soong in a Make module
Change-Id: I3486539e247524cb82a20620745fc7be03014e14
2017-02-15 16:04:49 -08:00
Dan Albert 8791fe60d0 Merge "Add c_std and cpp_std properties." am: 220ca4d04b am: 66496c4b96 am: 492a5ff3eb
am: 3bb28719cf

Change-Id: Ifbe68f1cca96b8205f52ac30277a0a454f9c8b8b
2017-02-06 19:29:16 +00:00
Dan Albert 76bfcd4ab2 Add c_std and cpp_std properties.
Test: Checked showcommands ouput for each setting.
Bug: None
Change-Id: Ibc25f3977eaaecfd1fb99a27c9e15acae0ec4106
2017-02-03 16:43:06 -08:00
Evgenii Stepanov a620b36458 Merge "Run $(AR) with LLVMgold.so plugin for CFI targets." am: 96c81711c1 am: e729e804fe am: 629002835a
am: d79d664dc9

Change-Id: Ia2d4f0a4748f3e7964d384e58c386c8678f810c4
2017-01-24 21:00:40 +00:00
Evgenii Stepanov e1b96f3ae5 Run $(AR) with LLVMgold.so plugin for CFI targets.
Bug: 34623182
Test: add LOCAL_SANITIZE:=cfi to some static libraries under libstagefright
Change-Id: I4f0d8cbd794e0ce4737c59a4617e93c7a5defec1
2017-01-23 17:02:22 -08:00
Jean-Luc Brouillet 8471aa9d46 Merge "Move rs/scriptc to rs/script_api/include." am: a3ab4cc9c9 am: d9bfeff242 am: 235123a821
am: 128cebe6fe

Change-Id: I701bc6cb7cadb16d770b77e4a161994de278e142
2017-01-11 02:27:31 +00:00
Jean-Luc Brouillet eba449391e Move rs/scriptc to rs/script_api/include.
Test: Compiled ImageProcessing_jb

Change-Id: Icf05a603671499665d2f31a8989fa69585a6f834
2017-01-08 17:57:48 -08:00
Dan Willemsen 3e9bcf40af Merge "Identify non-local EXPORT_C_INCLUDE_DIRS in soong_to_convert" am: d3cc4950f8 am: bfedf05812 am: 4d08538747
am: fbab4c206f

Change-Id: Ifec04ee64f5b8227337e2d4c7001831dba71a7e9
2016-12-15 01:00:41 +00:00
Dan Willemsen 0be6907b2b Identify non-local EXPORT_C_INCLUDE_DIRS in soong_to_convert
Soong only supports exporting include directories under the current
directory. So bring non-local directories up as a potential problem in
soong_to_convert.txt

Test: m -j $OUT/soong_to_convert.txt, inspect
Change-Id: I7a15b92e10a1d8b8d3496c6f0529a0d0824f301e
2016-12-13 18:29:59 -08:00
Dan Willemsen 7cbe3bd688 Merge "Remove aidl, proto, objc from soong_problems" am: bbc072f716 am: 55b1651181 am: 35ab684f8e
am: 5b8f1db905

Change-Id: I1ba30e935af457bb4015b1aec9605a2c517bd05f
2016-12-06 02:45:26 +00:00
Dan Willemsen a1c3183455 Remove aidl, proto, objc from soong_problems
We support these in Soong now, so stop marking them in soong_to_convert.

Test: Compare soong_to_convert.txt
Change-Id: I89befdfd8c4eaa04ab626d8be090765a1b879d8b
2016-12-05 16:38:14 -08:00
Dan Willemsen 2c412e9c92 Prohibit host modules from using LOCAL_COPY_HEADERS am: 6e51ef61a7 am: dc556b4bc0 am: 6e0c0da5dc
am: 7dd10c1085

Change-Id: I9d7b9721ae471c5f2a57b2ff49006b701fdfb49b
2016-11-29 20:59:13 +00:00
Dan Willemsen a45af9e63c Add basic VNDK support in Make am: bab0fa6928 am: 323efd3035 am: 2e300cdb70
am: f987fa38a2

Change-Id: I4e43bb2127e646532d67a9d7350b01c84f51734c
2016-11-29 20:59:06 +00:00
Dan Willemsen 6e51ef61a7 Prohibit host modules from using LOCAL_COPY_HEADERS
There are no users left, so remove all of this.

Test: lunch aosp_arm-eng; m -j native
Test: build/tools/kati_all_products.sh on aosp and internal master
Change-Id: I32f5c8b470a43dd203d7e20c192167630e4e6888
2016-11-28 13:46:17 -08:00
Dan Willemsen bab0fa6928 Add basic VNDK support in Make
Add BOARD_VNDK_VERSION and LOCAL_USE_VNDK to specify the version of the
VNDK that will be used globally, and whether to use the VNDK on a module
basis.

If the board is using the VNDK:

* LOCAL_COPY_HEADERS may only be used by modules defining LOCAL_USE_VNDK
* LOCAL_USE_VNDK modules will compile against the NDK headers and stub
  libraries, but continue to use the platform libc++.
* LOCAL_USE_VNDK modules will not have the global includes like
  system/core/include, but it will use device-specific kernel headers.

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/build-aosp_arm.ninja is identical before/after
Change-Id: Icce65d4974f085093d500b5b2516983788fe2905
2016-11-28 13:46:17 -08:00
Dan Albert 4bf74cdcb2 Merge "Support `LOCAL_SDK_VERSION := current` for NDK." am: c7d2fe614e am: 6cac9ba834 am: 1cb992bc8e
am: a7019e2493

Change-Id: I4573c205d92f659d4a72a64fe87f957605a57f70
2016-11-18 19:20:08 +00:00
Treehugger Robot c7d2fe614e Merge "Support `LOCAL_SDK_VERSION := current` for NDK." 2016-11-18 19:04:40 +00:00
Dan Willemsen 2c0c8d89ac Merge "Use new -ninja flag to aidl-cpp" am: 7d4c926ed7 am: 676610e090 am: bcb8dfe2b2
am: 31488c301b

Change-Id: I779d280bf82171e2e4579ec2cdb0784eda596d79
2016-11-13 20:22:18 +00:00
Dan Willemsen fb84281342 Use new -ninja flag to aidl-cpp
This make aidl-cpp write out a dep file that ninja parses correctly.

Test: Manually inspect ninja depfile
Change-Id: I4890a91eb29a6388e17b1ffac23a3dc0ffe6c212
2016-11-13 09:44:25 -08:00
Dan Willemsen 20a9e9f18e Merge "Remove transform-d-to-p" am: da85fecaf1 am: 39826d3cc7 am: 1551f77f83
am: db4c584a67

Change-Id: I85bdc0c4a30681078565be159b7d6b83737d6787
2016-11-11 22:02:57 +00:00
Dan Willemsen 461d844a40 Remove transform-d-to-p
Ninja doesn't need the phony make targets, in fact, the parser doesn't
handle them correctly and ends up duplicating the dependencies. This
shrinks a `m native` deps file from 54M -> 35M on AOSP.

Test: Compare out/build-aosp_angler.ninja before/after
Test: wrote a tool to dump the .ninja_deps, added dedup feature, files
      identical after dedup.
Change-Id: Iec7a9a0739e8678c1f4db79c68e423a39b9aad4b
2016-11-10 21:55:01 -08:00
Dan Albert 988107d35c Support `LOCAL_SDK_VERSION := current` for NDK.
Test: Added a module using this and checked the link command line.
Bug: None
Change-Id: I3a55e4638340d8835c09ebc6a1440bece962d36e
2016-11-08 15:37:43 -08:00
Dan Willemsen 74550c8b72 Merge "Improve dotdot workaround when src begins with '/'" am: 7918e5121a am: 05b0da9441 am: 371c403fa8
am: f7df136f07

Change-Id: I7d906092c8619cf79a9a07a85ff0e4729cb1851d
2016-10-31 23:51:01 +00:00
Dan Willemsen c57894c204 Improve dotdot workaround when src begins with '/'
There are some source files in our tree that use some text processing to
find source files, and end up with source file names that look like:

  /../../dir/file.c

This isn't fixed by our dotdot workarounds because the filename doesn't
start with '../', so strip the initial '/' from any source files, since
they are all relative to $(LOCAL_PATH) anyways.

Bug: 32514380
Test: Build internal source with this problem
Test: Compare build-aosp_angler.ninja before/after
Change-Id: If869419c3d3ba35d55f6e19d9332515695e47d24
2016-10-28 16:30:48 -07:00
Colin Cross 342c220531 Merge "Don't pass -Wl,--no-undefined to host targets" am: fe3e1818e5 am: 44d966cf6a
am: 4db457e030

Change-Id: I54550bb97594d2b9949026beb0c4dd2088563c06
2016-10-21 23:15:06 +00:00
Colin Cross a82fa12c54 Don't pass -Wl,--no-undefined to host targets
Host builds were compiling without -Wl,--no-undefined because of an ASAN
issue.  Pass -Wl,--no-undefined for host builds unless sanitzers are
enabled.  Also fix LOCAL_ALLOW_UNDEFINED_SYMBOLS on darwin, where
disallowing undefined symbols is the default.

Test: m -j host
Test: m -j SANITIZE_HOST=address host
Bug: 32305815
Change-Id: I0344c321610c55eb8b2092b01e50e4a93a0e85df
2016-10-20 16:25:18 -07:00
Colin Cross fb824ab27e Merge "Use default -std values exported from soong" am: dcd73b5043 am: b03ba67ebc
am: 9fa9e2a4cd

Change-Id: I7209379c041ad4ffd3f53e4404f4e6d49b9567dd
2016-10-20 22:07:34 +00:00
Colin Cross e56e356c46 Use default -std values exported from soong
Test: builds
Change-Id: Ic7b7d226131a2a0ea1f099f8a0fc895448384081
2016-10-20 14:09:24 -07:00
Ryan Campbell 7a923a4dc1 Merge "Define coverage paths using comma-separated list." am: 8a4b4e8432 am: 96bc733ae9
am: 78055c2bfe

Change-Id: If414c9d2868242e03abf20b2d21e317ffccca677
2016-10-20 01:29:03 +00:00
Ryan Campbell 20f301f4bb Define coverage paths using comma-separated list.
Change COVERAGE_PATHS to access a comma-separated list of paths
instead of a space-separated list to make for easier escaping in
configuration files.

Test: tested using local bullhead build with coverage on lights and nfc
Change-Id: Iec014c8b4fbefcbcc5d865e6acba92bf6364ee3a
2016-10-18 10:25:15 -07:00
Ryan Campbell 47684fdad6 Merge "Fix bug preventing multi-module native coverage." am: 3372ce615a am: 74ef8e0a88
am: 9a0b234763

Change-Id: Ia145ecc5e64abc138baca462c5ca953eb9b19e2b
2016-10-18 01:02:33 +00:00
Ryan Campbell 4a3be3db47 Fix bug preventing multi-module native coverage.
Fix a whitespace bug causing coverage to be enabled on all modules
whenever more than one module is specified. This is caused by
comparing whitespace to the empty string, which are not equal. Fix
by stripping the output to check for path matches.

Test: tested using local build with coverage enabled on NFC, lights
Change-Id: I61a775cfd135f94ea1e1ee9fdbed3c64c5bb1a2e
2016-10-17 15:43:21 -07:00
Chih-hung Hsieh a9d484ac3a Merge "Add -Werror to compile warning free projects." am: 355e96774b am: 05388b7618 am: 9f82feb9e6
am: a70f8fc5d5

Change-Id: Ia43c8ed7cadbbc90e3199101d1f56a96ad10b5f2
2016-10-13 01:12:47 +00:00
Chih-Hung Hsieh bab0488828 Add -Werror to compile warning free projects.
* Add -Werror if LOCAL_PATH is in the WARNING_DISALLOWED project list,
  or not in the WARNING_ALLOWED project list.

Test: Build for major targets.
Change-Id: I12235ee1ca1c1837530693699e705e1955275565
2016-10-11 15:38:39 -07:00
Colin Cross 1132b04aba Merge "Enable toc optimization for host builds" am: 5d8c73e373 am: 4276c12d20 am: e4e04c2f92
am: 46e7aa81e0

Change-Id: Id50148e31237e6b9fdf2f795aa2d41233fe2adaf
2016-10-04 21:10:15 +00:00
Colin Cross d2ff157159 Enable toc optimization for host builds
The toc optimization had been disabled for host builds to ensure that
the timestamp of the final binary changed whenever its implementation
changed, in order to support rerunning host tools that were modified
during incremental builds.  However, only the final install rule must be
re-run to update the timestamp, and not the link rule.

Update the shared library install dependencies to use normal
dependencies instead of order-only dependencies for host modules, and
then enable the the toc optimization for host modules.  If the
implementation of a library changes it will be reinstalled, and
libraries or binaries that depend on it will also be reinstalled.

Bug: 26015464
Test: m -j; touch art/disassembler/disassembler_x86.cc; m -j, verify
      out/host/linux-x86/bin/oatdump is updated
Change-Id: I0a14decc1994eb55ad269d841943aef66e320c63
2016-10-03 17:53:44 -07:00
Dan Willemsen 3fbe1f7327 Merge "Optimize rebuilds by reducing $(shell) usage" am: f009531772 am: 466f4f2b9e am: c1aff754c4
am: 09bd2ae7d8

Change-Id: I3250258380faa279e6533e0eed3d7f12b916a4d3
2016-10-03 21:31:40 +00:00
Dan Willemsen b011810c25 Optimize rebuilds by reducing $(shell) usage
$(shell) isn't particularly fast in Kati, and they have to be executed
both when reading the makefiles and determining whether the ninja file
needs to be regenerated.

Right now, the regen time is mostly hidden because we run them in
parallel. We've also configured it to ignore any commands that contain
"echo", "date", or the output directory. That happens to remove most
commands that contain side effects, so running them in parallel is fine.

But the side effects contain some important things, like the clean up
necessary when switching products. So I'm removing those filters, and
then we'll need to run the shell commands in sequence, since there will
be side-effects. That makes regen take longer though, so use pure-Make
implementations instead of $(shell) where possible.

This set of changes reduces aosp/master aosp_arm64-eng build $(shell)
usage and time by 2/3:

*kati*: func shell time: 3.135095 / 709
*kati*: func shell time: 1.067331 / 236

Bug: 30947985
Test: Manual test lines for math functions
Test: Compare build-aosp_arm64.ninja before/after
Change-Id: I4fc9d6318957992921972994f277c17918e7e1eb
2016-09-30 21:14:13 -07:00
Dan Willemsen a5fa6ca7fa Merge "Add LOCAL_EXPORT_C_INCLUDE_DEPS" am: 1c0b5eaf83 am: b1fdb9745f am: b42e166273
am: a7d2992ba3

Change-Id: I4011f484aa2295a7cd42d161370bb4374ed91c58
2016-09-30 01:52:46 +00:00
Dan Willemsen ba6a164da7 Add LOCAL_EXPORT_C_INCLUDE_DEPS
This shouldn't be necessary for most makefiles, since we add
$(LOCAL_GENERATED_SOURCES) to this already included, but for prebuilts
that aren't actually prebuilts (Soong modules), we need to pass
dependencies so that the generated headers are built before being used.

Bug: 31742855
Test: Use, inspect build-*.ninja
Change-Id: I8d9f675af639d3f40780d48a016fc079a82531c2
2016-09-29 12:08:29 -07:00
Dan Willemsen 2d254448ce Merge "Remove WITH_SYNTAX_CHECK" am: c114bd9dbf am: d640e062e8 am: 28d50c498b
am: a4c82e7b3a

Change-Id: I7f15e1ff7949a0061a387b84000811611e3aa266
2016-09-28 02:00:53 +00:00
Dan Willemsen e68100e8bb Remove WITH_SYNTAX_CHECK
It's no longer used. The majority of the platform is on clang anyways.

Test: m -j
Change-Id: I4fb4375eaad2469e169d34c47ae3fe2a0540aeec
2016-09-26 17:37:19 -07:00
Keun Soo Yim 949c422dd3 Merge "support vts compile mode flag" 2016-09-22 03:08:43 +00:00
Dan Willemsen 98b277b930 Merge "Fix link_type checking" am: 665cda08f0 am: 1347d959de am: 8459bbca6f
am: 83aba3a7ab

Change-Id: I0cca5c1e262c8a8d92858ed5c927e4775c2e3a6e
2016-09-20 03:29:59 +00:00
Dan Willemsen 665cda08f0 Merge "Fix link_type checking" 2016-09-19 21:54:09 +00:00
Dan Albert 222f6b4361 Use libcompiler-rt_extras with NDK builds. am: c28e4bcb1c am: d042352816 am: d7c48e9f9d
am: d11f78fbd5

Change-Id: I63661c6eb5ab5172732bbb60367483cec3eecf8b
2016-09-16 06:56:35 +00:00
Dan Albert 9ef0a8bb26 Always link libdl with libc++ for the NDK. am: 2936a1e84b am: ec6223ec3c am: 7fde1f9c6e
am: 3f0f58a60b

Change-Id: Ic924ff213b2a9c3e847ea721f836b05bbac3bc3e
2016-09-16 06:56:26 +00:00
Dan Willemsen 121e284b46 Fix link_type checking
This was printing "error:", but not actually triggering an error.
Instead of trying to write a single line bash script to handle this,
move the actual check into python. This allows us to print all of the
errors for a single module before triggering the failure.

Also updates the warning format and the warn.py script to properly parse
these warning. Many of the java:sdk -> java:platform warnings are false
positives due to the lack of LOCAL_SDK_VERSION markings on prebuilts.

Individual tags can be marked as warnings now, which lets us check for
system libraries linking against vendor libraries (which won't work on
AOSP). I'm not sure this is a completely valid check, which one reason
that it's just a warning.

Test: m all_link_types (with some missing libs commented out)
Change-Id: I333e418c9a4511b7c7e826891ae481da08fbf6f9
2016-09-15 14:40:39 -07:00
Dan Albert c28e4bcb1c Use libcompiler-rt_extras with NDK builds.
We want to build things in CTS (things built against the NDK) with
integer overflow checks. Some projects in the tree also make explicit
calls to the overflow checked builtins, and those projects need to be
built with the NDK (external/dng_sdk is the specific example that
brought this up).

Test: make checkbuild tests
Bug: None
Change-Id: Iab27dd0d931f723140de242049fa72f3b1ce0fb8
2016-09-14 16:08:48 -07:00
Dan Albert 2936a1e84b Always link libdl with libc++ for the NDK.
libc++ requires libdl whether it's statically linked or not.

Test: make checkbuild tests
Bug: None
Change-Id: I8abdcfaef779b358196716ab1193cebe278317ac
2016-09-14 16:08:04 -07:00
Ryan Campbell af2091b217 Merge "Implement path-based enabling of code coverage." am: 1e1ecd5d07 am: 6b92bb4ebb am: 577eab3323
am: 5a63fe6856

Change-Id: I264e7ee9d8139c79fb882f40f1cb6854d2e24a8b
2016-09-14 03:05:55 +00:00
Dan Willemsen a7919bd18c Merge "Fix building static linux binaries" am: 8bb71cef9f am: 5cf6a4578d am: a4f8d8b2a3
am: 93a0afc749

Change-Id: I374e33412c727a0df4522156db7cd47268e4c1e3
2016-09-14 03:05:52 +00:00
Ryan Campbell 1e1ecd5d07 Merge "Implement path-based enabling of code coverage." 2016-09-13 19:48:34 +00:00
Dan Willemsen c9aa6fca41 Fix building static linux binaries
BUILD_HOST_static has been broken because I was stripping
-Wl,--start-group/-Wl,--end-group into a separate set of ldflags instead
of keeping them wrapped around some of the ldlibs. So don't pass some of
the build system flags through the ldlibs checker.

Bug: 30898128
Change-Id: I332b42679695cdc5da3cb0036290b6a3544699c0
2016-09-13 17:48:07 +00:00
Ryan Campbell 81c9d29dad Implement path-based enabling of code coverage.
Native coverage is enabled by setting NATIVE_COVERAGE to true
and specifying a list of paths in the COVERAGE_PATHS
environment variable. Files are exported to a zip file in the
target out directory.

Change-Id: I66a2ddd88e849bec1cc0cdae1b51fe18a007e2c3
2016-09-13 10:27:25 -07:00
Dan Willemsen 8eb4d8589d Merge "Fix libgcov.a dependency" am: f9d5fb97cb am: 4b9f214a7b am: 64deaba889
am: 2277a46756

Change-Id: I57dc91cf9b928b4f1b6661474b653e453e2f9041
2016-09-12 19:42:17 +00:00
Dan Willemsen 7db70a3b0a Fix libgcov.a dependency
Now that Soong is generating libgcov.a, we need a dependency here.

Change-Id: Ie8d97339fd584eed178cc57b9333d38754ab1135
2016-09-12 18:09:20 +00:00
Keun Soo Yim 3c0ffa319c support vts compile mode flag
Change-Id: I05c347851cfc41c617b055209d81318a1a60918e
2016-09-08 20:36:34 -07:00
Chih-hung Hsieh 6afe656b6d Merge "Define DEFAULT_TIDY_HEADER_DIRS." am: 9d66e2c2ef am: 84be3dc50a am: 59ac695071
am: e28fd9f2e4

Change-Id: I40f077e04438e2b3c54887d82a782af460304aa3
2016-09-08 20:42:34 +00:00
Chih-Hung Hsieh 0a33f65cc8 Define DEFAULT_TIDY_HEADER_DIRS.
Let clang-tidy report warnings in header files in the
system and current directories but not the external
and vendor directories.

Test: build with WITH_TIDY=1
Change-Id: I1723b8eb95948961fb7164a19989e0a926e5bf8a
2016-09-06 20:06:28 -07:00
Dan Willemsen cfa84e90bd Merge "Identify modules ready to be converted to Soong" am: c6bada8acd am: 6596082d00 am: 52438f9fcf
am: b2bf9125f2

Change-Id: Ib249a1cdd546cf3bafed7002ac9e05080f55715d
2016-08-26 23:28:07 +00:00
Dan Willemsen fc92fb2b9b Identify modules ready to be converted to Soong
The output will be in the `m dist` results as soong_to_convert.txt, or
can be built using:

  $ m $OUT/soong_to_convert.txt

The output is a list of modules that are probably ready to convert to
Soong:

  # Blocked on Module (potential problems)
           283 libEGL (srcs_dotarm)
           246 libicuuc (dotdot_incs dotdot_srcs)
           221 libspeexresampler
           215 libcamera_metadata
               ...
             0 zram-perf (dotdot_incs)

The number at the beginning of the line shows how many native modules
depend on that module.

All of their dependencies have been satisfied, and any potential
problems that Make can detect are listed in parenthesis after the
module:

  dotdot_srcs: LOCAL_SRC_FILES contains paths outside $(LOCAL_PATH)
  dotdot_incs: LOCAL_C_INCLUDES contains paths include '..'
  srcs_dotarm: LOCAL_SRC_FILES contains source files like <...>.c.arm
  aidl: LOCAL_SRC_FILES contains .aidl sources
  dbus: LOCAL_SRC_FILES contains .dbus-xml sources
  objc: LOCAL_SRC_FILES contains Objective-C sources
  proto: LOCAL_SRC_FILES contains .proto sources
  rs: LOCAL_SRC_FILES contains renderscript sources
  vts: LOCAL_SRC_FILES contains .vts sources

Not all problems can be discovered, but this is a starting point.

Change-Id: I45674fe93fd267d4d1fb0bc3bc9aa025e20c5ac6
2016-08-26 13:33:31 -07:00
TreeHugger Robot a2071052e8 Merge "aux: allow non-clang toolchains for AUX builds" 2016-08-19 17:43:50 +00:00
Alexey Polyudov 65d7a34b85 aux: allow non-clang toolchains for AUX builds
Change-Id: I38fcc0ad66cadd1f6008169fb1c1baea77734695
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-19 09:06:36 -07:00
Chih-Hung Hsieh 34c8c0ac33 Merge "Remove spaces in tidy check list."
am: e7bca12466

Change-Id: I852d42992bc1ddb0a17dd1dcf03cf25f1d114552
2016-08-17 17:48:52 +00:00
Chih-Hung Hsieh ba646253ce Remove spaces in tidy check list.
This will allow spaces in LOCAL_TIDY_CHECKS.

Bug: http://b/27779618
Change-Id: I6f9b133220e49b2581a06d2fd9083a1d6b7badca
Test: build with WITH_TIDY=1.
2016-08-16 16:27:30 -07:00
Dan Albert ae49ab2f0f Merge "Add support for NDK r13."
am: 287093a98c

Change-Id: I8e10422cdd20d3ee0402acabbdbe60a41ba59901
2016-08-11 16:52:52 +00:00
Dan Albert 0960770e0d Add support for NDK r13.
Test: make checkbuild
Change-Id: I4521c768c67771cee9df9e59ed45344c40c48a38
2016-08-10 16:05:19 -07:00
Dan Albert aede8d4912 Merge "Define __ANDROID_API__ when building for the NDK."
am: 30fe7576d0

Change-Id: I4aa349b7293db5e9e7214cdb10a682164214de60
2016-08-06 01:18:58 +00:00
Treehugger Robot 30fe7576d0 Merge "Define __ANDROID_API__ when building for the NDK." 2016-08-06 00:52:33 +00:00
Dan Albert 754790d0a4 Define __ANDROID_API__ when building for the NDK.
Traditionally this has come from android/api-level.h, but with the
libc headers unified it must be set by the build system since we don't
have per-API level copies of that header now.

Test: make checkbuild with other libc ndk_library patches
Change-Id: Idf6cbba131f065b048b1b412e992c55e3d17e701
2016-08-05 16:34:40 -07:00
Dan Albert db4c597d5f Merge "More NDK generated libs support."
am: bd9fb4ba01

Change-Id: I46e77781702a68bea56691245e04387fc2845b56
2016-08-05 22:35:11 +00:00