Commit Graph

730 Commits

Author SHA1 Message Date
Vishwath Mohan c4cab48c26 Merge changes from topic 'revert_mutator_changes'
* changes:
  Revert "Fix ASAN mutator."
  Revert "Don't apply sanitizer mutators to host modules."
2017-08-11 14:47:17 +00:00
Treehugger Robot c5d3abf107 Merge "List of VNDK-related libs are exported to make" 2017-08-11 01:38:15 +00:00
Vishwath Mohan 952293044f Revert "Fix ASAN mutator."
This reverts commit 12758d0cec.

Change-Id: I475e63d7e56ff166c2046fc423a1729ed098ff66
2017-08-11 00:56:44 +00:00
Vishwath Mohan e615345f28 Revert "Don't apply sanitizer mutators to host modules."
This reverts commit bba1927bde.

Change-Id: Ie895d8eae5abb533468b836639e0835e7adbf8c9
2017-08-11 00:52:44 +00:00
Vishwath Mohan bba1927bde Don't apply sanitizer mutators to host modules.
This CL blocks modules intended for the host from having the bottom up
sanitizer mutator applied. We only maintain a single copy of host
binaries, so generating variants doesn't make sense
anyway. Additionally, the existing logic was causing an error with
builds not embedded in make (eg: aosp-build-tools which uses
soong_ui.bash) where the wrong variant was installed on the host. This
change should fix that.

Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Test: aosp-build-tools build breakage is fixed.
Change-Id: Ia79b4661f69ce26a7be17c4339c18ca0f397d760
2017-08-10 11:05:00 -07:00
Jiyong Park d5b18a55bb List of VNDK-related libs are exported to make
LL-NDK, VNDK-core, VNDK-SP libraries are exported to make as
SOONG_LLNDK_LIBRARIES, SOONG_VNDK_CORE_LIBRARIES, and
SOONG_VNDK_SAMEPROCESS_LIBRARIES. This can be used to auto-generate
ld.config.txt from a template.

Bug: 64013660
Test: BOARD_VNDK_VERSION=current m -j successful
Test: check out/soong/make_vars*.mk and look for SOONG_*_LIBRARIES

Merged-In: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
Change-Id: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
2017-08-10 14:15:39 +09:00
Vishwath Mohan 46c6a171aa Merge "Fix ASAN mutator." 2017-08-10 02:42:31 +00:00
Vishwath Mohan 12758d0cec Fix ASAN mutator.
This CL fixes a bug in the ASAN top down mutator which was incorrectly
checking (and setting) SanitizeDep to true only for the parent module
and not for the visited child modules.

Fixing this also requires some changes to the variant creation logic
to ensure that the correct variant is passed to make for
installation. This will eventually be replaced by logic that appends
an appropriate suffix to sanitized libraries (eg: libc++.asan), which
will allow both variants to be passed to make.

Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Change-Id: Id5e5a5946192adf07418dd433bca503047177007
2017-08-09 16:58:36 -07:00
Colin Cross 8d6aed7ed7 Merge "Copy prebuilt binaries" 2017-08-09 02:50:54 +00:00
Colin Cross 94921e78df Copy prebuilt binaries
The final name of the prebuilt binary is going to match the basename
of the return value of link(), so copy the binary to the intermediates
directory to a file name that honors the name and stem properties of
the module.

Test: manual
Change-Id: Ieed4df79b11382924ca0be8e940d3279b45f748a
2017-08-08 16:23:32 -07:00
Jayant Chowdhary 2a96640335 Allow vndk library dependecies to dump abi again.
As a part of the fix for bug 38304436, the condition for dumping abi for
a source file was reduced to : if the source file belongs to a library
belonging the vndk or the llndk, dump the abi. This needs to be changed back to:
if the source file comes through a dependency of a vndk library (static,
whole static or source), whether or not the dependency may be vndk-enabled, dump
the abi.

Test: mm -j64 in external/libcxx.
Without the change, libc++ does not produce any abi dump, since it
depends on whole static libraries not marked vndk enabled. After the
change, libc++ has an abi dump combining abi exposed by whole static,
static and source dependencies.

Bug: 38304436

Change-Id: Ida3dceeca11342756191f316bee74ea08bcdd984
2017-08-08 18:06:09 +00:00
Dan Albert 31384debd7 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.

To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.

Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
2017-08-02 17:14:10 -07:00
Treehugger Robot bbe3ff4c50 Merge changes from topic 'ndk-weak-stubs'
* changes:
  Add NDK API codenames for old releases.
  Add support for weak symbols in the NDK stubs.
2017-08-01 23:11:12 +00:00
Treehugger Robot ed2c78ef4e Merge "Add support for Exynos-M1" 2017-08-01 01:00:37 +00:00
Dan Albert f55f0787a7 Add support for weak symbols in the NDK stubs.
Test: nose2
Bug: None
Change-Id: I202f718103f4a645b1eb83c0a9f5313bcdb4d485
2017-07-28 11:00:22 -07:00
Treehugger Robot 9ccbabc1ea Merge "Map cpp_std c++17/gnu++17 to 1z." 2017-07-27 00:20:16 +00:00
Jiyong Park 27b188bc86 .vendor suffix is added only for libs having core/vendor variants
When the lib is vendor-only, then .vendor suffix is not added.
Furthermore, this change correctly adds .vendor suffix even to the names
listed in LOCAL_SHARED_LIBRARIES so that we don't need to add the suffix
in the make world.

This also allows us to use the original name (without the .vendor
suffix) of the vendor-only modules in make (e.g. in PRODUCT_PACKAGES or
as a make target).

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: I203e546ff941878a40c5e7cfbb9f70b617df272d
2017-07-27 08:54:52 +09:00
Josh Gao f5720175dd Map cpp_std c++17/gnu++17 to 1z.
C++17 is basically done, but not rubber stamped yet. Rewrite c++17 and
gnu++17 to their 1z equivalents until this happens, and we get a
version of clang that allows it.

Test: mma in a project with cpp_std c++17
Change-Id: I1626c366c3a9b47c997cc27dc9c5205201ebbdf5
2017-07-26 15:13:50 -07:00
Justin Yun 4b2382f78e Allow 'vndk' tag in cc_defaults
'vndk' tag must be parsed in cc_defaults as well.

Test: build with a module that has 'vndk' tag in cc_defaults.
Change-Id: I21a5a831dbf8cae00be98c00f4bb98504da53c8d
2017-07-26 07:24:29 +00:00
Colin Cross adc0e17019 Merge "Enable ubsan check flag in build" 2017-07-25 17:48:06 +00:00
Junmo Park 8ea4959279 Add support for Exynos-M1
Change-Id: Ie57507a5d0ea9101db603ff3538c51853083a314
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-24 07:14:55 +09:00
Treehugger Robot 99cd671ac3 Merge changes I646f303b,I294ca692
* changes:
  Add support for Exynos-M2.
  Override mcpu option of ToolingCFlags when mcpu is eyxnos-m2.
2017-07-22 02:08:18 +00:00
Junmo Park d86c902470 Add support for Exynos-M2.
Change-Id: I646f303b460556a9b36a44574f25dd992d42906c
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-22 09:16:31 +09:00
Junmo Park ccbd62e050 Override mcpu option of ToolingCFlags when mcpu is eyxnos-m2.
sAbiDumper uses one year old clang which does not support
recent mcpu options like exynos-m2.
So, we set mcpu=cortex-a53 for ToolingCFlags.

Change-Id: I294ca692181fd2cbc6ba5efb1e4e2d2d605b7a85
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-22 09:16:02 +09:00
liuchao c5996de4ce Enable ubsan check flag in build
Ubsan is currently support ARM/ARM64,
so It's OK to enable the build Flag

Test: build test module with flags in Android.bp:
      sanitize: {
          all_undefined: true,
          diag: {
              undefined: true,
          },
      },
BUG:38250996
Change-Id: I37a01b4610132f58315e68335b3c3cdfb148357d
2017-07-21 02:31:37 +00:00
Colin Cross 245ced74fe Allow arch-specific stl selection
Test: m -j checkbuild
Change-Id: Ic55433e39b2a0108efcfe980503265ac139b22e2
2017-07-20 16:59:26 -07:00
Colin Cross 1f44a3aa4f Don't pass same argument twice for defaults modules initialization
InitDefaultsModule and InitDefaultableModule were requiring the
module to be passed in as an argument twice, once as a
android.Module and once as an android.DefaultableMOdule.  Use
a type assertion instead.

Test: builds
Change-Id: I57d721e68a4f016e02c17a678af5f2ba25a9a430
2017-07-19 23:14:36 +00:00
Treehugger Robot cad076b16b Merge "Add to cflags in compilerFlags()" 2017-07-19 21:36:33 +00:00
George Burgess IV f5310e3f88 Add to cflags in compilerFlags()
These compiler flags weren't being properly added to ToolingCFlags,
which was causing clang-tidy to complain a lot about incompatible
redeclarations of library functions. Moving them to compilerFlags()
causes them to be added to ToolingCFlags.

Bug: None
Test: mma in bionic/. clang-tidy now shows 7,142 fewer high-severity
warnings.

Change-Id: If5148858d9db143a3dd9b0ce6c970258ec4ff9cb
2017-07-19 11:53:54 -07:00
Treehugger Robot 57b314daba Merge "Install VNDK libs in /system instead of /vendor" 2017-07-19 02:51:16 +00:00
Treehugger Robot 3c8ba15bdd Merge "Move default libnativehelper include to mock dir." 2017-07-19 01:33:50 +00:00
Steven Moreland 3cf6306f96 Move default libnativehelper include to mock dir.
Also export the corresponding variable to make.

libnativehelper's include_deprecated contains all of the
headers that are currently used by libraries without
the "nativehelper/" prefix.

The current count of this is this:
      2 ScopedLocalFrame.h
      4 JniInvocation.h
      4 ScopedBytes.h
      5 AsynchronousCloseMonitor.h
      6 toStringArray.h
      7 ScopedStringChars.h
     38 JniConstants.h
     41 ScopedPrimitiveArray.h
     79 ScopedUtfChars.h
     80 UniquePtr.h
    100 ScopedLocalRef.h
    467 JNIHelp.h

Now we can remove each file from the global header include
on a file by file basis.

Bug: 63762847
Test: libs find their headers

Change-Id: Iffc0c1ceb55cc59dc4a70c75d7c0b9ce8397b2cf
2017-07-18 14:44:33 -07:00
Ivan Lozano 5f59553bca Allow integer_overflow sanitizer path exclusion.
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side
of the change.

Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.

Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
2017-07-18 13:38:20 -07:00
Justin Yun 8effde47de Install VNDK libs in /system instead of /vendor
If BOARD_VNDK_VERSION is set, and a module is set to
`vendor_available: true` it is installed in /system and /vendor.

However, if the module is a VNDK library, it must be
installed at `/system/${LIB}/vndk` instead of /vendor/${LIB}.
For those modules, need following to set.

vendor_available: true,
vndk: {
    enabled: true,
    support_system_process: true,
},

`support_system_process` is optional to define.
If it is defined to true, the module is regarded as vndk-sp.

link-type check for VNDK modules is added to make sure that VNDK
modules only link to other VNDK shared libraries or LL-NDKs.

move the ABI checks to VNDK from all of vendor_available.

Bug: 38304436
Test: attempt to compile with BOARD_VNDK_VERSION:=current
Test: Use `vendor_available_vndk: true` for VNDK modules and compile
      with BOARD_VNDK_VERSION:=current
Change-Id: I409268e0b7f05a9d01697bf9f9f4726b5aac631f
2017-07-18 14:48:29 +09:00
Colin Cross da4a7257b5 Merge "Add support for data field in cc_benchmark." 2017-07-18 02:37:03 +00:00
Anders Lewis b97e818201 Add support for data field in cc_benchmark.
Test: mm -j at source root; Run on blueprint with data in cc_benchmark.
Change-Id: I6647fe95c96a6df27a54633f6a520a032487ca97
2017-07-17 14:42:58 -07:00
Colin Cross cec8171420 Add integration testing infrastructure
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.

Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
    config := android.TestConfig(buildDir)
    ctx := android.NewTestContext()
    ctx.RegisterModuleType(...)
    ctx.MockFileSystem(...)
    ctx.ParseBlueprintsFile("Android.bp")
    ctx.PrepareBuildActions(config)
    ctx.Register()
    // Get the Inputs value passed to the javac rule for the foo module
    inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs

Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
2017-07-14 14:19:51 -07:00
Dan Willemsen fd7310d95a Fix kernel_headers module registration
This was breaking SANITIZE_TARGET (and likely others)

Test: SANITIZE_TARGET=address m -j nothing
Test: out/soong/build.ninja is identical before/after
Test: out/soong/Android-aosp_arm64.mk is identical before/after
Change-Id: Ic0d6774025761ec9ae9240c109895ab8032e4784
2017-07-10 12:30:35 -07:00
Jiyong Park d773eb3e86 add device_kernel_headers module for vendor-specific kernel headers
device_kernel_headers is a built-in heder-only lib that provides device-specific
kernel headers. The header path is configured via a new product variable
SystemIncludeDirs, which is currently the mirror of
TARGET_PROJECT_SYSTEM_INCLUDES in the make world.

Note: generic kernel headers (bionic/libc/kernel) have been added to the
include path by default. "device_kernel_headers" module is for device-specific
kernel headers such as /device/*/*/kernel-headers.

Note 2: this is opt-in for Android.bp modules (i.e. header_libs :
["device_kernel_headers"] required.) while it is always provided to
Android.mk modules.

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: I81c60abc13942c89fff723d1544b27a81b300db0
2017-07-08 09:29:04 +09:00
Ivan Lozano 0c3a1efae4 Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Soong side of the build option.

An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.

A default sanitizer blacklist is added to avoid applying sanitization
to functions that are likely to exhibit benign overflows.

Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.

Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
2017-07-07 09:52:23 -07:00
Jiyong Park 4c35af09ea fix: a vendor variant of a lib doesn't re-export llndk headers
If a vendor (or vendor_available) lib has a dependency to a llndk
library, the name of the llndk library is modified to <name>.llndk.

There was a bug that this name modification is done only for shared_libs
property, but not for export_shared_lib_headers property. As a result,
the headers of the llndk was not re-exported. Fix the bug by modifying
export_shared_lib_headers property as well.

Bug: 63178444
Test: build
Test: look into out/soong/Android-<target>.mk. libutils.vendor has
system/core/liblog/include_vndk in its LOCAL_EXPORT_CFLAGS.

Change-Id: I6fcb1036cdb81ba167ead815b436a5cada283ede
2017-07-05 22:44:09 +00:00
Colin Cross 36242850fd Refactor factories
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.

Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
2017-06-30 21:08:36 +00:00
Treehugger Robot 4817389148 Merge "Add header-abi-linker dependency on so file." 2017-06-30 17:38:53 +00:00
Dan Austin 8241abba87 Update coverage sanitizer flags in soong
Update the coverage sanitizer flags in soong to use the new
flavor of coverage sanitization.

Bug: 63108942

Test: Fuzzer runs with coverage guards.
Change-Id: I2e817a5282cf7dab49aee6985743defd4fb74628
2017-06-29 08:55:13 -07:00
Lazar Trsic 397866653e Revert "[mips] Disable compact branch generation"
With the latest Clang we do not have issue with beqc instruction,
so allow generation of compact branches for mips.

This reverts commit 3d6a38d601.

Change-Id: I6dbb5d1fce08bd714cc9a0318d50de5765cff038
2017-06-28 11:22:58 +02:00
Dimitry Ivanov ba6b55240b 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.

This change also makes sure that libc.so always goes before
libdl.so in DT_NEEDED list.

Bug: http://b/62815515
Test: make
Change-Id: Idb231f8a8443ee859828bac6462236a1b7199d05
2017-06-27 16:08:03 -07:00
Jayant Chowdhary 6ab3d846b2 Add header-abi-linker dependency on so file.
Whenever a symbol file is not available, header-abi-linker can look at
the symbols with STV_DEFAULT or STV_PROTECTED visibility for further abi
filtering.

Bug: 62463617

Bug: 62307940

Test: make -j64

Change-Id: I5dc618be104a49d47375d37cf78c4490b1529987
2017-06-27 11:19:10 -07:00
Jiyong Park 44cf1a7779 add exclude_shared_libs for vendor_available:true libs
Adding a mechanism to conditionally exclude some shared library
dependencies when a lib is built for vendors.

Without this, some libraries cannot be earily marked as vendor_available
if they are depending on shared libs can shouldn't be marked as
vendor_available.

By using exclude_shared_libs with exclude_srcs (or __ANDROID_VNDK__
macro), we can eliminate the unnecessary dependency for vendors.

Bug: 62471389
Test: build

Change-Id: If94277b45c3769223cea371d0028e75277640356
2017-06-21 10:13:27 +09:00
Jayant Chowdhary 9677e8c6ad Black-list for clang LibTooling Cflags.
Add a list of flags which are not understood by clang LibTooling tools
and filter them out of the Cflags the tools are invoked with.

Test: In frameworks/av, make libmedia vendor_available (this invokes
header-abi-dumper on this module), mm -j64.

Bug: 62447349

Change-Id: I46f017212b89f4331145c999103d0ed44da0abaf
2017-06-19 19:43:03 -07:00
Ivan Lozano f47b048782 Merge "Add support for misc_undefined diagnostics" 2017-06-19 20:16:48 +00:00
Ivan Lozano 651275ba90 Add support for misc_undefined diagnostics
Setting Sanitize.Diag.Undefined to true does not enable diagnostics for
all possible UBSan sanitizers that might be declared in Sanitize.Misc_undefined
(specifically unsigned-integer-overflow and nullability-*). This adds an
equivalent Sanitize.Diag.Misc_undefined string array to allow diagnostics to
be enabled in these sanitizers.

Bug: 62546512
Test: make works and device boots.
Test: Tested an Android.bp generated binary with the new field enabling
unsigned-integer-overflow diagnostics.

Change-Id: I9aa7cb2555ab4f94ae1aa290715a617718d936ff
2017-06-19 10:11:56 -07:00
Dan Albert 15be0c6a36 Require that NDK symbol files end with .map.txt.
We're making an NDK API Council +1 a requirment for changes to these
files, so we need to know that all symbol files will match a given
file pattern.

Test: Changed a symbol file to foo.txt, `make ndk` failed
Test: make ndk
Bug: http://b/35870541
Change-Id: I29690fb97746ad682e57845fea3f1114cfd77598
2017-06-13 15:14:56 -07:00
Evgenii Stepanov c6482d69c2 Don't add -lrt on Darwin for sanitized targets.
Bug: 34719251

Change-Id: Iff81c4d891a2341a8152e5603391b55b0222ebd7
2017-06-07 16:19:17 -07:00
Evgenii Stepanov 76cee23144 Fix -fsanitize=integer not passed for soong builds.
Also filter out -Wl,--no-undefined for all host sanitizers, not just ASan.
UBSan on host defaults to no-trap (i.e. diagnostic mode), and that requires
the runtime library and runs into the same problem with undefined symbols as ASan.

Bug: 34719251
Test: Misc_undefined: ["integer"] on a soong target
Change-Id: I1fb4781f663a11f5f427d50c0bf9beb8e181cd5e
Merged-In: I1fb4781f663a11f5f427d50c0bf9beb8e181cd5e
(cherry picked from commit fe9bc1dccb)
2017-06-07 11:01:02 -07:00
Yi Kong dadff1b8d2 Switch to clang-4053586
Bug: 37423073
Test: Build on multiple devices
Change-Id: I4d1b328129faac28e3b38c3c7640f8c91a3f8ff2
2017-06-04 12:02:08 -07:00
Leo Li e748f5d912 Export clang default settings.
Test: Refactor no tests.

Change-Id: Ib920962e8a42ef67c4eb1517e9274ff1120d15a0
(cherry picked from commit 8756b37432)
2017-06-03 22:44:18 +00:00
Elliott Hughes 5800668001 Merge "Add bionic's scsi headers to the include path." 2017-05-26 18:04:28 +00:00
Elliott Hughes 98418a0e33 Add bionic's scsi headers to the include path.
Bug: N/A (hit while upgrading strace to 4.17)
Test: builds
Change-Id: Ia98daf9563a788588827d43c17573896e4ec6f5a
2017-05-25 17:16:10 -07:00
Jayant Chowdhary 715cac3971 Optimizations to abi checking.
We now add export_static_lib_headers, export_generated_headers to the
filters while dumping the abi of a library using header-abi-dumper
(through -I<dir> additions to the invocation of header-abi-dumper and
header-abi-linker)

Also add support for zipped reference source based abi dumps.

Test: mm -j64 in hardware/interfaces/nfc/default/1.0 produces
android.hardware.nfc@1.0.so.lsdump with abi filtered out using generated
headers.

Test: Copied the linked abi dumps produced by mm -j64 in bionic/libc to
prebuilts/abi-dumps/ndk and gzipped them. Ran mm -j64 again in
bionic/libc and verified header-abi-diff getting invoked.

Bug: 32750600

Change-Id: I26210af908c87a6143e39fa25f50307acb68a387
2017-05-25 14:46:58 -07:00
Dan Willemsen 58a5c8b206 Export cc_benchmark as NATIVE_TESTS to Make
This fixes some warnings on internal master where the compatibility
suite logic didn't look at EXECUTABLES (it was checking for
LOCAL_MODULE_CLASS == NATIVE_BENCHMARK, which doesn't exist).

Test: Compare out/soong/Android-aosp_arm64.mk
Test: Compare out/build-aosp_arm64.ninja
Change-Id: Ibe3c40e81e26f4c4cb9fd5bea1619b94181764fb
2017-05-23 15:55:12 -07:00
Jayant Chowdhary 9156330ded Merge "Add arch, lib name to header-abi-diff invocation." 2017-05-22 23:47:15 +00:00
Treehugger Robot 6b8eb63fc2 Merge "Fix mips32r2-fp-xburst build" 2017-05-22 22:54:11 +00:00
Jayant Chowdhary f54e0a79e2 Add arch, lib name to header-abi-diff invocation.
Test: mm -j64 in platform/bionic, platform/system/core/liblog.

Bug: 38325544

Change-Id: Ia2098c1facf2999ef51d55212acc1317e2bf98c1
2017-05-22 10:54:23 -07:00
Treehugger Robot 454fcd429d Merge "Make factory functions in cc/prebuilt.go public. Test: refactoring CL." 2017-05-18 18:58:33 +00:00
Christopher Ferris 10559e4648 Merge "soong: use optimal FPU on Cortex-A15" 2017-05-17 23:33:57 +00:00
Leo Li 74f7b97d3f Make factory functions in cc/prebuilt.go public.
Test: refactoring CL.

Change-Id: Icf4628df082d2b5a41a9108f85cb73dab42839ab
2017-05-17 16:33:20 -07:00
Treehugger Robot d17602b76c Merge "Dedup exported flags from dependencies" 2017-05-17 22:52:44 +00:00
Colin Cross dd84e056ed Dedup exported flags from dependencies
Soong command lines have gotten very long due to hidl modules
reexporting lots of libraries.  Dedup the include dir flags.

Test: m -j checkbuild
Change-Id: I6ada1251012da42344e2c00ae66001a649023d2c
2017-05-17 14:22:22 -07:00
Jake Weinstein 5916657a96 soong: use optimal FPU on Cortex-A15
* Cortex-A15 supports VFPv4 instructions

Test: make otapackage
Test: Built angler with 32 bit variant set to cortex-a15.
Test: Boot this version of the angler, ran bionic unit tests.
Change-Id: I94f00c9486ece201aa2c230308b9f90b0209dc4a
2017-05-17 14:11:33 -07:00
Treehugger Robot 04b830f133 Merge "Revert "Revert "Ensure environment dependencies are correct""" 2017-05-16 00:25:09 +00:00
Treehugger Robot bdb02bd334 Merge "Clarify paths.go somewhat" 2017-05-16 00:20:29 +00:00
Dan Willemsen 6606872bf6 Revert "Revert "Ensure environment dependencies are correct""
This reverts commit 4068a5db6c.

Now the Mac xcode-select and xcrun goes through Config.HostSystemTool,
which will grab $PATH through Config.Getenv

Test: m -j (on mac)
Change-Id: I2632c4fdb2ec961e59944cf02ff165e0fd3c869d
2017-05-15 15:22:45 -07:00
Christopher Ferris 6df46f5d93 Add cortex-a73 support.
Also, update flags for cortex-a53.

Bug: 37647380

Test: Built target with cortex-a73 for both 32 bit/64 bit.
Test: Built target with cortex-a53.cortex-a57 for both 32 bit/64 bit.
Test: Ran bionic unit tests, ran art target tests.

(cherry picked from commit 1d9aa26d44)

Change-Id: I3325f60add7f424f8cca53c22919fc481ef5e787
2017-05-15 12:44:58 -07:00
Jeff Gaston 734e3809ad Clarify paths.go somewhat
Bug: 35562758
Test: make

Change-Id: I4cf05ffdd0962186f490467829e3576b4e269c47
2017-05-15 11:31:48 -07:00
Colin Cross 67a5c132c5 Prettify soong ninja build descriptions
Descriptions currently look like:
[  0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o

This is not very helpful - most of the characters are used to show the
output path, which contains useful information like target architecture,
but also contains most of the path to the source files twice, and less
useful information like the exact variant name used by soong.
Make the descriptions look like:
[  0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp

This is //path/to/module:modulename tool relative/path/to/source/file

Test: builds, looks pretty
Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
2017-05-10 11:04:16 -07:00
Colin Cross 570e18ffaa Merge changes If90975c8,I2a873fc6
* changes:
  Use ctx.ModuleBuild for darwin ar
  Run gofmt
2017-05-10 17:28:21 +00:00
Treehugger Robot f2a9a3c582 Merge "soong: add __clang_analyzer__ to clang-tidy" 2017-05-10 04:34:42 +00:00
Jayant Chowdhary 6e8115acb1 Work-around for crt objects with sdk: current
Test: convert libcups from Android.mk->Android.bp, mm -j64.

Change-Id: I4fddcfa5806d0ce27a229c37a078b0d93e9082a8
2017-05-09 14:38:10 -07:00
Colin Cross 5b52959c99 Use ctx.ModuleBuild for darwin ar
Test: builds
Change-Id: If90975c8545158012bc6201acadd136363c21260
2017-05-09 14:32:45 -07:00
Colin Cross 51d4ab2d5e Run gofmt
Test: builds
Change-Id: I2a873fc65cf414a14d6b58ef4ed6b9f5e57d75f7
2017-05-09 13:44:49 -07:00
Andreas Gampe 9707116867 Soong: Change Sanitize.Recover order
Add Sanitize.Order cflags after the general sanitizer options, so
it can override the global -fno-sanitize-recover=all.

Bug: 38128476
Test: m SANITIZE_HOST=address
Test: manual test
Change-Id: Ied5600507b66bd25d9d2a8bba428162ed4eb01e4
2017-05-08 23:37:51 +00:00
Colin Cross 8ff9ef4c30 Declare dependency on sanitizer runtime libraries
Moving the last users of a sanitizer runtime library to soong was
causing the runtime library to stop getting installed.  Declare
the dependency so make keeps installing it.

Test: builds
Change-Id: Ieeb9ad5c04ac8df0d1a74239da393dac5cab2b03
2017-05-08 15:57:05 -07:00
Treehugger Robot 6d9d964eb7 Merge changes I7270fef0,Ie8fba06c
* changes:
  Automatically add frameworks/rs includes to modules with .rs files
  androidmk: support cfi, diag, and misc_undefined properties
2017-05-08 19:54:40 +00:00
Colin Cross 2101f4aa06 Automatically add frameworks/rs includes to modules with .rs files
C++ sources generated from .rs files need includes in
frameworks/rs and frameworks/rs/cpp.  Add them automatically
instead of requiring modules to add them manually.

Test: builds
Change-Id: I7270fef0b36c1956475d6d83ab8aa2e3c362e688
2017-05-08 19:37:12 +00:00
Goran Jakovljevic 31e9947020 Fix mips32r2-fp-xburst build
Remove -Wa,-mmxu option because clang doesn't support it.

Test: successful build of mips32r2-fp-xburst arch variant
Change-Id: I0c3da5dee0bb3acb44e75991b4763b061acc86e1
2017-05-08 10:08:40 +02:00
Dan Willemsen 95f4dbb330 Ignore disabled modules when generating ndk sysroot
When linux_bionic is turned on, there are two host modules for the
preprocessed ndk headers, but only one is enabled. So exit early for the
disabled one.

Bug: 31559095
Test: Diff out/soong/build.ninja before/after, no change.
Test: Turn on linux_bionic, no longer see a panic.
Change-Id: I204a884a83ccf21c96088e97c19a0cffe029ec99
2017-05-05 23:26:01 -07:00
Colin Cross 03cc1b6d97 Use -isystem to export ndk stl includes
Hides:
In file included from frameworks/rs/cpu_ref/rsCpuExecutable.cpp:4:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/fstream:169:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ostream:138:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ios:216:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/__locale:21:
prebuilts/ndk/current/sources/android/support/include/locale.h:97:9: error: 'LC_GLOBAL_LOCALE' macro redefined [-Werror,-Wmacro-redefined]
       ^
out-soong/ndk/sysroot/usr/include/locale.h:115:9: note: previous definition is here
       ^

Test: builds
Change-Id: I766e8645db33e6e71f44a131aa0b1649d83e8c51
2017-05-05 18:22:30 -07:00
Colin Cross 2a252bef50 Support .rs and .fs files in cc_* module srcs lists
Translate .rs and .fs files to .cpp files using llvm-rs-cc.

Test: builds
Change-Id: I242cea0d09c9985730a512cec7705c3f1479f4ed
2017-05-05 18:22:30 -07:00
Josh Gao 06ec87082f Merge "Globally enable libcxx's thread safety annotations." 2017-05-04 23:47:32 +00:00
Colin Cross 37a2aeb95a Merge "Remove -isystem frameworks/av/include" 2017-05-04 04:09:43 +00:00
George Burgess IV 561a3fe4af soong: 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: I460ff410640524633c0a60b71d34927d17e1ed98
2017-05-04 01:19:02 +00:00
Colin Cross 307d145ed5 Remove -isystem frameworks/av/include
Remove the last -isystem for global include directory (besides
bionic).

Bug: 31751828
Test: builds
Change-Id: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
Merged-In: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
(cherry picked from commit d13a457a45)
2017-05-03 23:56:47 +00:00
Colin Cross bbc9f4d586 Export proto deps from reused libraries too
The deps have to be exported alongside the headers to make sure
the headers are in place when a module that depends on the shared
library builds.

Bug: 37555583
Test: use protos in a cc_library
Change-Id: I8f5b8d7937868458c1cf02b990a348aa395634da
2017-05-03 16:39:31 -07:00
Colin Cross 10d2231d44 Check reused source files in hasSrcExt
hasSrcExt is used to determine extra flags and dependencies when
generated files are used.  If the generated files are being handled
in a static library whose objects are reused in a shared library,
the flags and dependencies still need to apply.  Instead of clearing
the source files in the shared library, move them to an OriginalSrcs
property, and check that in hasSrcExt along with the Srcs property.

Also pass extra exported include directories from the static
library to the shared library.

Bug: 37555583
Test: use protos in a cc_library
Change-Id: I709779ec03b66b220b7bd58a1f6f0b9b5067d955
2017-05-03 12:28:27 -07:00
Colin Cross 5ff51b5caa Update protoc support for libplatformprotos
Allow properties to be overriden by arch variants.
Add include_dirs and local_include_dirs properties.
Pass -I . to fix:
   frameworks/base/proto/src/metrics_constants.proto: File does not
   reside within any path specified using --proto_path (or -I).  You
   must specify a --proto_path which encompasses this file.  Note that
   the proto_path must be an exact prefix of the .proto file names --
   protoc is too dumb to figure out when two paths (e.g. absolute and
   relative) are equivalent (it's harder than you think).

Test: m -j libplatformprotos
Change-Id: I3e02621ca25bfa7ca0a0e3b83377d70dd352668f
2017-05-02 14:08:29 -07:00
Colin Cross f34d9d11d4 Merge "Add msa mips features" 2017-05-02 17:49:21 +00:00
Colin Cross 432c2860a0 Add msa mips features
References to an MSA architecture feature were added in
I3cadc29434dbd5fdb3aa780198414e90f9572ec5, but never added
to the build system.

Test: builds
Change-Id: I178813824a21475e013f7e8209d9473466ab821c
2017-05-01 16:43:41 -07:00
Treehugger Robot f5464ba31a Merge changes Ic32cfb3e,I282be134
* changes:
  Add support for named versions in NDK map files.
  Generate stub libraries for unreleased API levels.
2017-04-30 21:31:24 +00:00
Dan Albert 3f6fb2db5f Add support for named versions in NDK map files.
Test: nose2
Test: make checkbuild
Bug: None
Change-Id: Ic32cfb3e0db767f695b617c787733a6ef75030aa
2017-04-28 16:11:13 -07:00
Dan Albert 49927d29d5 Generate stub libraries for unreleased API levels.
Generating released API levels and android-current is not sufficient
in a trunk-stable world. One branch will have the stable APIs and
possibly multiple unreleased API levels. We need to generate stubs
for each unreleased API level up to our current target.

I still need to add support for things like `# introduced=O` before
this is really done.

Whether or not we still need something like "current" that would map
to the absolute latest even it hasn't been assigned a code name yet
is uncertain.

Test: make ndk
Bug: None
Change-Id: I282be1347ab39c56fa887d4d71c03bb12c300dc5
2017-04-28 16:11:13 -07:00