Commit graph

522 commits

Author SHA1 Message Date
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