Commit graph

11687 commits

Author SHA1 Message Date
Pete Gillin
2b1ea2edb3 Don't specify -encoding twice in Jdiff javadoc invocations.
The option '-encoding UTF-8' is included in the opts defined at L1754,
which are passed to transformJdiff (defined at L1594), and from there
to a javadoc rule (defined at L29), where they are included in a
command line string which already has '-encoding UTF-8' in it. The
result is that this appears twice in the command line. This is
apparently ignored by the version of javadoc currently used. Later
upstream versions of javadoc, however, fail with the error 'javadoc:
error - The -encoding option may be specified no more than once.'

Test: make system-api-stubs-docs
Test: make system-api-stubs-docs, using an OpenJDK 11 toolchain via OVERRIDE_ANDROID_JAVA_HOME
Bug: 131683177
Change-Id: Ib9382ada3c8259edfacb2be3ab14d4c09d8753a7
2019-06-10 14:37:41 +01:00
Pete Gillin
14bb14e0c3 Merge "Disable the system-modules plugin for jlink invocations." 2019-06-07 10:35:56 +00:00
Treehugger Robot
42729b481a Merge "Allow arch-specific symlink_preferred_arch properties." 2019-06-06 19:10:41 +00:00
Pete Gillin
4eb6be32f6 Disable the system-modules plugin for jlink invocations.
This jlink plugin is intended to optimise startup times for Java
runtimes by embedding a pre-processed and pre-validated module graph
in the system image.

This provides no benefit on Android, since the Android runtime does
not make use of the module graph it produces. (It doesn't seem useful
on Android anyway, since the system image only contains one module,
namely java.base.)

Furthermore, the plugin causes the jlink invocation to fail when using
the jlink tool from OpenJDK 11. The issue here is the plugin uses
classes in the jdk.internal.module package to describe the module
graph; that package is not part of libcore and therefore not listed in
the module-info.java for java.base on Android; but the plugin has the
side-effect of adding the package to java.base; this causes jlink to
subsequently fail with an error "Module java.base's descriptor
indicates the set of packages is : <lots of packages>, but module
contains packages: <same packages plus jdk.internal.module>". (The
implementation of the plugin changed significantly in OpenJDK 10,
which is presumably why this issue does not occur using OpenJDK 9's
jlink.)

Therefore, it is safe and beneficial to disable the plugin.

Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make core-all-system-modules, using an OpenJDK 11 toolchain via OVERRIDE_ANDROID_JAVA_HOME and changing the jmod create invocation to use --module-version 11
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make droid, flash to device & sanity check
Bug: 131683177
Change-Id: I52333f32c88aa85cd3652ad91d50d9927ff61daf
2019-06-06 18:59:46 +01:00
Treehugger Robot
6d376a0de8 Merge "Use correct system_modules with core.current.stubs" 2019-06-06 16:05:16 +00:00
Jaewoong Jung
96eac767df Merge "Touch up manifest if there's no source code." 2019-06-06 13:52:37 +00:00
Neil Fuller
ba88c41274 Use correct system_modules with core.current.stubs
The system_modules defn used with core.current.stubs
was core-system-modules which doesn't match. Instead,
this change uses core-current-stubs-system-modules.

Test: build
Change-Id: Ifb9e77b02bbb04c1cb39c6b9f97932c20d44d8ba
2019-06-06 14:15:00 +01:00
Treehugger Robot
c4253b0ac9 Merge "system-clang-format: Add IncludeBlocks: Preserve" 2019-06-06 01:37:08 +00:00
Tom Cherry
c077eefc1e system-clang-format: Add IncludeBlocks: Preserve
As of [1], the Google format, which we default to, uses IncludeBlocks:
Regroup, which sorts all includes with <> and without .h into the top
group reserved for libc headers, e.g.:

+#include <android-base/properties.h>
+#include <android-base/strings.h>
 #include <ctype.h>
 #include <stdlib.h>
 #include <sys/system_properties.h>

 #include <iostream>

-#include <android-base/properties.h>
-#include <android-base/strings.h>

This is accurate to the Google C++ style guide, which states that
other library headers should be included with "", however we have a
strong tendency to use <> for these headers for Android, so we must
revert this change.

Note, clang-format allows regexes for creating the blocks as well,
however, short of including all possible libc headers, I don't think
there's a way to differentiate between <sys/wait.h> and
<other_lib/header.h>.

[1]:
62e3198c4f (diff-b689ebff2e51e675b346a88289e74542)

Test: clang-format doesn't do the above.
Change-Id: Ifef605ffd6b4c8a36512377644e64ddd26b68a21
2019-06-05 15:30:14 -07:00
Jaewoong Jung
4f67c42d76 Merge "android_app stl property bug fix" 2019-06-05 20:16:13 +00:00
Treehugger Robot
ac1d267368 Merge "Add .jar tag to java modules" 2019-06-05 19:23:38 +00:00
Roland Levillain
d9bf9be007 Allow arch-specific symlink_preferred_arch properties.
Test: m
Bug: 133864678
Change-Id: Ia6e62156adda2b3a51220552bbe4dab738753674
2019-06-05 19:38:45 +01:00
Treehugger Robot
b4c35f3378 Merge "Support tagged module references" 2019-06-05 17:17:32 +00:00
Treehugger Robot
933d2a8e63 Merge "Remove extra word in soong.android.archMutator's comment." 2019-06-05 17:04:52 +00:00
Treehugger Robot
e52b978c2a Merge "Soong: Define a new Soong module named prebuilt_firmware." 2019-06-05 16:17:10 +00:00
Treehugger Robot
fe49f17535 Merge "Soong: Add mk2bp conversion for prebuilt_firmare." 2019-06-05 16:16:52 +00:00
Roland Levillain
f5b635d51f Remove extra word in soong.android.archMutator's comment.
Test: n/a
Change-Id: Idb12ebe3f1c1f5bac303fba3ea98aaa569294e90
2019-06-05 14:46:25 +01:00
Treehugger Robot
7c9689f7b7 Merge "Revert "Revert "Revert "Print full diagnostics file when Java process crashes."""" 2019-06-05 09:53:22 +00:00
Jimmy Chen
e88eaa7db7 Revert "Revert "Revert "Print full diagnostics file when Java process crashes."""
This reverts commit b4be092855.

Reason for revert: break build

Change-Id: I11fc5eb5f635a5d99eba962f5817851629e50ab2
2019-06-05 06:47:11 +00:00
Yi Kong
4cb61bed13 Merge "Clean up no_libgcc" 2019-06-05 00:58:35 +00:00
Patrice Arruda
1ef3bb5d51 Soong: Add mk2bp conversion for prebuilt_firmare.
There are a couple of makefiles that have etc with $(TARGET_OUT)/etc/firmware,
$(TARGET_OUT_VENDOR)/firmare as the local module path. Added the conversion in
androidmk for target.

Bug: b/133711895
Test: Unit test cases.
Change-Id: I74aca18a7eb8aa4dd692cde680fa4e112edcf6d1
2019-06-04 17:10:48 -07:00
Jaewoong Jung
710756a6ff android_app stl property bug fix
When it is set to c++_shared, the added dependency should be
libc++_shared, not libc++.

Fixes: 130891985
Test: app_test.go, atest 'CtsNdkBinderTestCases' w/ conversion CL
Change-Id: I0e50e0d5bf511aa6e52d16cd715a185721011255
2019-06-04 12:36:00 -07:00
Colin Cross
375ca3c680 Add .jar tag to java modules
Allow java modules to be referenced as ":module{.jar}" to get
the classes .jar.

Bug: 122333007
Test: m checkbuild
Change-Id: I2d07f774ae8ed5a39206059c4102727c6802d26e
2019-06-04 10:22:55 -07:00
Colin Cross
41955e8895 Support tagged module references
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output.  For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files.  Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).

Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
2019-06-04 10:22:51 -07:00
Treehugger Robot
22d3d6ba5c Merge "Revert "Revert "Print full diagnostics file when Java process crashes.""" 2019-06-04 17:16:10 +00:00
Treehugger Robot
2406a123ba Merge changes I88973671,If5a3b53a
* changes:
  Fix nondeterminstic iteration of vndk modules map
  Fix data race and ordering consistency in apex modules
2019-06-04 06:10:00 +00:00
Ryan Prichard
e29e2473d2 Merge "Omit .gnu_debuglink sections in object files" 2019-06-03 23:15:38 +00:00
Yi Kong
e7fe9913d6 Clean up no_libgcc
no_libgcc is no longer needed anywhere. Move all occurances to no_libcrt
and remove no_libgcc.

Test: build
Change-Id: I6dd49db71d05d7685aa90cc837627f65e6742d6d
2019-06-03 15:52:40 -07:00
Colin Cross
4c2c46f0a7 Fix nondeterminstic iteration of vndk modules map
Sort the list of libraries when iterating over the vndk modules
map to avoid a non-deterministic output file.

Test: m nothing && mv out/soong/build.ninja /tmp && m nothing && diff -u out/soong/build.ninja /tmp/build.ninja
Change-Id: I889736715dab491bb7e69f3499ab1a5e2c876171
2019-06-03 15:52:27 -07:00
Colin Cross
cefa94bd27 Fix data race and ordering consistency in apex modules
apexDepsMutator can be called on multiple apex modules in parallel,
and then two goroutines could call BuildForApex on the same module
in parallel, leading to a data race appending to apexVariations.
This also results in random ordering of the entries in
apexVariations.

Hold a mutex around appending to apexVariations, and sort it before
passing it to ctx.CreateVariations.

Fixes: 134425751
Test: m nothing
Change-Id: If5a3b53a778daacb3e26ac05cde872cf8eb980b3
2019-06-03 15:52:27 -07:00
Patrice Arruda
057a8b1114 Soong: Define a new Soong module named prebuilt_firmware.
There are several firmware files that are being installed to
system/etc/firmware or vendor/firmware. A new module type is
defined to install firmware files to install in the system
or vendor image.

Fixes: b/133711895
Test: Ran lunch, wrote unit test cases, created a sample Android.bp
      with defined prebuilt_firmware Soong and ran mma.

Change-Id: Iaa791cdda4402936037c5a456cc8bf8e6c905b3e
2019-06-03 15:40:22 -07:00
Jaewoong Jung
c27ab6678b Touch up manifest if there's no source code.
The new package manager behavior requires packages without source code
to have an application element with hasCode attribute set to false in
their manifest. With this change, Soong can now automatically insert one
for codeless apps.

Test: app_test.go, manifest_fixer_test.py
Fixes: 124375490
Change-Id: Ied89a8d07c63805ab910859a4f7c45fc1c60bb73
2019-06-03 10:51:42 -07:00
Alexander Smundak
b4be092855 Revert "Revert "Print full diagnostics file when Java process crashes.""
This reverts commit d71dc6b5e0.

Reason for revert: ag/974065 fixes the problem that caused the revert

Change-Id: I3ba9eecdab34602aaf19fa518520ac932c9b97af
2019-06-03 16:53:22 +00:00
Ryan Prichard
f979d73428 Omit .gnu_debuglink sections in object files
I'm not sure if these sections are used, but by adding them to
libgcc_stripped.a, we can end up with multiple .gnu_debuglink sections in
an executable, where the first two unhelpfully point at "libgcc.a". e.g.:

$ readelf -SW -x.gnu_debuglink out/target/product/walleye/system/bin/bootstrap/linker64
...

Section Headers:
  ...
  [18] .gnu_debuglink    PROGBITS        0000000000000000 10f19c 000020 00      0   0  1
  ...
  [22] .gnu_debuglink    PROGBITS        0000000000000000 18a2c8 000010 00      0   0  4
  ...

Hex dump of section '.gnu_debuglink':
  0x00000000 6c696267 63632e61 00000000 3d5f65d8 libgcc.a....=_e.
  0x00000010 6c696267 63632e61 00000000 3d5f65d8 libgcc.a....=_e.

Hex dump of section '.gnu_debuglink':
  0x00000000 6c696e6b 65723634 00000000 f85db7ea linker64.....]..

Bug: none
Test: m libgcc_stripped linker
Test: no .gnu_debuglink section in libgcc_stripped.a
Test: only one .gnu_debuglink section in system/bin/bootstrap/linker64
Change-Id: I0c47a9acd6d52f5cbc5bfa8b67d072ebb075a242
2019-05-31 15:07:16 -07:00
Jaewoong Jung
06b2c69cfe Merge "Add data property to sh_test." 2019-05-31 16:05:42 +00:00
Dimitry Ivanov
656833e0c8 Merge "Skip native_bridge modules when installing vndk snapshot" 2019-05-31 12:51:55 +00:00
Treehugger Robot
d5dd534465 Merge "Revert "Print full diagnostics file when Java process crashes."" 2019-05-31 09:37:36 +00:00
Treehugger Robot
b023fe382b Merge "AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json" 2019-05-31 05:29:15 +00:00
Alexander Smundak
d71dc6b5e0 Revert "Print full diagnostics file when Java process crashes."
This reverts commit 9d6df2246c.

Reason for revert: This change set the value of JAVA make variable to a string containing "foo bar". When soong_ui is asked to evaluate such string, it drops the quotes, causing bash to treat 'foo' and 'bar' as separate command line arguments.

Change-Id: If4e3c4c950c305bb67a572de3d86119c2da81dc1
2019-05-31 03:15:55 +00:00
Colin Cross
76acdadaf7 Merge "Make test_options.timeout an int64" 2019-05-31 03:11:22 +00:00
Jaewoong Jung
8eaeb0987d Add data property to sh_test.
Fixes: 131861785
Test: sh_binary_test.go, a real sh_test with added data
Change-Id: Ic78022d2db38a530074c70823ef16773d8ba6821
2019-05-30 17:21:29 -07:00
Mitch Phillips
a81760510d Merge "Fix fuzzer builds [#2]." 2019-05-30 22:24:06 +00:00
Treehugger Robot
7a1fefc2de Merge "Port uses-shared library verification and dexpreopting to Soong" 2019-05-30 21:50:31 +00:00
Treehugger Robot
7b1ca80579 Merge "Print full diagnostics file when Java process crashes." 2019-05-30 21:16:52 +00:00
Colin Cross
2f9a7c8ab0 Make test_options.timeout an int64
I forgot we supported integer properties, use an integer instead
of a string for test_options.timeout.

Test: m checkbuild
Change-Id: I22d3135b31ec93d15b530c430b9e9cda6dd3f416
2019-05-30 11:19:32 -07:00
Mitch Phillips
bfeade6424 Fix fuzzer builds [#2].
- Updates the fuzzer builds to use SANITIZE_TARGET='fuzzer' instead of
'coverage'.
- Removed an old dependency that made fuzzer builds without ASan
an error.
- Fixed up the build flags to allow fuzzers to be built. Previously, the
coverage flags were manually provided. As the toolchain has moved on,
these flags are no longer compatible with libFuzzer, and so I've updated
them to use the correct, compatible flags.
- Added a dependency mutator for fuzzer coverage.

Bug: 121042685
Test: With all patches in the bug merged, build a fuzzer using
'SANITIZE_TARGET=fuzzer mmma <your_fuzzer>'.

Change-Id: Ib6246980f77bc4babe587b1e88038aa12228fa83
Merged-In: Ib6246980f77bc4babe587b1e88038aa12228fa83
2019-05-30 16:49:42 +00:00
Colin Cross
50ddcc4b69 Port uses-shared library verification and dexpreopting to Soong
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.

This reapplies Id25f55f07a55120bebe2a9b32c094209efc85c8b with fixes
for unbundled builds and builds with ALLOW_MISSING_DEPENDENCIES=true
set.

Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: I964309a68ec4ed081f3f3154879c71048ecb5455
2019-05-29 19:11:26 -07:00
Sasha Smundak
9d6df2246c Print full diagnostics file when Java process crashes.
Bug: 132766811
Test: treehugger
Change-Id: I8cca2486f2194a8643007a53e4a695d2a18abbf8
2019-05-29 17:46:22 -07:00
Colin Cross
7d06395f0c Merge "Revert "Port uses-shared library verification and dexpreopting to Soong"" 2019-05-29 20:34:10 +00:00
Colin Cross
c032498336 Revert "Port uses-shared library verification and dexpreopting to Soong"
This reverts commit b66d7b1c20.

Reason for revert: broke unbundled builds

Change-Id: I96ae287885107079de4a26e6b100ad8ed66961c0
2019-05-29 20:28:47 +00:00