Commit Graph

2445 Commits

Author SHA1 Message Date
Dan Albert 6303423549 Merge "Remove asanLibs." 2019-07-22 18:05:10 +00:00
Roland Levillain 525d8dec66 Merge "Handle `test_per_src` test variations as dependencies of APEX modules." 2019-07-22 09:38:53 +00:00
Roland Levillain 0934737003 Merge "Create an extra variation in `test_per_src` mutator collecting all outputs." 2019-07-22 09:37:31 +00:00
Dan Albert 55a18ba71a Remove asanLibs.
We already link the shared prebuilt from the toolchain. This is
redundant and the wrong version.

Test: make checkbuild
Bug: http://b/74067984
Change-Id: I4b5d23514158eebfb4eea2aa6761e076131c3224
2019-07-19 12:53:27 -07:00
Paul Duffin 60c0cd9a5f Merge "Add header_libs to cc_object" 2019-07-19 18:13:44 +00:00
Roland Levillain 9b5fde9ca4 Handle `test_per_src` test variations as dependencies of APEX modules.
If a test module with a `test_per_src` property set to `true` is
included in an APEX module, add all the variants for mutator
`test_per_src` as dependencies of the APEX module (not just the
first one).

This is done by adding variation "" of mutator `test_per_src` when
adding a test dependency to an APEX module, which creates an indirect
dependency of the APEX module on all the `test_per_src` variants of
the test module. When generating outputs for the APEX bundle, fetch
and include the set of test outputs from the "" variant.

Test: m (`apex/apex_test.go` amended)
Bug: 129534335
Change-Id: I1c99855971a8a9b2fc5b964a420e882b6791d4e6
2019-07-19 14:15:06 +01:00
Roland Levillain f2fad97158 Create an extra variation in `test_per_src` mutator collecting all outputs.
Have `cc.testPerSrcMutator` create an additional variation named "",
having no sources (and generating no output file), but depending on
all other `test_per_src` variations and collecting their output files
in a new field named `cc.Module.testPerSrcOutputFiles`. This is useful
in the case where a module depends on all the `test_per_src`
variations of a test module.

Test: m
Bug: 129534335
Change-Id: I905decc0b9417f47cee9113466677d3bb61ad7b6
2019-07-19 14:15:06 +01:00
Treehugger Robot b1469d53e7 Merge changes from topic "docs_circular_dep"
* changes:
  aidl include paths are exported to droiddoc
  filegroup.path is used to specify the include path for aidl files
2019-07-19 11:28:16 +00:00
Jiyong Park 2907459e43 filegroup.path is used to specify the include path for aidl files
filegroup {
    name: "foo",
    srcs: ["srcs/aidl/com/android/**/*.aidl"],
    path: "srcs/aidl",
}

cc_library { // or java_library, etc.
    name: "bar",
    srcs: [":foo"],
}

automatically adds "-Ipath/to/foo/srcs/aidl" when compiling the aidl
files from foo for bar. This allows us to omit aidl include path
when using sources in other places via file group.

Bug: 135922046
Test: m (unit tests added)
Change-Id: I9b42f316f2858fb6da72c2f58a314f391416e809
2019-07-19 11:31:31 +09:00
Colin Cross eec9b286b0 Disable cc_fuzz darwin host modules
The fuzzer runtime is not present for darwin host modules, disable
cc_fuzz modules when targeting darwin.

Test: m on darwin
Change-Id: I9da319e00e36c3e0a5912329de7890a6409f1a55
2019-07-18 16:23:45 -07:00
Treehugger Robot 178f8fb732 Merge "Add the cc_fuzz target." 2019-07-18 20:38:33 +00:00
Christopher Ferris cc9a246063 Merge "Add liblog as shared dependency for isolated tests." 2019-07-18 19:00:46 +00:00
Paul Duffin a37832a3c3 Add header_libs to cc_object
Needed to allow removal of the include_dirs property from the
asm_defines.s module. Also, adds ObjectLinkerProperties to cc_defaults
so that default settings of header_libs are correctly prepended to the
properties in cc_object.

Bug: 35624006
Test: m cpp-define-generator-asm-support - compare output before and after change
Change-Id: Ib95d79c5eba4a89b7ab04b6c62090b720ec7e9fe
2019-07-18 15:58:58 +01:00
Jeffrey Vander Stoep 38aaf75e44 Merge "Renderscript: rename .rs extension to .rscript" 2019-07-18 02:02:00 +00:00
Christopher Ferris 34cbba6e16 Add liblog as shared dependency for isolated tests.
If liblog is a static library, then unit tests cannot properly
override log functions.

Test: Build isolated tests and run them.
Change-Id: Id202c5950518408ce66ceea70988dde8080fd1f9
2019-07-17 15:46:29 -07:00
Jeff Vander Stoep d612627169 Renderscript: rename .rs extension to .rscript
Reserve .rs extension for Rust.

Bug: 137365032
Test: make checkbuild
Test: cd frameworks/compile/slang/tests
    ./slang_tests.py
    Test: atest CtsRenderscriptTestCases
    Test: CtsRsCppTestCases

Change-Id: I0458009b8bb64a012fece364835d5b78d52e15e9
Merged-In: I0458009b8bb64a012fece364835d5b78d52e15e9
2019-07-17 18:57:32 +00:00
Colin Cross 223e6a65b6 Merge changes from topic "buildnumberfromfile"
* changes:
  Allow jar wrapper to take quoted arguments
  Add rspfile support to RuleBuilder
  Prepare droiddoc for using RuleBuilder
  Manually escape BuildNumberFromFile
  Fix android.Expand and ninja escaping
  Add RuleBuilder helper functions for built and prebuilt tools
  Add documentation to droiddoc.go module types
2019-07-17 02:45:03 +00:00
Mitch Phillips da9a463794 Add the cc_fuzz target.
Adds the cc_fuzz target via a cc_fuzz module. Also implements the
libclang runtime interface for the x86 toolchain to allow host-built
fuzzers.

Bug: 133261679
Bug: 137398545

Test: Build a fuzzer (with all topic patches), notice that you now
have a host-built fuzzer :)

Change-Id: I7fa069603415f40b3f12a002c253fca6e2aa1988
2019-07-16 16:30:53 -07:00
Peter Collingbourne 84d8385ae1 Use LLD for partialLd.
Clang will soon start using relocations that are currently unsupported by
the version of ld.bfd that Android uses when HWASAN is enabled. This will
cause partialLd to fail since the clang driver defaults to ld.bfd.

Switch to using LLD, since it will support those relocations.

Change-Id: I0964f53dc63773f3b52bb377f863df9c39961a07
2019-07-16 14:14:36 -07:00
Colin Cross 5822b552ef Manually escape BuildNumberFromFile
Change ctx.Config().BuildNumberFromFile() to be unescaped, and then
escape it manually where necessary.  This will allow passing
ctx.Config().BuildNumberFromFile() to RuleBuilder, which will handle
the necessary escaping.

Test: no change to out/soong/build.ninja
Change-Id: I5329ab2ba70ccea49958864488aa81794a7e4b56
2019-07-16 10:23:41 -07:00
Dimitry Ivanov 2ca7a8835e Merge "Make relative path for native_bridge binaries configurable" 2019-07-16 09:17:35 +00:00
dimitry 8d6dde8831 Make relative path for native_bridge binaries configurable
This change introduces NativeBridgeRelativePath and
NativeBridgeSecondaryRelativePath product variables to
make relative path to native_bridge binaries configurable.

It also removes moves information about native bridge
host architecture to Target and sets it during decodeTargetProductVariables

Test: make PRODUCT-cf_x86_phone-userdebug dist
Change-Id: Ie736e81eae507e1775566ce9f29135011b12af27
2019-07-15 20:04:07 +02:00
Treehugger Robot b940a1499b Merge "Stop defining unused USE_SSSE3." 2019-07-13 16:59:49 +00:00
Elliott Hughes b22dcfe05c Stop defining unused USE_SSSE3.
This copy & paste has even made it into the fuchsia configuration...

Test: builds
Change-Id: If22615fdf04448c058db014d93155e6264fb3eb2
2019-07-12 22:40:45 -07:00
Mitch Phillips cba311bcfc Re-enable ASAN globals instrumentation for devices.
ASan globals instrumentation apparently broke the build in the pass.
This is now a customer feature to get this up and running, let's see if
it works.

Bug: 137312732

Test: Build the platform, deploy and run an asan-ified test (maybe
resolv_integration_test?).

Change-Id: Ic4ee0db617c290d8a3fec52db4b90bc4772696b8
2019-07-11 17:16:58 -07:00
Colin Cross ee94d6ab14 Add RuleBuilder helper functions for built and prebuilt tools
Replace the common pattern of:
cmd.Tool(ctx.Config().HostToolPath(ctx, "tool"))
with:
cmd.BuiltTool("tool")

And similarly for PrebuiltBuildTool.

Test: m checkbuild
Change-Id: I7d63188505362c7df6a3b3e7330b4a2cca5a2409
2019-07-11 13:05:19 -07:00
Jiyong Park acbf6c76c6 Use ctx.Target().NativeBridge to detect if the arch is translated or not
Bug: 137015854
Test: m
Test: build cf_x86_phone and ensure there is no dangling symlink
/system/lib/arm/libm.so

Change-Id: I0f5efdb9e1f5e4e213ca4ebaa28ace0a130b36a6
2019-07-10 18:07:38 +09:00
Pirama Arumuga Nainar bc53fefd6a Merge changes from topic "gcov-prefix-permissions-fix"
* changes:
  Wrap getenv when linking a coverage-enabled binary
  Refactor libprofile-extras to be added as a whole static library
2019-07-09 15:32:48 +00:00
Inseob Kim 0ce291ebee [trivial] Remove dead code
Bug: N/A
Test: m
Change-Id: Ia278008249f5fc1cf5fd7d29e55e2e54f1d6f3ca
2019-07-04 14:39:22 +09:00
Pirama Arumuga Nainar 100bbdc8f3 Wrap getenv when linking a coverage-enabled binary
The wrapper to getenv() appends the effective userid (euid) of the
current process to GCOV_PREFIX.  This avoids conflicts and permissions
issues when multiple processes try to create/access the same directories
and files under /data/misc/trace.

Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...

Change-Id: If58081a12b2b9bc40cfcbf64c99beafe198d07af
2019-07-03 15:28:54 -07:00
Pirama Arumuga Nainar 82fe59b656 Refactor libprofile-extras to be added as a whole static library
Bug: http://b/134177005
Bug: http://b/116873221

Previously, the libprofile-extras dependency was added as a
LateStaticLib and the constructor in this library was included during
linking with the '-uinit_profile_extras' linker flag.  This was done
because at the deps() stage, the exact binaries that need coverage are
not known (in fact the coverage-enabled variants are not created yet).

This meant that for a link command, if one of the shared libraries
already exported the constructor, the output of the link command did not
load/link libprofile-extras.

For other reasons, we now want to add more symbols to this library that
need to be linked into all libraries and executables.  To accomplish
that, refactor the dependency handling so libprofile-extras can be added
as a 'WholeStaticLib'.

This is done by creating a new dependency type (with a coverageDepTag
dependency tag) to add libprofile-extras as a dependency for all modules
that can potentially link with coverage.  During the flags() call, this
dependency is moved as a WholeStaticLib dependency iff coverage is
enabled in this link step.

There are a few NFC changes as well:
- deps() takes a DepsContext parameter.
- flags() has an extra PathDeps parameter and return value.
- add useSdk() helper to cc.Module.

Test: Build with coverage and check that we can generate coverage using
SIGUSR1 and the debug.coverage.flush sysprop.

Change-Id: I7e7d8201956a150febbda5bb1794f8ece016db8b
2019-07-03 15:28:50 -07:00
Treehugger Robot dd5cf7574b Merge "Disabled avx avx2 avx512 compiler flags by default. Library components can enable the flags based on performance impact" 2019-06-28 21:14:33 +00:00
Colin Cross d34ab7c6b2 Treat .cxx files as c++
Fixes: 135749365
Fixes: 135667566
Test: m checkbuild
Change-Id: If47274812dfe781ebbb9f8a60a395650573727d5
2019-06-27 14:46:10 -07:00
jaishank 7e84969f96 Disabled avx avx2 avx512 compiler flags by default.
Library components can enable the flags based on
performance impact

Test: run-test gtest
Change-Id: I41c4464cffd2b0e830d4ab1c5a25b378e2a25129
Signed-off-by: jaishank <jaishankar.rajendran@intel.com>
2019-06-27 10:36:23 +05:30
Hsin-Yi Chen 30057808e1 Merge "Generate ABI dumps for libraries without source" 2019-06-27 02:08:34 +00:00
Dan Willemsen c4a6aa83e8 Use prebuilt m4 for bison too
Bison is currently looking for m4 directly in `/usr/bin/m4`, instead of
through $PATH, so it hadn't been tracked via the $PATH interposer
checks. But if you don't install m4 at all, it starts failing.

Bug: 117561006
Bug: 130111713
Test: Run on a machine without m4, build passes
Change-Id: I3fbad64127c183de79c17511e979fd5df946eb80
2019-06-25 16:12:12 -07:00
Hsin-Yi Chen f6a95467e2 Generate ABI dumps for libraries without source
This commit enables ABI diff for libraries without source.
Stub libraries are excluded.

Test: ./create_reference_dumps.py -products aosp_arm64
Test: make
Bug: 135728451
Change-Id: Idbe276db6f5e057175fc098f0226cb38996faa17
2019-06-25 15:06:13 +08:00
Colin Cross e264f22bec Merge changes Ia77090da,I95a57f76
* changes:
  Fix data races in finder_test.go
  Optimize sanitizerRuntimeDepsMutator
2019-06-21 17:01:23 +00:00
Treehugger Robot c4be0815d8 Merge "Remove experimental pass manager for fuzzer builds." 2019-06-21 00:51:26 +00:00
Colin Cross 0b90833ea8 Optimize sanitizerRuntimeDepsMutator
sanitizerRuntimeDepsMutator only modifies the currently visited
module, it can visit modules in parallel.

Also, stop recursing into modules that are not static dependencies,
and stop recursing if the module already has all modifications that
the mutator could make.

Test: m checkbuild
Change-Id: I95a57f763a91940f1854ba3c587a2f70e8baba97
2019-06-20 15:23:41 -07:00
Dan Willemsen c69d715d72 Use prebuilt m4 instead of system m4
Bug: 117561006
Test: treehugger
Change-Id: I588d867d95cc52963ce764018a9c09b26973c8c3
2019-06-19 12:50:32 -07:00
Mitch Phillips 74384758a6 Remove experimental pass manager for fuzzer builds.
Sanitizer coverage is currently broken with the experimental pass
manager. See b/133876586 for more information. The patch is currently
being worked on upstream (https://reviews.llvm.org/D62888), but is not
ready yet. Hence, we disable it here (similar to the LTO bug).

Bug: 133876586
Test: Build anything with SANITIZE_TARGET='fuzzer', verify that it has
'sancov' symbols.

Change-Id: I4302a8cf05300015aaff137f40b61d5685dc3fea
2019-06-17 10:33:52 -07:00
Nick Desaulniers 2deb017c04 Merge "Switch to clang-r353983d" 2019-06-17 16:25:51 +00:00
Treehugger Robot b1856799b1 Merge "sysprop_library: Rename system scope to public" 2019-06-16 06:08:14 +00:00
Evgenii Stepanov 1c69e83030 Disable new LLVM pass manager for HWASan.
Current Android toolchain does not support hwasan with new pm.

Bug: 135298400
Test: manual, inspect the binaries for calls to __hwasan_init
Change-Id: I126c59e6ecabc3a1699e1bf34c546568b6e8a21f
2019-06-14 18:39:59 -07:00
Nick Desaulniers 36a39c9852 Switch to clang-r353983d
Test: build+boot sargo, TreeHugger
Bug: 131714073
Change-Id: Ieec2500027a78b80147f86b2bdaeaedaa1c18360
2019-06-14 16:31:34 -07:00
Dan Shi 9314e1124b Merge "Support require_root in auto-gen test configs" 2019-06-14 22:21:39 +00:00
Pirama Arumuga Nainar 50b382a9e3 Merge "Remove redundant -fexperimental-new-pass-manager" 2019-06-14 21:02:45 +00:00
Dan Shi 37ee3b8f49 Support require_root in auto-gen test configs
require_root is added to allow auto-generated test config to include
RootTargetPreparer so the test runs with root permission.

Bug: 134509111
Test: add "require_root: true" to init_benchmarks and libpower_test
  build the modules, confirm the extra target preparer is added in the
  test configs.

Change-Id: Ia07503e338935d6aa92560e7cf7b18d2a4c51243
2019-06-14 11:10:13 -07:00
Pirama Arumuga Nainar 3a25405acc Remove redundant -fexperimental-new-pass-manager
This is now turned on by default (cc/config/clang.go).

Test: N/A
Change-Id: I61bcf2049448b4200ca303ebcad555cc24a43c18
2019-06-14 09:54:23 -07:00