Commit graph

673 commits

Author SHA1 Message Date
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
Chih-Hung Hsieh
f329021c0f Merge "Make it an error when LOCAL_CLANG is false."
am: 9204b776bb

Change-Id: I7e2e674eb6f79ec7180f801dd12378842b239512
2016-08-05 22:35:10 +00:00
Treehugger Robot
bd9fb4ba01 Merge "More NDK generated libs support." 2016-08-05 22:32:13 +00:00
Chih-Hung Hsieh
2ee4c1abbf Make it an error when LOCAL_CLANG is false.
Only projects in LOCAL_CLANG_EXCEPTION_PROJECTS can set LOCAL_CLANG to false.
Add external/gentoo/integration to this white list.

Bug: 30575506
Change-Id: Icd508686bc2eb8b9d400200166df80115af20da1
Test: build and find new warning in build.log
2016-08-05 11:21:20 -07:00
Dan Albert
c1ca19007f More NDK generated libs support.
Any NDK shared libraries not in LOCAL_SYSTEM_SHARED_LIBRARIES weren't
being pulled from the generated libs before since we were only
filtering my_system_shared_libraries and even if we had filtered
my_shared_libraries they would have been rewritten to my_ldlibs.

* Filter my_shared_libraries for NDK generated libs as well.
* Stop rewriting NDK LOCAL_SHARED_LIBRARIES to my_ldlibs. Instead,
  rewrite in the opposite direction just like we do for the platform.
* Move shared libs/ldlibs rewriting to before we filter NDK
  libraries out of shared libs/system shared libs.

Test: make checkbuild
Bug: http://b/27533932
Change-Id: If1860d9638de77089a46884f406766edaf362216
2016-08-04 15:22:11 -07:00
Chih-Hung Hsieh
f43279a359 Merge "Issue warning on projects with LOCAL_CLANG set to false."
am: e71cdfbdee

Change-Id: Icb5708eb58f3c8e54b60538377b6afba5eb04de5
2016-08-03 16:50:52 +00:00
Chih-hung Hsieh
e71cdfbdee Merge "Issue warning on projects with LOCAL_CLANG set to false." 2016-08-03 16:42:27 +00:00
Chih-Hung Hsieh
d9cd1fafb5 Issue warning on projects with LOCAL_CLANG set to false.
* LOCAL_CLANG_EXCEPTION_PROJECTS is the list of project prefixes.
* New warning message is detected by warn.py as high severity.

Bug: 30575506
Change-Id: I87a38b2ba6bab1d2e5e7a9d5ec9557f0e609727c
Test: build and find new warning in build.log
2016-08-02 16:10:49 -07:00
Alexey Polyudov
755391d77e Merge "introduce AUX build class of targets"
am: 556526bf95

Change-Id: I52b4b3a561ceb9c1fbe71ce75a4ef4aa252a9665
2016-08-02 22:50:21 +00:00
Alexey Polyudov
74e4a83d47 Merge "Make linking with libcompiler_rt conditional"
am: 340c0c5701

Change-Id: Ide7cf834a0d981671f517366f7308c58d2a79163
2016-08-02 22:17:24 +00:00
Alexey Polyudov
ae817d47dd Merge "Do not assume CLANG is used when custom toolchain is provided"
am: 7a16eb05cc

Change-Id: Ib77cdcc52aae822235577c02ea1045e6b6de4096
2016-08-02 22:17:23 +00:00
Alexey Polyudov
1eba5a69eb Merge "Add LOCAL_NO_PIC to disable position-independent code"
am: ce5900a6e0

Change-Id: I471cff0f6c3479f9d34ee82b69c0be742304f70a
2016-08-02 22:17:21 +00:00
Alexey Polyudov
ccdc311b33 introduce AUX build class of targets
AUX is a new class, similar to TARGET
While TARGET defines toolchain for Application Processors
AUX is defining toolchains for arbitrary utility cores (DSPs, GPUs,
MCUs, etc). This allows building of non-android sources as part
of Android tree and avoid using prebuilts if source code is avaliable

Bug: 29635686
Change-Id: Ie755ea054b16c3e86369f5fb2ba6eb0b384af77f
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-02 08:06:28 -07:00
Alexey Polyudov
ee27d813b9 Make linking with libcompiler_rt conditional
introduce LOCAL_NO_LIBCOMPILER_RT
embedded targets do not necessarily want to have it

Bug: 29635686
Change-Id: Ieb04f7ea7237ae01a067dedfa2fb13571e9a789c
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-01 17:38:53 -07:00
Alexey Polyudov
7d6b3f1595 Do not assume CLANG is used when custom toolchain is provided
When overriding toolchain with LOCAL_CC, LOCAL_CXX
build system shall not assume that this custom toolchain
is CLANG.

Bug: 29635686
Change-Id: I9712d098216740c4ff20bd2a4749f489af85b50e
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-01 17:37:56 -07:00
Alexey Polyudov
cbb038c8e8 Add LOCAL_NO_PIC to disable position-independent code
on some toolchains and architectures building non-PIC
code renders more efficient assembly

Bug: 29635686
Change-Id: I6274f40d24e1bb43f03b45c60b5487abed02b7fc
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-01 17:37:09 -07:00
Colin Cross
b3399931a5 Merge \"Don\'t depend on a phony target\"
am: 90cd97fd11

Change-Id: I185be0ffd30561125bcbc39c19429ae44e964bb8
2016-07-30 02:06:41 +00:00
Colin Cross
723b37e910 Don't depend on a phony target
Phony targets are always dirty, depend on the ndk.timestamp file instead
of the ndk phony rule.

Change-Id: I8a90e61a1a79861af59f66f3bc0fdeecd0819992
2016-07-29 15:09:40 -07:00
Dan Albert
01efd46bca Merge changes from topic \'soong-sysroots\'
am: 65de8e446c

Change-Id: I8c8951364c5ddd6f99a27111acdb72097ab5db42
2016-07-28 16:06:24 +00:00
Dan Albert
02bf138d64 Use the just built NDK headers and libs.
The list of libraries is currently empty. Will add migrated libraries
in a follow up patch.

Test: Still builds.
Bug: http://b/27533932
Change-Id: Ibd9750620ca2ae86fe888a8a993bd26493bc1c8a
2016-07-28 00:06:19 -07:00
Colin Cross
768291a37c Merge \"Split -isystem headers into separate variables\"
am: 921be36569

Change-Id: Icd539e53caa9ad55e900b394c6005bb3606dce70
2016-07-21 17:58:10 +00:00
Colin Cross
23ba612aad Split -isystem headers into separate variables
Split the variables that contain header directories into ones that
should be prefixed with -isystem and ones that should be prefixed with
-I in preparation for moving some headers from -isystem to -I.

Add $(wildcard) around SRC_HEADERS to match the soong behavior, and move
users of SRC_HEADERS from config.mk to binary.mk so that the exported
soong value is present.

Test: no changes to build.ninja compile rules
Change-Id: Iadecbbf4351a01e53cb57e721d31f4f836bb82d9
2016-07-20 23:09:29 -07:00
Colin Cross
17904fabbf Merge \"Factor out common include directories into helper\"
am: 95fa32b577

Change-Id: I720d7c02de3d11b4a5a3328946433aa7274f1bb6
2016-07-20 21:24:29 +00:00
Colin Cross
e25fd79337 Factor out common include directories into helper
Refactor includes in transform-*-to-o to simplify future changes to the
default include paths.

Test: whitespace-only changes to the compile rules in build.ninja
Change-Id: I766af1f22a4838d933691b6df37530db3ba4e21d
2016-07-19 15:09:50 -07:00
Dan Willemsen
95d3b735b6 Merge \"Turn ndk link check warning into error\"
am: 32ebe53d01

Change-Id: I89ff2a720b27a288b9f64412dd213d7019ffca66
2016-07-12 21:19:46 +00:00
Dan Willemsen
ac1fe5c8b2 Turn ndk link check warning into error
All instances of this have been removed from the downstream trees. The
APK->JNI_SHARED_LIBRARY and Java->Java checks remain as warnings.

Change-Id: I3eaee284500deee0f26a4f9cdd96497e99ec533e
2016-07-12 13:10:31 -07:00
Dan Willemsen
90f03ecfee Merge \"Turn unused source files from warning to error\"
am: 73609480b3

Change-Id: Iddedac74a78968eb438bddae1e22633ba8c13375
2016-06-28 19:48:32 +00:00
Dan Willemsen
9efeb1ea4f Turn unused source files from warning to error
All instances have disappeared from the build server, so switch this to
error before more turn up.

Change-Id: Iac07526a6e77ebf33733033249f2a108aae3fa7d
2016-06-28 10:22:08 -07:00
Dan Willemsen
5da565a85a Merge changes Ib6ffcc38,Ia58e6bc1
am: 3068a85962

Change-Id: I20aec66ac749a5db3f65e368e14a5caca12afff8
2016-06-16 15:50:46 +00:00
Dan Willemsen
b097fbed0a Check that NDK-built modules only link to NDK-built modules
Modules built against the NDK should only link against modules also
built against the NDK (or link to the NDK prebuilts). This patch
attempts to catch these cases, and prints a large warning when this is
violated. Once the tree is cleaned up, this will change to an error.

Change-Id: Ib6ffcc38d9161abdbe45a58af26ba429fb6f1876
2016-06-15 20:22:19 -07:00
Yabin Cui
494c2b5ebc Merge \\"Add option to link static lite protobuf library.\\" am: e6fae50455
am: bebdc16a68

Change-Id: I60b9fb9437fe15079c62c3d47401341b54ebc7bc
2016-06-14 01:24:05 +00:00
Yabin Cui
e6fae50455 Merge "Add option to link static lite protobuf library." 2016-06-14 00:16:34 +00:00
Dan Willemsen
74da7c9272 Merge \\"Rewrite LDLIBS and SHARED_LIBRARIES\\" am: a8d13592ac
am: d8210177af

Change-Id: If466674f33ba7d98a0f8da249bc0dc57efdcf621
2016-06-08 21:17:05 +00:00
Dan Willemsen
6731b495ca Rewrite LDLIBS and SHARED_LIBRARIES
LOCAL_LDLIBS was the only correct way to use NDK libraries, but few used
it correctly. It also often got confused with LOCAL_LDFLAGS, so move the
flags to the correct variable.

For binaries that weren't using the NDK (empty LOCAL_SDK_VERSION), it
was never valid to use LOCAL_LDLIBS, as dependencies would not be
properly set up, and could lead to random build failures. So convert any
-l linker flags to using LOCAL_SHARED_LIBRARIES automatically.

For binaries built using the NDK (LOCAL_SDK_VERSION set), they were
required to use LOCAL_LDLIBS for prebuilt NDK libraries, otherwise they
would get headers and dependencies to the platform versions. Any
non-prebuilt LOCAL_LDLIBS would miss dependencies. So move the NDK
prebuilt libraries to LDLIBS from SHARED_LIBRARIES, and move everything
else to SHARED_LIBRARIES.

So now, for device modules, LOCAL_SHARED_LIBRARIES should always be
used, and we'll do the right thing. LOCAL_LDLIBS should only be used for
host libraries from the system.

Change-Id: Ide34c7afdcfb6507a378d45a42471729e489a9e0
2016-06-07 21:59:55 -07:00
Yabin Cui
72a1156efb Add option to link static lite protobuf library.
Bug: 28114205

Change-Id: Id2b7e42017a53138c60b92de8d196ca92bc38053
2016-06-07 21:24:06 -07:00
Dan Willemsen
32b36a8819 Merge "Add NATIVE_TESTS class, move host native tests" am: e72fc63901
am: 10461b78f0

* commit '10461b78f0955d9dba8d32045d1e35ff0f9a5c8c':
  Add NATIVE_TESTS class, move host native tests

Change-Id: Ia11b54676d3b33e58c177a5a375f29233657524e
2016-06-07 00:09:39 +00:00
Dan Willemsen
e72fc63901 Merge "Add NATIVE_TESTS class, move host native tests" 2016-06-06 23:59:23 +00:00
Dan Willemsen
b25374cfe1 Merge "Error on external includes" am: 4b33f51043
am: d983b78a6f

* commit 'd983b78a6fac17bbfb26d61f28510476f8edb99a':
  Error on external includes

Change-Id: I82ba6748ea08cb861e3cf4f0fbade2f277433413
2016-06-04 01:13:07 +00:00
Dan Willemsen
4b33f51043 Merge "Error on external includes" 2016-06-04 01:03:20 +00:00
Chih-Hung Hsieh
fbde37d8b9 Merge "Default to enable tidy warnings in header files." am: 6a7cf55a7d
am: b764f7d0d6

* commit 'b764f7d0d662f7fd9d797ca796a85972596023d6':
  Default to enable tidy warnings in header files.

Change-Id: Ied47b955b1e0d11a1711c1d76c7ef90e6394ef5a
2016-06-02 23:29:55 +00:00
Chih-Hung Hsieh
870f087867 Default to enable tidy warnings in header files.
Change-Id: I3831f03facbbd6d17117d82f9ccac49bc2645237
2016-06-02 15:20:05 -07:00
Dan Willemsen
062e30b422 Error on external includes
To make the build hermetic, all include files should be located within
the source tree (or generated as output).

There was an Android.mk that was adding /usr/include to its include
path.

Change-Id: I4c40b908314239c8239c7835d592e409248a3150
2016-05-24 16:40:11 -07:00
Dan Willemsen
7fe992c0cc Add NATIVE_TESTS class, move host native tests
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.

So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].

Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.

Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.

Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
2016-05-24 12:43:16 -07:00
Dan Willemsen
e48baffb5e Merge "Move to a single clang unknown flags list" am: 06935290ac
am: 315621eee0

* commit '315621eee0a1199b175ab4d251ea617fdb018fd5':
  Move to a single clang unknown flags list

Change-Id: I209bf8b868da7b11d55fc6cf701976ff914a2160
2016-05-23 17:43:38 +00:00
Dan Willemsen
02268f01df Move to a single clang unknown flags list
Soong is using a single list of unknown clang flags for all
architectures, instead of the per-architecture list here. Collapse this
down to a single list as well so that it can be verified against the
Soong list, and eventually replaced by the Soong version.

Change-Id: If43cd892105da5155907c05965a74b835920a369
2016-05-19 15:33:54 -07:00
Dan Willemsen
c7f377721a Merge "Remove (TARGET|HOST)_NO_UNDEFINED_LDFLAGS" am: ac7a7bb0ba
am: 611211acd4

* commit '611211acd40bc02773d27568d4774d8061149c52':
  Remove (TARGET|HOST)_NO_UNDEFINED_LDFLAGS

Change-Id: I6744e92b392c02dfcbe2154d13823a5a0a3b7693
2016-05-18 20:55:07 +00:00
Dan Willemsen
8308f506ce Remove (TARGET|HOST)_NO_UNDEFINED_LDFLAGS
We never use it for host modules, and all the target configurations use
the same linker argument. This matches Soong.

Change-Id: Ibcba9a4ce340c7a12306d1fee620a04027c0e292
2016-05-18 12:50:53 -07:00
Dan Willemsen
958dc6098e Merge "Remove TARGET_LIBGCC/LIBATOMIC/LIBGCOV" am: a794f4db22
am: 19fdc4428f

* commit '19fdc4428f9036b059a1174a3236eef03180e826':
  Remove TARGET_LIBGCC/LIBATOMIC/LIBGCOV

Change-Id: I143bf88ad5031764644dfb2c8b279513c809b50b
2016-05-17 03:05:32 +00:00
Dan Willemsen
db16dd2384 Remove TARGET_LIBGCC/LIBATOMIC/LIBGCOV
Instead, use the libgcc/libatomic/libgcov from the static libraries dir,
which is provided by Soong. Copy the libraries using the Soong script if
Soong is disabled - this can be removed once USE_SOONG is removed.

Change-Id: Iad2ad20ad5c3cfc48bf1e46e594a482609098d7a
2016-05-16 17:26:54 -07:00
Ying Wang
dbe53e4bde resolve merge conflicts of e6b72b3 to nyc-dev-plus-aosp
Change-Id: Ic60ea2050c6e724e9bcbb5277087f1377315e9b3
2016-05-06 13:37:05 -07:00
Ying Wang
05f9f35836 Harden dependency on generated sources.
Previously if a library has custom generated headers in
LOCAL_GENERATED_SOURCES and export its include path with
LOCAL_EXPORT_C_INCLUDE_DIRS, there is almost no way for the users of the
library to set up dependency of their object files on the generated
headers.
This change makes the generated sources dependency of the library's
export_includes, which is guaranteed generated before client code gets
compiled.

Also we added proto-generated cpp files to my_generated_sources so that
we can deal solely with $(my_generated_sources). Because many
Android.mks assume the generted .pb.hs are in $(generated_sources_dir)
instead of $(intermediates), we have to generate the source files in
$(generated_sources_dir) and make a copy in $(intermediates).

Bug: 28622149
Change-Id: I73b21443fa706f3735faf16356ed8c08fbfecca6
2016-05-06 10:20:17 -07:00
Chih-hung Hsieh
cf20458163 Merge "Add tidy.mk to set up global default checks." am: 214c7fa
am: 6014381

* commit '60143818969a97ee6827b9de3b56670b0ff774df':
  Add tidy.mk to set up global default checks.

Change-Id: I4f678930148ee6a0a3bccce899275af07cc4a738
2016-04-26 01:51:11 +00:00
Keun Soo Yim
46a259651f resolve merge conflicts of 72b82dc to nyc-dev-plus-aosp
Change-Id: I6e62226774584154ad1a802594e386fe7942504b
2016-04-25 15:27:21 -07:00
Keun Soo Yim
3d4847525f build rule change for VTS (vendor test suite)'s metadata files
Change-Id: I76b81529a97b672e08632703d2f6a2777ee8811e
2016-04-25 13:06:57 -07:00
Chih-Hung Hsieh
460171a3e4 Add tidy.mk to set up global default checks.
* Default checks include only google* minus google-readability*.
* Some google-* checks are disabled for external projects.
* Each project can add more or disable checks through LOCAL_TIDY_CHECKS.

Bug: http://b/27779618
Change-Id: I83eed73bd2bddaace565a6dde532fb2036b4fac4
2016-04-25 12:17:03 -07:00
Dan Albert
e58300cc30 Merge "Switch mips64 back to NDK r10." am: 9ecf544
am: f77eb12

* commit 'f77eb12f02d233cc34e7c0d2c14c0ad737c1d8bb':
  Switch mips64 back to NDK r10.

Change-Id: Ia93c84ce3272dfb6cc83e65e1be9e3148bfa161d
2016-04-22 21:32:48 +00:00
Nikola Veljkovic
f738562316 Switch mips64 back to NDK r10.
The NDK doesn't support mips32r6, and the update of prebuilts/ndk to
r11 doesn't have the hack that r10 did. Revert back to r10, until we
decide on a more appropriate solution.

Change-Id: I7891603d8ccbb20398aad893b62c1debf353ef41
2016-04-22 14:17:00 -07:00
Chih-hung Hsieh
7a8e69eea2 Merge "Call clang-tidy based on WITH_TIDY* variables." am: 3f03b10654
am: c72f50d49f

* commit 'c72f50d49fb95794039f270d4083b9cfed4cd482':
  Call clang-tidy based on WITH_TIDY* variables.

Change-Id: I4eb0afd79b56ad2ddea42b33791df27da6ab8820
2016-04-21 21:11:00 +00:00
Chih-Hung Hsieh
a9a55c7c7e Call clang-tidy based on WITH_TIDY* variables.
* Call clang-tidy before every C/C++ compilation if
  (1) clang-tidy is found at $(PATH_TO_CLANG_TIDY)
  (2) $(my_clang) is true
  (3) LOCAL_TIDY is 1 or true, or
      LOCAL_TIDY is undefined and WITH_TIDY is 1 or true.
* clang-tidy is called with -checks=$(my_tidy_checks),
  which has default '-*,google*,-google-readability*'
  and can be overwritten by WITH_TIDY_CHECKS.
* LOCAL_TIDY_CHECKS is appended to $(my_tidy_checks)
* Extra flags are passed to clang-tidy through
  WITH_TIDY_FLAGS or LOCAL_TIDY_FLAGS.
* To quickly find and fix clang-tidy warnings, set $(WITH_TIDY_ONLY)
  to 1 or true to skip compilation of C/C++ files.
* Add a PHONY tidy_only target,
  which includes all $(cpp_objects) and $(c_objects).
* The 'mm' and 'mmm' functions are changed to call make with
  the 'tidy_only' target when WITH_TIDY_ONLY is true or 1.
  In that case, only clang-tidy is called for C and C++ files.

Bug: http://b/27779618
Change-Id: I8adcfff217d68af49849b79aacee7d7654cafb1b
2016-04-21 12:31:13 -07:00
Dan Austin
bd581f6959 Merge "Adding gcc-specific disable of Wattributes in preparation for libcxx rebase." am: 7984620
am: d7c070f

* commit 'd7c070f4a01f9518f19e42ab83285c50c0554b2e':
  Adding gcc-specific disable of Wattributes in preparation for libcxx rebase.

Change-Id: I9e1c63516f5729f97a9bcf5e664715e63c05dbc4
2016-04-18 18:40:47 +00:00
Dan Austin
7984620461 Merge "Adding gcc-specific disable of Wattributes in preparation for libcxx rebase." 2016-04-18 18:23:11 +00:00
Treehugger Robot
008b9c5624 Merge "Add support for LOCAL_EXPORT_*_LIBRARY_HEADERS" am: 5f3b368
am: 02b786c

* commit '02b786ce2d370cb5d3a33de9b61a9255114f978d':
  Add support for LOCAL_EXPORT_*_LIBRARY_HEADERS

Change-Id: I978f51fe6561f60e8f054b4314d77fcc6136bcb5
2016-04-12 22:14:48 +00:00
Treehugger Robot
5f3b3689af Merge "Add support for LOCAL_EXPORT_*_LIBRARY_HEADERS" 2016-04-12 21:24:51 +00:00
Christopher Wiley
ff1c3f2b05 Add support for LOCAL_EXPORT_*_LIBRARY_HEADERS
Listing a library in any of:

  LOCAL_EXPORT_SHARED_LIBRARY_HEADERS
  LOCAL_EXPORT_STATIC_LIBRARY_HEADERS

will cause the headers exported by that library to be exported from
the current library target as well.

This means that when library A's public headers include headers from
library B, library C which consumes A no longer has to explicitly list
A and B in its LOCAL_SHARED_LIBRARIES for the purpose of picking up B's
headers.

Bug: 27804373
Test: Introduced dependency on libbase to libbinder at the header level.
      Libraries that consume libbinder do not need to explicitly depend
      on libbase.

Change-Id: If69079f058a4a182c5ef5a3c5ba15035570da22d
2016-04-12 09:27:29 -07:00
Shinichiro Hamaji
bae8b3f2d9 Merge "Add Bison binary and its data to prerequisite" am: 4d69fbf
am: 06af80f

* commit '06af80f6c4c1702b1aebea8cec56b49f43e88d4f':
  Add Bison binary and its data to prerequisite

Change-Id: I5039150bcb4d06677bd6d5fd4acea8e643fccb89
2016-04-07 03:56:24 +00:00
Shinichiro Hamaji
3a192c0246 Merge "Fix dependencies of protoc with nanopb-c plugin" am: 5e2d7f3
am: ae91743

* commit 'ae917433aaa92941bc2ad515f8bdb4f77c462ac0':
  Fix dependencies of protoc with nanopb-c plugin

Change-Id: Ib548b09c87f9be296e6e1fcb60ec0fcd4ddd0908
2016-04-07 03:56:23 +00:00
Shinichiro Hamaji
4d69fbf5be Merge "Add Bison binary and its data to prerequisite" 2016-04-07 03:48:31 +00:00
Shinichiro Hamaji
5e2d7f3204 Merge "Fix dependencies of protoc with nanopb-c plugin" 2016-04-07 03:48:02 +00:00
Dan Austin
75e7af10b9 Adding gcc-specific disable of Wattributes in preparation for libcxx rebase.
Change-Id: Ida49761801e58b2475e006525e3ea2bbad3731af
2016-04-06 18:35:07 +00:00
Shinichiro Hamaji
a3184dc2ae Fix dependencies of protoc with nanopb-c plugin
Bug: 27954979
Change-Id: Ic06b5288b092d8ea5225516069845bfc2ffa9cd1
2016-04-06 13:54:03 +09:00
Shinichiro Hamaji
b708bc5533 Add Bison binary and its data to prerequisite
Bug: 27954979
Change-Id: Id68425ef85c07b9bd06d9640f4bf96270af1b893
2016-04-06 13:46:02 +09:00
Dan Albert
885c4d927d Merge "Remove mips special case." am: a6a6285
am: 7d4c8fe

* commit '7d4c8fefec0998048b34fcedc4f1c893e00919eb':
  Remove mips special case.

Change-Id: Ia55997b8dc087129e39028cd16fb9f3c49b950c0
2016-04-05 19:00:42 +00:00
Dan Albert
ce2fe3c121 Remove mips special case.
The NDK doesn't have an r6 subdir.

Bug: http://b/28009632
Change-Id: I482723a1b7400ed13dc70acad24fbed96683f460
2016-04-05 00:28:35 -07:00
Dan Albert
fd953aec6e Merge "Update NDK libc++ header paths." am: 66dcc50
am: 5514b26

* commit '5514b26d26e759e12557efbf10fe69acfbf5114c':
  Update NDK libc++ header paths.

Change-Id: I9153be2e981b4bda778a9ea74cc867435c68c6d9
2016-04-04 20:38:11 +00:00
Dan Albert
4b5b09a00b Merge "Add LOCAL_NDK_VERSION." am: 4410c29
am: f95ca6d

* commit 'f95ca6de0abb1fe21638c984847e3414038dd4e4':
  Add LOCAL_NDK_VERSION.

Change-Id: Ia2883b5482cef267debb90b2e8923731076c4511
2016-03-31 23:21:45 +00:00
Dan Albert
658d1e0434 Update NDK libc++ header paths.
The r11 libc++ uses libc++abi instead of libgabi++.

Bug: http://b/27801981
Change-Id: I5b90c14125dc024b2b290897bb3ef1c8d9546a7b
2016-03-31 14:22:09 -07:00
Dan Albert
13306af0c1 Add LOCAL_NDK_VERSION.
Used to select between releases of the NDK (r10, r11, etc).

Some of the libraries we use in Android come as prebuilts from
google3, which are most likely built against an older NDK than what
we have in the platform. Since things may not be ABI compatible
release to release, we need to keep legacy versions accessible for
those to keep building.

Change-Id: Ia3df42fa6f3a7bd5108ff6bbb0f2ca06239c3be9
2016-03-31 12:54:21 -07:00
Dan Willemsen
a586820428 Merge "Forbid Clang for Windows" am: e4d5e08
am: 1eb2442

* commit '1eb24425d04d64d1811bc34c6395179fa3cfd526':
  Forbid Clang for Windows

Change-Id: I51432b0f6782422dd424edbbecab9a5b936be8f2
2016-03-29 21:02:56 +00:00
Dan Willemsen
e4d5e08c2e Merge "Forbid Clang for Windows" 2016-03-29 20:54:24 +00:00
Dan Willemsen
9537477df7 Forbid Clang for Windows
Clang and MinGW are not expected to work together currently, and you get
strange errors when this is attempted. Instead, error out with a clear
error message.

Before the windows build rewrite, we'd just explicitly set my_clang to
false without checking what the module asked for. Now, error out if the
module explicitly asked for clang, since by default they'd have it
already if it wasn't for windows. That way when Clang+Windows does
become possible, it can gradually be tested by setting LOCAL_CLANG to
true.

Change-Id: I9e0b0dca30946d94894119443f2fd0593cee1793
2016-03-29 12:34:03 -07:00
Shinichiro Hamaji
0f846c73e1 Replace last -includes by .KATI_DEPFILE
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.

Bug: 26839129
Bug: 27886012
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
(cherry picked from commit 72904774a3)
2016-03-29 12:10:48 -07:00
Shinichiro Hamaji
2fb7b61a2e Use KATI_DEPFILE for .P associated with object files
Also specify "-d keepdepfile" to ninja so .P files won't be
deleted by ninja.

-include for .s files are removed because GCC doesn't
generate .d files for .s files.

Bug: 26839129
Bug: 27886012
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
(cherry picked from commit 4037c4225a)
2016-03-29 12:10:03 -07:00
Dan Albert
565f161363 Merge "Using stlport_static or c++_static requires libdl."
am: 2d3d14b

* commit '2d3d14b69bfc4e0c85ebc3266b22bf57e94adf64':
  Using stlport_static or c++_static requires libdl.
2016-03-24 01:34:37 +00:00
Dan Albert
2d3d14b69b Merge "Using stlport_static or c++_static requires libdl." 2016-03-24 01:26:09 +00:00
Ying Wang
7dee3625e0 Merge "Create empty .a on Darwin when there is no obj file."
am: 37aa85e

* commit '37aa85e8bb0d86cae946d85a27b6ded593c425b7':
  Create empty .a on Darwin when there is no obj file.
2016-03-23 16:56:20 +00:00
Ying Wang
4aaa1a1fd8 Create empty .a on Darwin when there is no obj file.
On Darwin ar would fail if there is no object file to add.
We work around by adding a dummy.o to the .a and then deleting it.

Bug: 27800477
Change-Id: I68bbebea2726058c25863d7026a645a520d05167
2016-03-22 18:23:13 -07:00
Dan Albert
a81e1b7fed Using stlport_static or c++_static requires libdl.
Why? For one, libgcc's unwinder makes use of `dl_iterate_phdr`. Also,
libgabi++ (the home grown C++ RT we use for stlport) uses
`dlopen` for liblog when reporting fatal errors. The LLVM unwinder
which is used by libc++ also uses libdl.

Requiring a dependency on libdl seems less objectionable than
requiring one on liblog. We could always change libgabi++ to  use
syslog instead, but that will only reach logcat for newer devices
(possibly L+, definitely M+).

Requiring libdl seems like the best option here, especially given
that libgcc needs it anyway.

Change-Id: I4acfaf38145c39fc15a76fbb282a46786e5322f1
2016-03-22 17:15:14 -07:00
Shinichiro Hamaji
082d5e5081 Merge "Replace last -includes by .KATI_DEPFILE"
am: c26ec724b8

* commit 'c26ec724b8b4d356573901f96e1a8ce728bdd1b1':
  Replace last -includes by .KATI_DEPFILE
2016-03-15 23:06:31 +00:00
Shinichiro Hamaji
72904774a3 Replace last -includes by .KATI_DEPFILE
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.

Bug: 26839129
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
2016-03-16 06:40:04 +09:00
Shinichiro Hamaji
fb87a2610d Merge "Use KATI_DEPFILE for .P associated with object files"
am: b95dc31033

* commit 'b95dc310330bd59fa860ab98822529bb0d2256c6':
  Use KATI_DEPFILE for .P associated with object files
2016-03-14 22:07:10 +00:00
Shinichiro Hamaji
b95dc31033 Merge "Use KATI_DEPFILE for .P associated with object files" 2016-03-14 21:59:46 +00:00
Dan Willemsen
b36a413519 Merge "Reexport include dirs for whole static libs" am: e2379484ab
am: 90074f7f1f

* commit '90074f7f1f128cbd528d6d709bb3aa2d22783884':
  Reexport include dirs for whole static libs
2016-03-08 07:46:03 +00:00
Dan Willemsen
a7808accf4 Reexport include dirs for whole static libs
When a static library uses LOCAL_EXPORT_C_INCLUDE_DIRS, then is included
entirely in another library with LOCAL_WHOLE_STATIC_LIBRARIES, all the
symbols are reexported, so reexport the headers too.

Change-Id: I92cf17894fc991a5b5ecb59ca5e095e407c98de4
2016-03-04 12:47:37 -08:00
Shinichiro Hamaji
4037c4225a Use KATI_DEPFILE for .P associated with object files
Also specify "-d keepdepfile" to ninja so .P files won't be
deleted by ninja.

-include for .s files are removed because GCC doesn't
generate .d files for .s files.

Bug: 26839129
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
2016-03-03 18:19:37 +09:00
Dan Willemsen
23afb78cf9 Merge commit 'cdaf748e3abefd93a4e45393e96717fad8564c51'
Change-Id: I3c44564b08ed46f46719dbca54d4225718bb8c59
2016-03-01 15:36:08 -08:00
Dan Willemsen
7f016150a0 Remove unused dependencies on $(ACP)
Most of these are calling to copy-file-to-target or similar, which no
longer use $(ACP).

Change-Id: I62287a80c577c34df587b74e70055c2f56050ce7
2016-03-01 13:15:35 -08:00
Dan Willemsen
9ffa38b193 Merge "Remove USE_NINJA=false" am: 3bfc095f53
am: d73633c082

* commit 'd73633c0824a63f7104bddf9a798bccc952b545c':
  Remove USE_NINJA=false
2016-02-29 22:19:29 +00:00
Dan Willemsen
1c6dc5b942 Remove USE_NINJA=false
And everything special-cased on that. Add a warning if USE_NINJA is
set to let users know that it no longer changes anything.

Change-Id: Ib8739151fe26ea6bf8f76b7ac2b8f4097dab0b47
2016-02-26 21:48:31 -08:00
Chih-Hung Hsieh
71d8cbd9b6 Use newest clang static analyzers.
* When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
  call new clang ccc-analyzer or c++-analyzer.
* Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
  call compiler with -fsyntax-only.
* Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
* ccc-analyzer executes the original compilation command to generate
  object files before calling clang with --analyze to do static analysis.
* When clang is called with --analyze, macro __clang_analyzer__ is defined.

BUG: 13287788

(cherry picked from commit 765c1ea6d7)

Change-Id: I6e51e51ff4ed3ce514f60d090494dcdf6e520b04
2016-02-26 18:51:26 -08:00
Dan Albert
12ce3e2b79 Merge "Add a global define for non-external code." am: 036b4fce25
am: 2b8c384da3

* commit '2b8c384da3ae091527f465cbff2950129ac17e0b':
  Add a global define for non-external code.
2016-02-25 22:21:16 +00:00
Dan Albert
5ae31ddedc Add a global define for non-external code.
There are some code policies we want to enforce more strictly, but
it's hard to do so for third party code because we have to either
carry the diff burden or upstream the patch, and in the latter case
the turnaround time for fixes can be problematic, and sometimes
upstream won't accept changes (sometimes people just need to win the
obfuscated C contest).

We define ANDROID_STRICT for any code that we expect to be able to
make these policy fixes as we change policies.

Change-Id: I15faf62cec1932dd859a082f66942b2606d0ff45
2016-02-25 12:25:43 -08:00
Chih-hung Hsieh
2fd8d9da17 Merge "Use newest clang static analyzers."
am: 82953d72ac

* commit '82953d72acc9775d6b58808abde1a825b4f7cffb':
  Use newest clang static analyzers.
2016-02-12 17:41:34 +00:00
Chih-Hung Hsieh
765c1ea6d7 Use newest clang static analyzers.
* When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
  call new clang ccc-analyzer or c++-analyzer.
* Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
  call compiler with -fsyntax-only.
* Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
* ccc-analyzer executes the original compilation command to generate
  object files before calling clang with --analyze to do static analysis.
* When clang is called with --analyze, macro __clang_analyzer__ is defined.

BUG: 13287788

Change-Id: I5edb25b52998d871385dd000778db2ce83224078
2016-02-11 16:43:51 -08:00
Dan Willemsen
6fca454c41 Merge "Fix unused src tracking for generated .o files" am: 478913f88f
am: d02bb7bfc5

* commit 'd02bb7bfc51343ab88eb2e05157155673ddf8130':
  Fix unused src tracking for generated .o files
2016-02-05 18:20:34 +00:00
Dan Willemsen
444c323bc1 Fix unused src tracking for generated .o files
*.o files that are passed in via LOCAL_GENERATED_SOURCES are added
directly to all_objects, they are not mixed with the normal_objects that
we track. So omit them from they my_gen_src_files list so that we don't
warn that they're unused.

Change-Id: I94b85504032e70fbcc00207d6200557700dd0a89
2016-02-04 14:22:31 -08:00
Dan Willemsen
f244691a14 Merge "Track ObjC object mapping" am: fedafc879d
am: d3212f55c3

* commit 'd3212f55c3ee2b762144089a932e8995519b0a57':
  Track ObjC object mapping
2016-02-02 09:13:48 +00:00
Dan Willemsen
62f2e56c72 Track ObjC object mapping
Objective-C .m/.mm files were not being tracked, so they were showing
up as unused source files (on Darwin). They were also triggering an
internal build system warning because the new object list did not
match the current list.

Change-Id: I01fff8c5587fe168106c60782080d60744311f6f
2016-02-01 18:55:23 -08:00
Dan Willemsen
917de453ee Merge "Order objects based on LOCAL_SRC_FILES and LOCAL_GENERATED_SOURCES" am: 224466b1af
am: 991c840313

* commit '991c8403131dc5781d3d4a1d10d292dc99fee202':
  Order objects based on LOCAL_SRC_FILES and LOCAL_GENERATED_SOURCES
2016-01-30 02:49:08 +00:00
Dan Willemsen
3bb168f10d Order objects based on LOCAL_SRC_FILES and LOCAL_GENERATED_SOURCES
We have been reordering objects to the linker based on how they were
generated. In soong, they're ordered based on the order listed in the
src_files.

Keep track of which source files created which object files so that we
can create the ordered list. Optionally change the order, based on
BINARY_OBJECTS_ORDER. That way we can compare make and soong builds.

Since we're keeping track of the used source files, warn when an entry
in LOCAL_SRC_FILES is not used. (whether it is an unused file like a
header, or a typo)

LOCAL_GENERATED_SOURCES is not verified, since it is valid to add
headers and other files in that list (to set up dependencies).

Change-Id: I1dfbbb3aa570c11c1db3b7133e46ed0b8c3b8989
2016-01-27 16:48:02 -08:00
Shinichiro Hamaji
d6cad82b89 Merge "Use dependency files generated by llvm-rs-cc" am: 19f99a742d
am: d39a629d3a

* commit 'd39a629d3ae3b072f419972356bcfa3fc340b1bd':
  Use dependency files generated by llvm-rs-cc
2016-01-26 06:41:53 +00:00
Shinichiro Hamaji
2e45fd036a Use dependency files generated by llvm-rs-cc
This was a regression since kati has been introduced. This CL
introduces include-depfile function to make it easier to write
Makefiles which work with both make and kati.

As ninja can handle only a single dependency file per a build
rule, now we merge multiple .d files generated by llvm-rs-cc
into a .d file.

Change-Id: Iaf64a8f0523ab98115837e6e06abd50f06620363
2016-01-26 14:24:46 +09:00
Dan Willemsen
37693fc24b Merge "Pass the arm/thumb cflags to assembly files" am: 60c9200c1e
am: 537e093fe8

* commit '537e093fe893e21ecab7aba2a32c99f18f5350b6':
  Pass the arm/thumb cflags to assembly files
2016-01-21 23:25:34 +00:00
Dan Willemsen
60c9200c1e Merge "Pass the arm/thumb cflags to assembly files" 2016-01-21 22:31:11 +00:00
Christopher Wiley
e46193a608 Merge "Separate aidl dependencies from compiler dependencies" am: 8edda3afdf
am: cfd817d058

* commit 'cfd817d058994ebda3b98db4e8113752753d422e':
  Separate aidl dependencies from compiler dependencies
2016-01-21 18:29:25 +00:00
Christopher Wiley
d1eea90a72 Merge "Keep aidl generated C++ inside the generated folder" am: 11feb8b075
am: 7c52b2d878

* commit '7c52b2d878e6234cb6e36942c87c438fa1e80240':
  Keep aidl generated C++ inside the generated folder
2016-01-21 18:29:15 +00:00
Christopher Wiley
087f327304 Separate aidl dependencies from compiler dependencies
Both aidl and clang/gcc were putting their dependencies in the same
place.  Move aidl's dependencies to a file ending with .aidl.P rather
than the compiler's .P.

While here, inform kati that we have these special dep files.

Bug:26409006
Test: Rebuild, note both files being generated

Change-Id: I29d2eea822235d60713c2059f3a314e475eb5aa3
2016-01-20 12:54:09 -08:00
Christopher Wiley
257796c62d Keep aidl generated C++ inside the generated folder
Transform ../ to dotdot/ for C++ generateds from .aidl source files.
This forces us to use one layer of indirection to calculate the build
rules for .aidl files, since we can no longer use a pattern rule.

This was tested by modifying system/tools/aidl's Android.mk to refer to
its .aidl files by going up two directories and then repeating the
directories again.  When I print the build rules with $(info) I see that
dotdot/ appears in appropriate places (C++ paths, but not .aidl paths).

Bug: 26407018
Test: Described above.

Change-Id: I397c9d10408c0c66d8b5a247a1f34eb4bf4f74ce
2016-01-20 09:17:20 -08:00
Dan Willemsen
45d38c06b4 Pass the arm/thumb cflags to assembly files
This effectively changes the default instruction set of assembly files
from arm to thumb in order to match the default for C/C++.

Change-Id: I8684f144a1195b53b3e0fdd04cacf77f6a131c7e
2016-01-19 12:37:17 -08:00
Ying Wang
f0ebe165b9 Generate .c for .y and .l
- For .l/.y source files, generate .c files; for .ll/.yy source files,
  generate c++ files.
- Simplified the rules by adding the generated sources to
  my_generated_sources.
- Simplified generated header file naming by always using .h extension
  with bison's "--defines=" option.
- Removed the unnecesarry conditional inclusion to the generated
  headers. Bison already automatically generates such things.

Bug: 26492989
Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
2016-01-12 21:07:27 -08:00
Ying Wang
64088f2459 Generate .c for .y and .l
- For .l/.y source files, generate .c files; for .ll/.yy source files,
  generate c++ files.
- Simplified the rules by adding the generated sources to
  my_generated_sources.
- Simplified generated header file naming by always using .h extension
  with bison's "--defines=" option.
- Removed the unnecesarry conditional inclusion to the generated
  headers. Bison already automatically generates such things.

Bug: 26492989
Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
2016-01-11 17:41:56 -08:00
Chih-Hung Hsieh
b5da9d94a2 Change USE_CLANG_PLATFORM_BUILD default to true.
When USE_CLANG_PLATFORM_BUILD is not set, default will be clang/llvm.
USE_CLANG_PLATFORM_BUILD=false can be used to select gcc as default.

Bug: 23163853
Bug: 26102335
Change-Id: I434176732fa4a382be9d8d8642a1c705b023cf84
2016-01-06 11:49:25 -08:00
Ying Wang
4106b2e4c9 Merge "Disable .toc optimization for host modules." am: 7b92312ea1
am: 8449b88b2e

* commit '8449b88b2e64f49a6858ec36acca9e877585802e':
  Disable .toc optimization for host modules.
2015-12-15 19:32:42 +00:00
Ying Wang
c01f2dcb10 Disable .toc optimization for host modules.
Host binaries may be run during the build process and the internal
implementation of the shared libraries makes a difference for the build
result. This change makes sure host tools get re-linked and re-run when
any of its dependency libraries gets updated.
DEX2OAT is such a host tool. We also changed DEX2OAT as full dependency
of dex-preoptimization, so we rebuild the odex files if DEX2OAT itself,
or any dependency libraries changed.

Bug: 24597504
Change-Id: Idf0d9be82ccebd826d9c5b405a39cff437e0af29
2015-12-15 10:00:19 -08:00
Stephen Hines
2967be8a2b Merge "Revert "Change USE_CLANG_PLATFORM_BUILD default to true."" am: eca3206abb
am: 67b6cc2201

* commit '67b6cc2201f41508ea36bd0943aef545a68a679f':
  Revert "Change USE_CLANG_PLATFORM_BUILD default to true."
2015-12-13 15:13:26 -08:00
Stephen Hines
eca3206abb Merge "Revert "Change USE_CLANG_PLATFORM_BUILD default to true."" 2015-12-13 23:06:03 +00:00
Stephen Hines
7a0c88ec3e Revert "Change USE_CLANG_PLATFORM_BUILD default to true."
This reverts commit 3c8036da53.

Change-Id: I930bbebce8396d7c0abd847530640a696d3418e7
2015-12-13 22:58:22 +00:00
Dan Albert
1f6d007a23 Merge "Use lib64 for mips64 as well." am: 6674573897
am: 3340159339

* commit '33401593392cf903cb3228a7a998f91a7e392be0':
  Use lib64 for mips64 as well.
2015-12-13 13:14:37 -08:00
Dan Albert
445bc2fc2d Use lib64 for mips64 as well.
This was previously working because for some reason prebuilts/ndk had
a tangled mess of hand assembled symlinks that pointed lib -> lib64
for the multilib architectures.

Change-Id: I294d67f58f2008b1a53790cf676f5223df449cbc
2015-12-11 15:04:59 -08:00
Chih-hung Hsieh
c0b23c4780 Merge "Change USE_CLANG_PLATFORM_BUILD default to true." am: eb486309d8
am: a3fbb3b0e4

* commit 'a3fbb3b0e49bfbec697f73d4c4e77bb12f8e348e':
  Change USE_CLANG_PLATFORM_BUILD default to true.
2015-12-11 10:25:29 -08:00
Chih-Hung Hsieh
3c8036da53 Change USE_CLANG_PLATFORM_BUILD default to true.
When USE_CLANG_PLATFORM_BUILD is not set, default will be clang/llvm.
USE_CLANG_PLATFORM_BUILD=false can be used to select gcc as default.

BUG: 23163853
BUG: 26102335

Change-Id: I00604c2aef4849e8c3505b2c4002eb1c46cd1fd1
2015-12-10 14:41:55 -08:00
Dan Albert
0ba8a9cecc Merge "Fix the mips build." am: 0f8bd686e1
am: 064b18f155

* commit '064b18f1558c2a2ef9a82451a8955c4bfebbbac4':
  Fix the mips build.
2015-12-10 00:37:26 +00:00
Dan Albert
8dca15f287 Fix the mips build.
The linker can't do --hash-style=gnu for mips.

Change-Id: I66a77067f8be6fc92ca686d3e6e159beb72cf76b
2015-12-09 16:26:20 -08:00
Dan Albert
17310f6e65 Merge "Add support for LOCAL_NDK_STL_VARIANT := none." am: 2ad9079305
am: 9a986a6e68

* commit '9a986a6e682e2c22b5a63637589a88314a83316b':
  Add support for LOCAL_NDK_STL_VARIANT := none.
2015-12-09 16:24:31 -08:00
Dan Albert
2ad9079305 Merge "Add support for LOCAL_NDK_STL_VARIANT := none." 2015-12-10 00:17:23 +00:00
Dan Albert
0e2e71dc2e Add support for LOCAL_NDK_STL_VARIANT := none.
Sometimes we don't want any STL.

Change-Id: I08b4389b7882702c0e483a1456f7775fe4da1c75
2015-12-09 15:59:17 -08:00
Dan Albert
7de99574dc Merge "Build NDK binaries with --hash-style=both." am: 30cb36ff5e
am: 0477dce031

* commit '0477dce031cadff3f2b9d64fe35a3bd9afa8810f':
  Build NDK binaries with --hash-style=both.
2015-12-09 23:50:25 +00:00
Dan Albert
ee629c9ffb Build NDK binaries with --hash-style=both.
Change-Id: I1c3b7415c654b783c6bb7e38a40d4c279826400f
2015-12-09 14:52:25 -08:00
Dan Willemsen
1da3ae6fab Merge "Sanity check LOCAL_SRC_FILES_EXCLUDE" am: cc3b2a5854 am: a4769d2956
am: 2b661fe7e0

* commit '2b661fe7e03b73be082b1d5be0d21e9c64393f4b':
  Sanity check LOCAL_SRC_FILES_EXCLUDE
2015-12-05 02:08:42 +00:00
Dan Willemsen
c29172c333 Sanity check LOCAL_SRC_FILES_EXCLUDE
Error out if there is a file listed in LOCAL_SRC_FILES_EXCLUDE but not in
LOCAL_SRC_FILES. This should catch typos or other mistakes that would
otherwise be missed.

Change-Id: Iaddf575a6ce35238998ac47b59591a7d05fbcd0d
2015-12-03 22:58:39 -08:00
Colin Cross
699cc1ddf4 Merge "Make export_includes a restat rule" am: 615d66e2c2 am: b16a63cbb0
am: ceac25c571

* commit 'ceac25c5719aab39d7a15fd1c1578d8839a86911':
  Make export_includes a restat rule
2015-12-01 01:52:33 +00:00
Colin Cross
6b9bddde6f Make export_includes a restat rule
There is currently an intentional incremental rebuild issue with
import_includes.  export_includes might get updated with an identical
version, but we don't want to force everything downstream of it to
rebuild.

When BUILDING_WITH_NINJA==true, only update export_includes if it
changes, and use .KATI_RESTAT to only run downstream rules if it
changes.  import_includes will only be updated if one of the
export_includes files is updated, so object files can have a normal
dependency on import_includes instead of an order-only dependency.
All downstream object files will now be recompiled if their imported
include paths change.

Bug: 25910568
Change-Id: I626f3b24ac02ac1309049cf1ce66cfe8ec816513
2015-11-30 17:33:26 -08:00
Michael Wright
0fb087fc73 Add new Test API for CTS testing.
Bug: 25608286
Change-Id: I0334061b548970959e46392dc3a1feed8533548c
2015-11-25 11:38:44 +00:00
Christopher Wiley
2d91c61ef0 Fix race in C++ AIDL file generation
The export_includes file for a library needs to express a dependency on
all generated exported headers.  For aidl generated headers, express a
dependency on the .cpp file instead, since the generator promises to
generate this file last.  Unfortunately, the C++ headers generated from
a .aidl file depend on the contents of the file.

Change-Id: I9402b364e4538b502c0958ac8c7bd72cb0add724
2015-11-19 13:52:15 -08:00
Christopher Wiley
c7e936f530 Export generated AIDL headers
It is common for developers to generate/compile AIDL in a static
library, then link that library into an executable.  When doing this,
developers need to export the generated headers.

Bug: 25779424
Test: a refactoring of the aidl Android.mk shows this works

Change-Id: I4f7d471a601d2a683cb5a9da5e02e3fab576c26a
2015-11-19 11:04:18 -08:00
Shinichiro Hamaji
0e7587a9ea Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries
When a shared object is rebuilt, all dependent libraries and
executables are rebuilt. Such rebuild is unnecessary when there
is no interface change. With this patch, .toc files will be
generated for all .so files. The rule which generates .toc files
has ninja's restat=1 and .toc files are not changed ninja won't
rebuild dependent targets.

Performance:

$ m && touch bionic/libc/stdio/stdio.c && time m
Before: 1m03s (2563 targets)
After: 21s (90 targets)

Bug: 24597504
Change-Id: Ia5dd950273d143f4e99eee8bef7478f1a94cd138
2015-11-04 15:23:59 +09:00
Dan Albert
da63739767 Drop GCC back to C++11.
Our GCC does not use a valid C++14 ABI.

Bug: http://b/25022512
Change-Id: I6f4b3450137c24a6a0c00bf956bae7a0ba280094
2015-10-26 11:28:33 -07:00
Christopher Wiley
2df75d17a8 Invoke the aidl-cpp compiler to generate C++
Bug: 23599697
Test: test application compiles generated code

Change-Id: I35255517dd0b7ef7a82134be1c862093eaa3ce6b
2015-10-19 16:18:03 -07:00
Colin Cross
a04abc8e23 Add support for LOCAL_SRC_FILES_EXCLUDE
LOCAL_SRC_FILES_EXCLUDE will be used to filter files out of
LOCAL_SRC_FILES.  A common usage will be to use
LOCAL_SRC_FILES_EXCLUDE_<arch> to remove a source file that will be
replaced with an arch-optimized version.

Change-Id: I75cc6114c47fb784bab65cae8f618c4f395f07bb
2015-10-16 17:33:01 -07:00
Dan Albert
5baea14363 Merge "Use libgcov OR libclang_rt.profile, not both." 2015-10-15 18:39:42 +00:00
Peter Qiu
425e01996a Export include path to D-Bus headers for multilib builds
Bug:None

Change-Id: I6e3898c71f54ede08a27f5be93e95a2b219e5ea6
2015-10-14 16:54:48 -07:00
Dan Albert
7fbbc5d205 Use libgcov OR libclang_rt.profile, not both.
Using both can cause duplicate symbol errors.

Change-Id: Id8ee13a81d32e3248ff1cdc468f49a26ecde6b57
2015-10-08 14:16:39 -07:00
Nicolas Geoffray
3f054bdd0d am 506857e9: Merge "Make linker configurable through environment."
* commit '506857e974ed1aac60bff96a71d0eb182865bed8':
  Make linker configurable through environment.
2015-09-29 09:04:59 +00:00
Nicolas Geoffray
506857e974 Merge "Make linker configurable through environment." 2015-09-29 08:34:28 +00:00
Colin Cross
7ee3b85eba resolved conflicts for 953981db to stage-aosp-master
Change-Id: Ic1003a594ac5e5e91b124f249a569fb81123e973
2015-09-28 18:45:23 -07:00
Colin Cross
a4447e8c89 Don't add dependencies on Makefiles when using ninja
Ninja has an implicit dependency on the command being run, and kati will
regenerate the ninja manifest if any read makefile changes, so there is no
need to have dependencies on makefiles.
This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't
include base_rules.mk, but it will fix the most common ones.

Bug: 23566977
Change-Id: I66de882421376303ab7233c8ce7274548f6b2199
2015-09-28 16:29:52 -07:00
Nicolas Geoffray
b7c9f32765 Make linker configurable through environment.
Change-Id: I152ad7b41cfa05f2f59f51c6d8bd1e427f1a1649
2015-09-28 10:03:26 +01:00
Shinichiro Hamaji
a9bd99816f am cf448ddb: Merge "Use gomacc even for FDO build"
* commit 'cf448ddb4f95f511575e56a729e0d60a45d84e1e':
  Use gomacc even for FDO build
2015-09-28 04:43:25 +00:00
Shinichiro Hamaji
09295a82f8 Use gomacc even for FDO build
Goma's client recognizes -fprofile-use= flag so shoulde be
compatible with Android's FDO build.

Change-Id: I0d21d6f530cd05770f8dc12e9dc33a5db49a9c7d
2015-09-26 12:01:21 +09:00
Dan Albert
ded3f15eeb am 782b98ea: Merge changes I3ca9ed36,Ibd7eec5c
* commit '782b98eaa1c02d935b338f7317fef139067291bb':
  Revert "Default to hiding libgcc symbols in each object."
  Revert "Don't apply --exclude-libs for the host."
2015-09-23 23:47:37 +00:00
Dan Albert
b77aedbf1e Revert "Default to hiding libgcc symbols in each object."
This reverts commit 021b7651a5.

Bug: http://b/24166967
Change-Id: I3ca9ed36fa3b55c7eb129c209903676879720acd
2015-09-23 16:18:18 -07:00
Dan Albert
31927f76a3 Revert "Don't apply --exclude-libs for the host."
This reverts commit 1576da248c.

Bug: http://b/24166967
Change-Id: Ibd7eec5c261e85a0474243991be7ee1860c9e14d
2015-09-23 16:18:03 -07:00
Dan Albert
84a500039d am a41dd0a9: Merge "Don\'t apply --exclude-libs for the host."
* commit 'a41dd0a973ad9b890a4e2fe558ad6ed038bacdef':
  Don't apply --exclude-libs for the host.
2015-09-23 20:42:33 +00:00
Dan Albert
1576da248c Don't apply --exclude-libs for the host.
The Mac linker doesn't support this flag, and we don't actually need
it there anyway because we link dynamically to the system's compiler
runtime lib.

Bug: http://b/24166967
Change-Id: I62a926ed39d9fc487638e0c1a172762503dd633e
2015-09-23 13:32:14 -07:00
Dan Albert
0b8113ee08 am c496b259: Merge "Default to hiding libgcc symbols in each object."
* commit 'c496b259b8dddf0eac71a50f5e258da4a353d6bb':
  Default to hiding libgcc symbols in each object.
2015-09-23 20:15:37 +00:00
Dan Albert
021b7651a5 Default to hiding libgcc symbols in each object.
Bug: http://b/24166967
Change-Id: I3dba264ae70a2e13b3edee7575139e86ef49be71
2015-09-22 16:49:28 -07:00
Scott James Remnant
d8f08571b3 am 909fe8e0: Merge "build: support compiling .mm on host"
* commit '909fe8e0f7da8db09a004ef44a90e786c81df5e4':
  build: support compiling .mm on host
2015-09-17 23:15:30 +00:00
Scott James Remnant
dd86e5a0de build: support compiling .mm on host
libchrome uses .mm (Objective-C++) files to bridge C++ code with
OS X Frameworks. This adds support for compiling .mm to .o by just
using the existing C++ support.

Bug: 24168923
Change-Id: Ia65357e2e2584dfffcb6796e214fe6b27635c3a6
2015-09-17 15:51:32 -07:00
Dan Albert
d9f9836e5e am 3ee9daac: Merge "Remove WITHOUT_(HOST|TARGET)_CLANG."
* commit '3ee9daac6a3bf8d2a9030b99f62595330f22cafa':
  Remove WITHOUT_(HOST|TARGET)_CLANG.
2015-09-16 23:31:41 +00:00
Dan Albert
32f7ff14ce Remove WITHOUT_(HOST|TARGET)_CLANG.
This is unused.

Change-Id: Ibc461fef02c82d110718003aceffb943c930ffe6
2015-09-16 15:43:00 -07:00
Dan Willemsen
749e07c648 am c8db47a0: Merge "Don\'t build windows modules with clang, fix flags"
* commit 'c8db47a0213aa5c204c140cb9268389b4175ae06':
  Don't build windows modules with clang, fix flags
2015-09-09 23:25:11 +00:00
Dan Willemsen
7728817ab9 Don't build windows modules with clang, fix flags
shamu checkbuilds set USE_CLANG_PLATFORM_BUILD, which shouldn't apply to
modules built for windows. Also fix some flags that were being set
improperly.

Bug: 23566667
Change-Id: Id4c5b7cc59966328483d90f2b7be3f35e439ecee
2015-09-09 16:10:50 -07:00
Dan Willemsen
c98d9a9d0f am f1c09d7f: Merge "Add HOST_CROSS_OS"
* commit 'f1c09d7fbd92a08cc51950a7d35fb5f7fc564a20':
  Add HOST_CROSS_OS
2015-09-09 18:19:13 +00:00
Dan Albert
4ecedbc823 am feb3ecaf: Merge "Fix name for NDK protobuf libraries."
* commit 'feb3ecaff02d2bddb82aae0fa3024d9b9a62169e':
  Fix name for NDK protobuf libraries.
2015-09-09 18:19:11 +00:00
Dan Willemsen
f1c09d7fbd Merge "Add HOST_CROSS_OS" 2015-09-09 18:13:21 +00:00
Dan Willemsen
057aaea54a Add HOST_CROSS_OS
Instead of using recursive make to change the HOST_OS when building the
windows SDK under linux, add the concept of cross-building to another
host os.

Bug: 23566667
Change-Id: I6dc525b601b6251d458d197c30bf4660d7485502
2015-09-09 18:12:29 +00:00
Dan Albert
a187fb5986 Fix name for NDK protobuf libraries.
Name them *-ndk so it's clear which library is which.

Change-Id: I53544a8a97488f902e00d1aedaa021d09ee2f649
2015-09-08 10:47:03 -07:00
Dan Willemsen
d174629951 am 57ff23b0: Merge "Add support for LOCAL_SRC_FILES_(host)_(arch)"
* commit '57ff23b0ed02affce494d14d8a0f5e9e4717baf7':
  Add support for LOCAL_SRC_FILES_(host)_(arch)
2015-08-28 03:49:02 +00:00
Dan Willemsen
399c59f3aa am d5deac8d: Merge "Add _(darwin|linux|windows)"
* commit 'd5deac8db951ec0a1c9edd806ea1758b836f8c46':
  Add _(darwin|linux|windows)
2015-08-28 03:49:01 +00:00
Dan Willemsen
85ac8d2a00 Add support for LOCAL_SRC_FILES_(host)_(arch)
For boringssl, which has architecture specific host assembly files

Bug: 23566667

Change-Id: Ia4602d28e93a1b3d1400cf95417b5e446c5fb84b
2015-08-28 03:38:43 +00:00
Dan Willemsen
7a5498568f Add _(darwin|linux|windows)
So that we can support building both linux and windows binaries at the
same time on a linux host. This replaces the ifeq($(HOST_OS),...) checks
in Android.mk files.

Bug: 23566667

Change-Id: I693e11984e36d55bb6f09fa0d49bc485463e16fb
2015-08-28 03:36:22 +00:00
Christopher Wiley
3f7c5424db am 2b2c9dff: am 4e719eaf: Merge "Change .dbus.xml extension to .dbus-xml"
* commit '2b2c9dff35304c21ebe1e793a16443a882920f75':
  Change .dbus.xml extension to .dbus-xml
2015-08-21 22:24:31 +00:00
Christopher Wiley
9b17dea308 Change .dbus.xml extension to .dbus-xml
Work around gyp's inability to handle compound extensions by expecting
a similar looking simple extension for XML files definine DBus
interfaces.  We'll need to rename these sources in the places we're
using them already.

Bug: 23380180
Change-Id: Ieb2050f3ef05456cd70de65c3e128d57a6a508f8
2015-08-20 09:36:08 -07:00
Christopher Wiley
9c49f0affa am 688b4a3d: am 4d2b79f9: Merge "Generate DBus proxies and adaptors separately"
* commit '688b4a3db72b58e8908ecdb24e6c4d64a44fdbc6':
  Generate DBus proxies and adaptors separately
2015-08-19 22:31:03 +00:00
Christopher Wiley
529f176ee1 Generate DBus proxies and adaptors separately
Enable daemons exposing an interface over DBus to easily
build client libraries.  Now daemons can write rules like:

include $(CLEAR_VARS)
LOCAL_MODULE := libdbus-binding-example-client
LOCAL_DBUS_PROXY_PREFIX := dbus-example-example
LOCAL_SRC_FILES := \
    dbus_bindings/org.chromium.Example.Manager.dbus.xml \
    dbus_bindings/dbus-service-config.json
include $(BUILD_SHARED_LIBRARY)

to expose a client library.

While here, add support for generating independent adaptor header
files on a per interface basis.

Bug: 22608897
Change-Id: I011f9afc234811c31e445898321c2731c482fa77
2015-08-19 11:14:16 -07:00
Ying Wang
f050c2f1c7 Rename libnanopb-c-2.8.0 to libprotobuf-c-nano.
Bug: 20093047
Change-Id: I787925fde97d1a3965cb8a9bf012f3c5a45a6aed
2015-08-18 14:32:07 -07:00
Ying Wang
b28ed234aa Consolidate the nanopb-c and regular protobuf build rules.
Bug: 20093047
Change-Id: I38ebd748aacce6d215403da481ad04833810a995
2015-08-18 14:27:45 -07:00
Dan Albert
401faa3513 am 8d61be6c: am f9b75b1b: Merge "Don\'t filter on a non-existent variable."
* commit '8d61be6c781277ae3f5423c805092220a961b102':
  Don't filter on a non-existent variable.
2015-08-17 20:24:05 +00:00
Dan Albert
1b2187d871 Don't filter on a non-existent variable.
This used to be used for aarch64
(https://android-review.googlesource.com/#/c/80126/), but has since
been removed and now does nothing. This was then reimplemented more
generally with my_illegal_flags
(https://android-review.googlesource.com/#/c/166405/). Drop
*GLOBAL_UNSUPPORTED_CFLAGS in favor of that.

Change-Id: I3347726dd92f9d3a16783e0d9d3b685a828400b4
2015-08-17 10:36:09 -07:00
Yang Ni
9d1eaaea61 am dcfb0c80: am 36600a6b: Merge "Include target api version in build system for rscpp."
* commit 'dcfb0c8018ec9e81fa79f3251a3d49a4cc90ddf4':
  Include target api version in build system for rscpp.
2015-08-15 02:18:57 +00:00
Yang Ni
36600a6bf9 Merge "Include target api version in build system for rscpp." 2015-08-14 18:39:47 +00:00
Noah Presler
4796a8c524 Include target api version in build system for rscpp.
b/23161320

Change-Id: Ibc23309abed092e7648168fbf4b80891a44929a6
2015-08-13 17:07:56 -07:00
Dan Albert
dc0e7244a6 am 2c00d629: am 727b462a: Merge "Never allow -w."
* commit '2c00d62940e7f88b2168ccf3a29a1d3e84f59bfa':
  Never allow -w.
2015-08-13 17:02:13 +00:00