Commit graph

808 commits

Author SHA1 Message Date
Ivan Lozano
f9f03e0119 Disable AArch64 XOM when not using lld.
AArch64 execute-only memory is only supported when using lld as the
linker. There's still a few modules which don't use lld, so in those
cases we need to disable this option.

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

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

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

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

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

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

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

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

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

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

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

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

Relands I8b37dda2b449b6b5d48d5b983f43de452f494a1e with fixes for
builds with GENERATE_BREAKPAD_SYMBOLS=true

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

Reason for revert: broke mac builds
Bug: 113936524

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

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

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I90175ea1489272d8d4fc0f9ba4e5bbfdc7399d82
2018-08-28 09:45:39 -07:00
Jiyong Park
5dc3475d5d Native modules installed to recovery are marked as native:recovery
This fixes a bug that platform module (native:platform) can link to a
recovery module due to the fact that the recovery module is also labeled
as native:platform. Fixing the bug by setting the link type correctly to
native:recovery.

Bug: 113277544
Test: m -j

Change-Id: I88fe0a9d958f2269cf9f9ebc205b2da8c6a761a5
2018-08-28 13:51:52 +09:00
Treehugger Robot
36ea50d760 Merge "Add "hwaddress" sanitizer." 2018-08-20 23:22:35 +00:00
Evgenii Stepanov
8841a7f681 Add "hwaddress" sanitizer.
Build/make support for "hwaddress".

* HWASan supports static binaries, unlike ASan.
* It will be used to build libc. Since static libraries get a .hwasan
  suffix in soong, the logic that moves libc-and-friends to the end
  of the link command line has to be updated.

Bug: 112438058
Test: manual, part of a bigger patch set

Change-Id: I3b52336841012622771a88ba161916bc33071dfe
2018-08-20 14:59:36 -07:00
Yu Shan
10be65dbc1 Use prebuilt nanopb_generator.py.
Use prebuilt nanopb_generator.py to avoid using the incompatible
version of libprotobuf-python on host.

Test: Local build tests.
Bug: 111798740
Change-Id: Iabca07eb13dbab183fbf85cb0dfe04ce33aa660c
(cherry picked from commit fa47daa47d)
2018-08-16 16:07:05 -07:00
Colin Cross
a113745d1f Track more static dependencies for notice files
Track transitive static dependencies of native binaries, and
and direct and transitive static dependencies of java and app
modules.

Bug: 112331930
Test: m checkbuild
Change-Id: I0e19971033d6254bfbb6555f0e68fd5e529569c6
Merged-In: I0e19971033d6254bfbb6555f0e68fd5e529569c6
(cherry picked from commit 579668b122)
2018-08-16 22:44:27 +00:00
Colin Cross
579668b122 Track more static dependencies for notice files
Track transitive static dependencies of native binaries, and
and direct and transitive static dependencies of java and app
modules.

Bug: 112331930
Test: m checkbuild
Change-Id: I0e19971033d6254bfbb6555f0e68fd5e529569c6
2018-08-14 15:39:32 -07:00
Dan Willemsen
e303480584 Remove LOCAL_CLANG := false support
Only clang is supported now.

Test: build/soong/build_test.bash in all downstream branches
Change-Id: Ie8ad009625ddd7d5c38a6276b631bc889974fda3
2018-07-24 04:44:09 +00:00
Dan Willemsen
62db0f0945 Deprecate implicit make rules
Test: mm
Test: view docs in gitiles
Change-Id: I1ced4b4218c733b5b5b771d626b20eb6fb22f0df
2018-06-20 16:52:10 -07:00
Yi Kong
0047dbed14 Fix CLANG_EXTERNAL_CFLAGS logic
Should be neq instead of eq.

Test: build-full.ninja is now correct
Change-Id: I26c0aa84d9b54a8b19f19124978ac1d49bae7448
2018-06-12 15:49:12 -07:00
Yi Kong
42e18966e2 Add external projects only CFlags option
Apply the flags to Android.mk projects as well.

Test: m checkbuild
Change-Id: Ia5f7f7d9d518820fc825dcf19e8fdd2c434e9013
2018-06-06 16:42:22 -07:00
Chih-Hung Hsieh
289e8d6011 Call lld with --pack-dyn-relocs=none if my_pack_module_relocations is false
* Factor out the logic that sets up my_pack_module_relocations
  from dynamic_binary.mk to pack_dyn_relocs_setup.mk.
* Use stand-alone relocation_packer only if my_pack_module_relocations
  is true and my_use_clang_lld is false.

Bug: 80093890
Bug: 73768157
Test: build and boot with USE_CLANG_LLD=true
Change-Id: I7c4b5fcdce0754c57cff4acf86185cac65a26c40
2018-05-31 16:18:22 -07:00
Colin Cross
e2f541bb9f Pass 0 to llvm-rs-cc for current
Apparently empty PRIVATE_RS_TARGET_API is not the same as current,
pass 0 explicitly.

Test: forrest ub-renderscript-test
Change-Id: I8b2001b12161f07c404f78f63a80d82dffa1075f
2018-05-16 09:57:10 -07:00
Colin Cross
532ae3bcfb Support LOCAL_RENDERSCRIPT_TARGET_API := current
Renderscript was using LOCAL_RENDERSCRIPT_TARGET_API := 0 to mean
current.  Use current instead, and check for it when comparing
if LOCAL_RENDERSCRIPT_TARGET_API >= 21.

Fixes an issue where LOCAL_RENDERSCRIPT_TARGET_API := 0 was being
treated as < 21, causing the renderscript resources to be passed
to aapt2:
out/target/common/obj/APPS/RSTestBackward_intermediates/flat-res/zip_res.flata.contents/raw/bc32: error: resource file cannot be a directory.

Bug: 79481102
Test: m java FORCE_AAPT2=true
Change-Id: I7726d0463ce1693bc9653b4d869ced181c491036
2018-05-15 15:28:22 -07:00
George Burgess IV
432899a25b Disable dtor inlining for clang-tidy
LLVM r328258 turned on a feature called temporary dtor inlining by
default for all of C++ in clang-tidy. This feature appears to be
somewhat over-aggressive when objects are being passed by value. For
example, given:

void foo(std::unique_ptr<int> i);

void bar() {
  auto x = std::make_unique<int>();
  int *i = x.get();
  foo(std::move(x));
  *i = 99;
}

...clang-tidy will complain about `*i = 99;` being a definite
use-after-free. This is incorrect, however: `foo` could stash the
`unique_ptr` it's given in a global, or a class member, or ...

Until upstream fixes this bug, it's probably best to keep this disabled.

Bug: None
Test: Ran the analyzer across Android locally. Nothing broke; number of
complaints dropped significantly.

Change-Id: I742eedf598a72a533285d913d191bfbbf0ce1688
2018-05-14 15:48:38 -07:00
Chih-Hung Hsieh
4955b857c4 When my_use_clang_lld, link with lld for host.
When USE_CLANG_LLD is true, my_use_clang_lld is true,
and *GLOBAL_LLDFLAGS will be used instead of *GLOBAL_LDFLAGS.

Bug: 73768157
Test: make checkbuild
Change-Id: I2598b72e9edde32f8e57df860571fd107c005540
2018-04-17 15:30:24 -07:00
Chih-Hung Hsieh
32427d6903 Add USE_CLANG_LLD and LOCAL_USE_CLANG_LLD
* Current default is not using lld.
* When USE_CLANG_LLD or LOCAL_USE_CLANG_LLD is true or 1,
  * Use *GLOBAL_LLDFLAGS instead of *GLOBAL_LDFLAGS.
    GLOBAL_LLDFLAGS should call lld and with correct lld flags.
  * set my_pack_module_relocations to false.

Bug: 73768157
Test: make checkbuild
Change-Id: I3e63cf8ae0865d01d2bc1f36e9304f4a5d092cb8
2018-04-12 11:00:06 -07:00
Jiyong Park
379ae9274e Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change allows platform modules to link to vendor public libraries.
When the name of a vendor public libraries (whose stub is defined via
vendor_public_library in Android.bp) is listed in
LOCAL_SHARED_LIBRARIES, it is actually linked to the stub library which
is available to platform modules.

Bug: 74275385
Test: m -j
Merged-In: I063b43431196190b59332b1bcad59f267073f89f
Change-Id: I063b43431196190b59332b1bcad59f267073f89f
(cherry picked from commit c3f1356a3a)
2018-03-30 12:59:34 +09:00
Jiyong Park
c3f1356a3a Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change allows platform modules to link to vendor public libraries.
When the name of a vendor public libraries (whose stub is defined via
vendor_public_library in Android.bp) is listed in
LOCAL_SHARED_LIBRARIES, it is actually linked to the stub library which
is available to platform modules.

Bug: 74275385
Test: m -j
Change-Id: I063b43431196190b59332b1bcad59f267073f89f
2018-03-30 10:12:30 +09:00
Justin Yun
05c62fc0f4 Set __ANDROID_API__ for vendor binaries to vndk version.
When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.

If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.

Bug: 74833244
Test: Build and check boot.
Change-Id: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
Merged-In: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
(cherry picked from commit 65c680e285)
2018-03-28 23:03:22 +00:00
Justin Yun
65c680e285 Set __ANDROID_API__ for vendor binaries to vndk version.
When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.

If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.

Bug: 74833244
Test: Build and check boot.
Change-Id: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
2018-03-27 08:22:11 +09:00
Elliott Hughes
1d7d1eb65e Merge "Use the platform -std= for LOCAL_SDK_VERSION targets too." 2018-02-20 15:27:54 +00:00
Elliott Hughes
adf7ef8eb9 Use the platform -std= for LOCAL_SDK_VERSION targets too.
Bug: http://b/72571399
Test: builds
Change-Id: Ifd06798a7c9af9fd316201d88b724a53bcf0bcd9
2018-02-16 17:12:21 -08:00
Chih-Hung Hsieh
7ed0db8d1d Remove core/clang/versions.mk and scan-build wrapper
* Use the definitions of ClangDefaultBase and ClangDefaultVersion
  in build/soong/cc/config/global.go.
* scan-build is too old;
  replaced by better clang-tidy's -clang-analyzer-* checks.
* WITH_STATIC_ANALYZER is still effective
  to invoke ccc-analyzer or c++-analyzer.

Test: make checkbuild
Change-Id: Ifd159dd28e529d5d3c9807f5e391911365da8cdb
2018-02-15 13:38:50 -08:00
Stephen Hines
178cf8e4d4 Remove unnecessary USE_CLANG_PLATFORM_BUILD.
This build variable is unnecessary now that GCC is completely
unsupported for Android platform builds.

Bug: http://b/64032869
Test: Builds
Change-Id: I9d44ebd7129cb2bdfbb26d37922db19c6fb9efc9
2018-01-11 14:29:23 -08:00
Dan Albert
19fbd1ce39 Remove support for stlport.
Test: make checkbuild
Bug: None
Change-Id: Iaaaecbe2608fe7a880236f3bbad0fcfcf62b5096
2018-01-05 11:49:43 -08:00
Dan Albert
94f95cf504 Remove support for gnustl.
Test: make checkbuild
Bug: None
Change-Id: Iaddd40b32f84395a76efaaa74be38770085617d5
2018-01-05 11:49:43 -08:00
Dan Albert
4297c39e75 Also restrict NDK linking by static/shared STL.
Test: make checkbuild
Bug: None
Change-Id: I0eb29ec483c069d1c12f444fd2e94cc6eb320f93
2018-01-05 11:49:43 -08:00
Dan Albert
975e303ad2 Restrict NDK link type to matching STLs.
Test: make native
Bug: None
Change-Id: Ie9d9107fe0eeb425843ae2db197e1c60d14a59ca
2018-01-04 12:51:34 -08:00
Chih-Hung Hsieh
4d31b9da8c Call clang-tidy with -fno-caret-diagnostics by default.
* clang -fno-caret-diagnostics
  suppresses warning source lines, carets, and
  the stats line of "n warnings generated"
* clang-tidy -extra-arg-before=-fno-caret-diagnotics
  only suppresses the "n warnings generated" line.
* Pass this flag and -quiet to clang-tidy when
  WITH_TIDY is not 1 or true.
* Remove redundant quotation marks around -extra-arg-before.

Bug: 69051430
Test: normal build and build with WITH_TIDY=1

Change-Id: I9021ee315edc977c15dda6ab246a00182f31fad1
2018-01-04 01:31:37 -08:00
Treehugger Robot
6663c8476a Merge "Depend on the more specific ndk timestamp." 2017-12-16 03:14:43 +00:00
Treehugger Robot
305d2abb27 Merge "Call clang-tidy with -quiet unless WITH_TIDY is set." 2017-12-16 01:53:44 +00:00
Chih-Hung Hsieh
6375b6d730 Call clang-tidy with -quiet unless WITH_TIDY is set.
* Default builds calls clang-tidy only if enabled locally.
  In this case, clang-tidy should be quiet.
* If WITH_TIDY is 1 or true, let clang-tidy emit default messages.
* Even with -quiet and all warnings are suppressed,
  clang-tidy emits one line message of the number of suppressed messages.
  This one-liner could be suppressed in future changes.

Bug: 69051430
Test: default build and build with WITH_TIDY=1
Change-Id: I3138ef45fc4372f904787bd1a391e8d88050f0b3
2017-12-15 15:41:14 -08:00
Dan Albert
3d1d1ead79 Remove support for pre-r13 NDKs.
We only have r16 checked in now.

Test: make native
Bug: None
Change-Id: I1600598cf86f803f9fdcf3fa5ada8d1871c98b65
2017-12-15 15:25:06 -08:00
Treehugger Robot
aec47c67cd Merge "Revert "Default NDK modules to libc++_shared."" 2017-12-15 21:39:29 +00:00
Dan Albert
37099686c0 Revert "Default NDK modules to libc++_shared."
This reverts commit 6168f5baf1.

Reason for revert: http://b/70718590

Change-Id: I3e7afe3d1642260c2b5103cb07c636b0b5d72379
2017-12-15 20:01:03 +00:00
Joe Onorato
bfc7811441 When compiling with the lite protobuf option, pass the option to aprotoc to force the lite runtime.
With LOCAL_PROTO_OPTIMIZE_TYPE set to one of the lite variants, the build system thinks
the proto should be compiled with lite, and will link in the line runtime libs. But if
the .proto files don't contain the directive to compile the source as lite
(option optimize_for = LITE_RUNTIME;), then the generated code will be full and the
libraries will be full, and it won't link.

Test: make
Merged-In: Ib8a135218d62fa42fa6448c49c97f7aeb2755c42
Change-Id: Ib8a135218d62fa42fa6448c49c97f7aeb2755c42
2017-12-15 08:40:48 -08:00
Dan Albert
6168f5baf1 Default NDK modules to libc++_shared.
Test: make native
Bug: None
Change-Id: I9ca2313c2082e9841a20e240ffca84219a419d49
2017-12-14 14:45:33 -08:00
Dan Albert
248b832d44 Depend on the more specific ndk timestamp.
There are now two NDK sysroot timestamp files: ndk_base which depends
on the headers and stub libraries, and ndk which depends on ndk_base
and the static libraries. For building modules that need the NDK, we
only need to depend on the base sysroot.

Test: make native
Bug: None
Change-Id: I803032eda125a632d780c9cde10f47270491d0d2
2017-12-14 13:52:04 -08:00
Colin Cross
3277ba34ae Add java modules to soong_to_convert.txt
Test: examine soong_to_convert.txt
Change-Id: Ibb6db664238a4e98f5d8885dfb3ddc0f35d11ff6
2017-12-06 15:38:52 -08:00
Chih-Hung Hsieh
ab149cbda0 No need to dump modules added -Werror.
* This reduces size of output file wall_werror.txt.
* Stop collecting $(MODULES_ADDED_WERROR)

Bug: 66996870
Test: normal build
Change-Id: Id750cc7fe6489a7654b20740d503226ec6941bbb
2017-12-04 15:23:37 -08:00
Treehugger Robot
6e4e9f32ec Merge changes from topic "system-api"
* changes:
  Fix build error
  Add LOCAL_SDK_VERSION := system_$(VER)
2017-12-01 04:19:45 +00:00
Sundong Ahn
5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Dan Willemsen
c01ad7b384 Prepare for clang+mingw windows builds
Use $(prefix)CLANG_SUPPORTED from Soong to control whether to use clang
for host builds or not. It's fairly general, but I only expect it to be
used to so that Windows builds can be switched between GCC and Clang
with a single switch.

Also separate native-host-cross from native-host so that it's easier to
build all possible windows modules.

Bug: 69933068
Test: m native-host-cross
Test: switch clang on and off, grep w64.*g++ out/build-aosp_arm.ninja
Change-Id: I205c5bc6739b72a539ece935381107ec1dd5bd48
2017-11-29 21:05:48 -08:00
Treehugger Robot
061fcfc254 Merge "Use the .cfi variant of a static library where needed." 2017-11-22 00:05:30 +00:00
Vishwath Mohan
96a130bdaf Use the .cfi variant of a static library where needed.
This CL repoints static dependencies to their .cfi variants for CFI
enabled targets. It also disables CFI for host targets because the
version of ar intended for hosts does not have plugin support (which
CFI requires).

Bug: 67507323
Test: m -j40
Change-Id: Id11afd0c8765469858f406aace2a192afff6d042
2017-11-21 14:08:20 -08:00
Chih-Hung Hsieh
1876acdd53 Add default -Wall -Werror or -Wall.
* Skip Android.bp, prebuilt, and HEADER_LIBRARIES targets.
* If neither -Wno-error nor -Werror is used, add default -Wall -Werror.
  However, if the build target is in a project
  under one of ANDROID_WARNING_ALLOWED_PROJECTS, add only -Wall.
* Dump name of modules using -Wno-error or added -Wall -Werror
  into file $(PRODUCT_OUT)/wall_werror.txt.

Bug: 66996870
Test: normal build
Change-Id: Ief8cf776e8613ed073a64dd271534688845d5c2c
2017-11-17 14:06:35 -08:00
Ryan Campbell
a435aa5171 Use space-separated coverage paths.
Specify paths to instrument with coverage using space separated lists
instead of comma separated. This makes it easier to specify the lists in
a typical format in the device mk.

Test: add COVERAGE_PATHS to device-sailfish.mk, make -j60
Bug: 67998360
Change-Id: I26c67127d72bd7a153eb4a2c23eae4881a813d54
2017-10-22 19:10:09 +00:00
Jiyong Park
a3fb1588f4 Prevent vendor libs from depending on private VNDK libraries
For module installed to /vendor partition, direct linking to the libs
marked as `vendor_available: false` is not allowed. The

Bug: 64730695
Test: Add vendor_available: false to libft2 and
libcompiler_rt. Add the two libs into LOCAL_SHARED_LIBRARIES of a vendor
lib (e.g. libdrm). Build fails with the link_type check error message.

Change-Id: Iaf23574ceddb0c087111e1d95997e9ddd60cdf87
2017-10-10 19:38:06 +09:00
Treehugger Robot
5118763940 Merge "Add -lm to the default libs for Linux & Darwin" 2017-09-27 07:08:57 +00:00
Dan Willemsen
a3a06feeed Add -lm to the default libs for Linux & Darwin
libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I6a07e12053090eb6997b79d4091c28ac9a9022de
2017-09-26 20:26:11 -07:00
Dan Willemsen
4dbb354514 Check available host libraries
Soong has a list of allowed host libraries. Check that list for make
modules as well.

Test: build/soong/build_test.bash (Linux&Darwin, aosp&internal)
Test: Add bad library in LOCAL_LDLIBS, ensure it errors
Change-Id: Icc48533487576998b049dc6c704c410172a91521
2017-09-26 00:14:01 -07:00
Colin Cross
0bd335f9b0 Make -ldl -lrt -lpthread implicit for host builds
Instead of requiring every host module to specify -ldl -lrt -lpthread
and then break the mac build because -lrt doesn't exist, make them
implicit to match the behavior of modules built for the device.

Test: m -j checkbuild
Change-Id: I7b5b5289a41cd8f6e7dc2da59400955d867ee783
2017-09-08 16:43:55 -07:00
Jiyong Park
a0f2b2a286 Merge "cxx_stl_setup is not executed for modules from soong"
am: 9b18ed094c

Change-Id: I08bfd781403ed0b7dd68de2e1045f1fa194bc8f5
2017-08-18 07:16:54 +00:00
Treehugger Robot
9b18ed094c Merge "cxx_stl_setup is not executed for modules from soong" 2017-08-18 07:11:41 +00:00
Jiyong Park
425d489cb9 cxx_stl_setup is not executed for modules from soong
cxx_stl_setup is adding libunwind_llvm to the dependency even for
modules from soong. However, since this dependency was already handled
in soong, those modules don't need to go through it again.

Bug: 64815735
Test: BOARD_VNDK_VERSION=current mma -j (under /hardware/libhardware)

Change-Id: Id6e2547c752ec831aa56a14c0bf4db0a55d51243
2017-08-18 13:46:04 +09:00
Dan Albert
21751a0a67 Merge "Use the min sdk version from soong."
am: 22b45d401a

Change-Id: I3baca77b2774eb93168f6b888f08e8f0e56a1a10
2017-08-18 02:44:33 +00:00
Dan Albert
105e4fe0a6 Use the min sdk version from soong.
Test: make checkbuild
Bug: None
Change-Id: I0306803cebf98748503b7e217db0f0f5959bf4f7
2017-08-17 16:37:49 -07:00
Yifan Hong
6dc0978c5f Merge "Vendor modules in make also have __ANDROID_VNDK__ defined."
am: 9bd6605abe

Change-Id: I7b6fc17cdd244ba6c6a266e0a0951b3a573119c5
2017-08-02 03:45:15 +00:00
Treehugger Robot
9bd6605abe Merge "Vendor modules in make also have __ANDROID_VNDK__ defined." 2017-08-02 03:39:33 +00:00
Yifan Hong
d7aa8417de Vendor modules in make also have __ANDROID_VNDK__ defined.
Bug: 64277220
Test: BOARD_VNDK_VERSION m -j
Change-Id: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8
Merged-In: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8
2017-08-01 18:54:10 -07:00
Jiyong Park
8f793af35c Merge "Don't add .vendor suffix for vendor-only modules"
am: 28989a9a22

Change-Id: I8f123f26ec3eb0c1d6607a21dfa7996284a68119
2017-07-27 00:24:42 +00:00
Jiyong Park
a9c4c71756 Don't add .vendor suffix for vendor-only modules
Soong now adds .vendor suffix only for modules having both core and
vendor variants. Furthermore, names listed in LOCAL_SHARED_LIBRARIES
are correct (= have .vendor suffix when the dependent lib has variants).
Therefore, make does not need to force add .vendor suffix when parsing
modules from soong.

Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything

Change-Id: Id8d0d01313c63496a10de4cd3ddb9f75180efef6
2017-07-27 08:54:43 +09:00
Jiyong Park
9e89245a2c Merge "Don't allow JNI headers for vendors"
am: b253e8e854

Change-Id: I6e3de31f388150301db9f0d0dd1bee3b7e39f413
2017-07-14 03:39:49 +00:00
Treehugger Robot
b253e8e854 Merge "Don't allow JNI headers for vendors" 2017-07-14 03:34:50 +00:00
Jiyong Park
b43a52d79d Don't allow JNI headers for vendors
This is already blocked in Soong. Do the same for make.

Bug: 63553556
Test: BOARD_VNDK_VERSION=current m -j libSampleAuthJNI cannot be built
Change-Id: I04a89b3f9de903a6b0384f13d5a80886344c14b4
2017-07-13 15:51:07 +09:00
Jiyong Park
240f1d5ffe Merge "fix: device_kernel_headers can't be found in the make world"
am: 1aa29599c6

Change-Id: Ic588932665fe23e7bc50ec6a751aad3449a52018
2017-07-12 20:54:23 +00:00
Jiyong Park
cb8e636ed0 fix: device_kernel_headers can't be found in the make world
Since device_kernel_headers is marked as 'vendor:true', it is exported
to the make world as device_kernel_headers.vendor. Use the correct name
with the .vendor suffix.

Bug: none
Test: BOARD_VNDK_VERSION=current m -j does not complain about
device_kernel_headers.

Change-Id: If3eaa3c5832820c914ef427668d70fa8d8d0bf97
2017-07-12 18:29:17 +09:00
Jiyong Park
be8d64294c Merge "Device-specific kernel headers are accessbile again"
am: 6f594fc662

Change-Id: Icffe772cc97a39fceb21e0a22a3776313bbefa1f
2017-07-08 03:18:56 +00:00
Jiyong Park
0c59dab590 Device-specific kernel headers are accessbile again
Device-specific kernel headers (TARGET_PROJECT_SYSTEM_INCLUDES) have
been added to the global include paths. However, since global include
paths are no longer provided when a lib is built for vendors, the
device-specific kernel headers becomes inaccessible. To solve this
problem, a pseudo header library 'device_kernel_headers' is defined
and it is added to all Android.mk defined lib/bins.

Also, in order to give this info to the soong world,
TARGET_PROJECT_SYSTEM_INCLUDES is exported as a new product config
DeviceKernelHeaders.

Bug: 62939405
Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets)
BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor
libs using vendor-specific kernel headers)

Change-Id: I3f0a2b893cc9352d6c13f3151e8834477d15c07b
2017-07-08 10:16:23 +09:00
Jiyong Park
e51b222801 Merge "Give TARGET_OUT_HEADERS to vendor modules"
am: c86c8502ac

Change-Id: I2d9ca861cbac74b6e14ee843717e41ddc855bd91
2017-07-07 22:30:08 +00:00
Jiyong Park
7f8be9f695 Give TARGET_OUT_HEADERS to vendor modules
Many vendor modules are using headers that are copied to
$(TARGET_OUT_HEADERS)/some/path via LOCAL_COPY_HEADERS. In order to let
them use the headers via #include <some/path/header.h>,
$(TARGET_OUT_HEADERS) is again added to the system include path.

Bug: 63340459
Test: BOARD_VNDK_VERSION=current m -j gives less 'cannot find header'
errors.

Change-Id: I472e74533b437653c76dc416f7f4527c0e90750d
2017-07-06 09:45:26 +09:00
Dimitry Ivanov
cd00be0767 Merge "Add libdl.so to the list of system shared libs"
am: b519d002f3

Change-Id: I2d3d5daf26b7a78d68c02cf961bf43a71f19b0bf
2017-06-29 22:17:04 +00:00
Dimitry Ivanov
cdf3927ec4 Add libdl.so to the list of system shared libs
Note that libdl is already (always) implicitly loaded
because libc.so has a dependency on it.

Also make sure that libc.so always preceding libdl.so
in dt_needed list.

Bug: http://b/62815515
Test: make
Change-Id: I94c9d676b7fa98438b452d24f6c3bbf93166c6a9
2017-06-27 16:05:13 -07:00
George Burgess IV
37f6f8181f Merge "make: add __clang_analyzer__ to clang-tidy" am: 57273013cf am: c352502062
am: 9b802e745d

Change-Id: I8432d19ee7d65e2aa4ffb99ada989a57d8bb15c8
2017-05-10 04:59:02 +00:00
Treehugger Robot
57273013cf Merge "make: add __clang_analyzer__ to clang-tidy" 2017-05-10 04:34:42 +00:00
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