Commit Graph

3527 Commits

Author SHA1 Message Date
Jooyung Han
bdad6c378f Merge "apex: __ANDROID_APEX__ defined with no value" 2019-10-30 23:50:58 +00:00
Mitch Phillips
c030bdff24 Merge "Use unstripped binaries in fuzz target packaging." am: 9f221955f4 am: 7be457b958
am: aafc79b830

Change-Id: I67227d392707aa08efff6999933933e4dbe414ec
2019-10-30 15:33:29 -07:00
Kris Alder
db97af4a4b change output file extension (config.txt -> config.json)
This is causing some build errors because the config.json file isn't
associated with a rule (because the rule looks for .txt).

Test: ran locally, checked output directory
Bug: 142551000
Change-Id: Idcdb226fa2d23055a8850b2a0545202921edc3b1
2019-10-30 20:58:54 +00:00
Treehugger Robot
9f221955f4 Merge "Use unstripped binaries in fuzz target packaging." 2019-10-30 20:48:14 +00:00
Chih-hung Hsieh
69987355c6 Merge "Add rust_test and rust_test_host." am: bb3e6c3c35 am: 462e944d4d
am: bcde681e90

Change-Id: I5de4db48515a40fae36bfad48c72cc1ea7211bf6
2019-10-30 00:52:47 -07:00
Chih-hung Hsieh
bb3e6c3c35 Merge "Add rust_test and rust_test_host." 2019-10-30 07:22:53 +00:00
Jooyung Han
09a2e257ec Merge changes from topic "fix-vndk-core-variant" am: 61eb8aaea4 am: d178df9c20
am: b8d3065ff9

Change-Id: I3519ec81f4c3f7133cfafbdb7e02497bc9e694da
2019-10-29 21:50:22 -07:00
Chih-Hung Hsieh
a5f22ed6b0 Add rust_test and rust_test_host.
* Rust tests are like binary files compiled with --test.
  New test.go follows binary.go code patterns and reuses
  some code in binary.go.
* Generate one test per source file as testPerSrc in cc/test.go.
  The "all tests" variation feature of cc/test.go is not copied yet.
  Fix some Stem and SubName settings to make testPerSrc work.
* Move cc.CheckDuplicate to android.CheckDuplicate,
  which is now shared by cc and rust.
* Refactor tests in binary_test.go and add new test_test.go.

Bug: 140938178
Test: mm in rust projects, added rust_test and rust_test_host
Change-Id: Ia6fec8b4cf2572fd352ab1938a1f3c7b5cca2212
2019-10-29 17:19:03 -07:00
Jooyung Han
b01c114d27 Do not install VNDK lib in favor of VNDK APEX
Since VNDK APEX replaces VNDK lib /system/lib/vndk{-sp}, VNDK libs are
not installed.

Bug: 141451661
Test: m && boot device
Change-Id: I14686927a56ded5176839c89f29a2fd7e0fca658
2019-10-30 00:07:25 +00:00
Mitch Phillips
d5bd5773e3 Use unstripped binaries in fuzz target packaging.
Unstripped binaries allow for online symbolization, and offline
symbolization using the debug info in the binary. Debug information
isn't stripped for host binaries, but is for target. Target should also
contain debugging info.

Bug: N/A
Test: m fuzz && # Check that fuzz targets in the fuzz-*.zip package have
debug info.

Change-Id: Ibd3002674d519e927340a50dfdfbf44f2d809d58
2019-10-29 17:04:22 -07:00
Jooyung Han
87a7f3064f Fix apex_vndk with TARGET_VNDK_USE_CORE_VARIANT
When TARGET_VNDK_USE_CORE_VARIANT is set, vndk apex should have only
- vndk sp libraries
- vndk core libraries which are marked as "must use vendor variant"

Previously, vndk sp libs are discarded when TARGET_VNDK_USE_CORE_VARIANT
is set.

Bug: 143374795
Bug: 139772411
Test: TARGET_VNDK_USE_CORE_VARIANT=true m com.android.vndk.current
      see if vndk sp lib(e.g. libunwindstakc) is included.

Change-Id: Iae218fff5c354eb874839a1f71be30633fb8a9ab
2019-10-30 09:04:13 +09:00
Jooyung Han
6b8459be4f apex: __ANDROID_APEX__ defined with no value
__ANDROID_APEX__ was defined with the name of apex module.
-D__ANDROID_APEX__=com.android.foo

But in this way, conditional compilation is not easy since comparing
macro's string value is not supported in C/C++.
(There's no usages of this value in source tree.)

In most cases, modules can check if __ANDROID_APEX__ is defined to see
if they are compiled for apex.
For modules which should behave differently according to which apex they
are included, they can check __ANDROID_APEX_<NAME>__.

Bug: 142582178
Test: m (soong tests run) && boot device && TH
Change-Id: I0f5e3e9463ccd96cbba333a8bdd648470c5c912d
2019-10-29 23:47:59 +00:00
Ivan Lozano
6ec3e06cf6 Merge changes Ia7deed13,I7378a46f am: 765fe7a501 am: 5e94b2dd4b
am: d446f0b06e

Change-Id: I4affe1644dfa7c34df9ecface7bcd85857e61761
2019-10-29 15:41:03 -07:00
Ivan Lozano
765fe7a501 Merge changes Ia7deed13,I7378a46f
* changes:
  Add support for Rust C libraries.
  Add a common interface for cc linkable libraries.
2019-10-29 21:47:14 +00:00
Ivan Lozano
52767be335 Add support for Rust C libraries.
Adds the ability for rust modules to be compiled as C libraries, and
allows cc modules to depend on these rust-generated modules. This also
means that soong-rust should not have any dependencies on soong-cc aside
from what's required for testing.

There's a couple small fixes included as well:

 - A bug in libNameFromFilePath that caused issues when library's had
 "lib" in their name.
 - VariantName is removed from rust library MutatedProperties since this
 was unused.

Bug: 140726209
Test: Soong tests pass.
Test: Example cc_binary can include a rust shared library as a dep.
Test: m crosvm.experimental
Change-Id: Ia7deed1345d2423001089014cc65ce7934123da4
2019-10-28 22:09:01 -07:00
Jiyong Park
73c54ee7fe native shared libs in an SDK can be snapshotted
The snapshot script can now handle native shared libs in an SDK.

Bug: 138182343
Test: create following sdk module:
sdk {
    name: "mysdk",
    native_shared_libs: ["libc", "libdl"],
}
, then execute `m mysdk` and execute the update_prebuilt-1.sh as
prompted. Following directories are generated under the directory where
mysdk is defined at:

1
├── aidl
├── Android.bp
├── arm64
│   ├── include
│   ├── include_gen
│   └── lib
│       ├── libc.so
│       └── libdl.so
├── include
│   └── bionic
│       └── libc
│           └── include
│               ├── alloca.h
│               ├── android
│               │   ├── api-level.h
<omitted>

Change-Id: Ia1dcc5564c1cd17c6ccf441d06d5995af55db9ee
2019-10-29 12:27:35 +09:00
Kris Alder
b3076cee75 add additional fields to cc_fuzz build types am: f979ee3873 am: 0bb1b218a9 am: b3670d2945
am: bc4710e870

Change-Id: I4f0e6d3d642a116b26321b9db700d681c13faf7a
2019-10-28 17:13:55 -07:00
Kris Alder
f979ee3873 add additional fields to cc_fuzz build types
Specifically, this adds:
* Owner
* Disable (stop fuzzer from running in Haiku)
* Bug Component
* Bug Hotlist

The fields are all inside a new 'options' struct.

The values from these fields (if any) are written into a config file as
json.

Bug: 142551000
Test: ran locally with a modified build file and verified output in .zip
Change-Id: I86edf74c2cebe9912ac0ad203f99028be4062c8b
2019-10-28 16:15:50 -07:00
Ryan Prichard
d818cbe2bd Merge "Stop linking libdl.a into static bins" am: ce6b216c5e am: d258b0fceb am: f26152245c
am: 1d051e0bb5

Change-Id: Ife881f70b97d1f2d432eeed93b1288368efda807
2019-10-28 14:03:32 -07:00
Ivan Lozano
183a3218e2 Add a common interface for cc linkable libraries.
Adds an interface, CcLinkableInterface, for cc linkable dependencies
which come from other toolchains such as Rust.

Bug: 140726209
Test: Soong tests pass, rust modules still compile.
Change-Id: I7378a46fad94fd0b735746aaf4e265fd2c2c04d8
2019-10-28 13:45:12 -07:00
Ryan Prichard
ce6b216c5e Merge "Stop linking libdl.a into static bins" 2019-10-28 20:14:37 +00:00
Greg Kaiser
d9d40ecf47 Merge "Partial reverts of vndk-apex" am: 5bce0931c1 am: 908aa0cf74 am: 4e7313bd3d
am: d6a1e1caa9

Change-Id: I421d7474ad5fc4a48a911a27209424b7b2631a95
2019-10-28 10:37:57 -07:00
Jooyung Han
6db2f177db Partial reverts of vndk-apex
This installs vndk libs under system/lib/vndk
instead of vndk-apex.
(Partial reverts of 31c470b5d5)

Also fixes the bug 097087be53 brought.
This produced incomplete list of vndkcorevariant.libraries.txt.

Bug: 143374795
Test: m && boot
Change-Id: I17864de4770a84431756e0c3765b601d3dc2abb1
2019-10-28 14:12:48 +09:00
Jiyong Park
abcfdc9aea Merge "Change exportedDirs and exportedSystemDirs from []string to android.Paths" am: b480debbd8 am: 229ebeea9b am: c5bb8dc821
am: 774c8ba3b6

Change-Id: I3f6aecc5232759524f04778ef3576fd68f6139b3
2019-10-27 19:53:58 -07:00
Treehugger Robot
b480debbd8 Merge "Change exportedDirs and exportedSystemDirs from []string to android.Paths" 2019-10-28 02:24:41 +00:00
Jooyung Han
382cded017 Merge "Soong generates libraries.txt files for vndk" am: 7d6b21c265 am: 678af96675 am: cdd21aa9e7
am: 63261b8a9e

Change-Id: I564228bbfdf894185d18df47a56e38e5ab933854
2019-10-25 19:34:50 -07:00
Treehugger Robot
7d6b21c265 Merge "Soong generates libraries.txt files for vndk" 2019-10-26 01:52:39 +00:00
Jooyung Han
1c124a9350 Merge changes from topic "add-vndk-again" am: 7289ddbeba am: 6bab6fe3e0 am: 9f50ee32d7
am: 6179be2c32

Change-Id: I57a9626c207be164340a663167069692c1d4cbf5
2019-10-25 02:02:43 -07:00
Yi Kong
34684a9f3a Merge "Repack libgcc.a to only include required objects" am: 00ae8b3996 am: 57f7dd4196 am: ed4fbfb5a7
am: e6ab537c0e

Change-Id: Ie6a82118c7a8925f3265ebf0290498d091a67310
2019-10-25 01:36:07 -07:00
Jooyung Han
7289ddbeba Merge changes from topic "add-vndk-again"
* changes:
  add symlink for compatibility (vndk apex)
  Revert "Revert "Add __ANDROID_APEX_<NAME>__ for apex variants""
  Revert "Revert "Supports VNDK APEX with different versions""
2019-10-25 08:21:13 +00:00
Yi Kong
00ae8b3996 Merge "Repack libgcc.a to only include required objects" 2019-10-25 08:00:58 +00:00
Ryan Prichard
b49fe1bde7 Stop linking libdl.a into static bins
libdl.a has a no-op dlopen, which breaks static libraries that need a real
dlopen. Instead of automatically linking libdl.a into static executables,
make it optional.

Until recently, the libunwind_llvm.a unwinder, used on arm32, needed the
no-op dladdr, but it's now built using -D_LIBUNWIND_USE_DLADDR=0.

The HWASan run-time uses dlsym and dladdr, so add a libdl dependency for
HWASan-built static binaries. We could also remove the dependency from
libclang_rt.hwasan_static-*.a, but this is also easy to do.

Bug: http://b/141485154
Test: bionic unit tests, device boots, verify that static and dynamic
   executables can throw/catch an exception
Test: verify that a static executable using dlopen doesn't link (unless it
   adds an explicit dependency on libdl)

Change-Id: Ic52c3f336b671b4ed335e99c94a64dfe8614b618
2019-10-24 22:25:54 -07:00
Jooyung Han
097087be53 Soong generates libraries.txt files for vndk
These files were generated by Make. This is an effort to converting make
to soong.

These files are created under a known location: $SOONG_OUT_DIR/vndk
- llndk.libraries.txt
- vndksp.libraries.txt
- vndkcore.libraries.txt
- vndkprivate.libraries.txt
- vndkcorevariant.libraries.txt
- vndk.libraries.txt: merged all of above with tags

The last one is used by 'check-vndk-list'.
(See the topic)

Others will be packaged by VNDK APEX of current VNDK.
(This is not merged yet. After landing, a follow-up CL will be
followed.)

Bug: 141019581
Bug: 141450808
Test: m check-vndk-list
Change-Id: I9a24f6975bd4b226a94f61a13d43857dcdce6b88
2019-10-25 14:08:28 +09:00
Jiyong Park
7495504db4 Change exportedDirs and exportedSystemDirs from []string to android.Paths
exportedDirs and exportedSystemDirs are now changed to android.Paths so
that we can later manipulate the paths via Rel(), etc.

Test: m

Change-Id: I6fb02ea4983bcebac351bc284f75b44885379e8f
2019-10-25 09:52:08 +09:00
Yi Kong
c49c393f73 Repack libgcc.a to only include required objects
Previous solution by using objcopy uses a quirky behaviour of the GNU
objcopy and there is no equivalent option in llvm-objcopy.

Instead of removing symbols, extract and repack libgcc to only include
required objects.

Bug: 142585047
Test: presubmit
Change-Id: I58af74c18838f797e481da38c3265f0624fddf99
2019-10-24 16:34:54 -07:00
Jooyung Han
28ef5f29cb Merge "fix: Override vndk-ext lib name with original lib" am: ac1b07e2dc am: 11e0d21b5b am: 0e14b99c96
am: c9f3650dc8

Change-Id: I011201ace9e9a66ee0db3cf6eb00c94a8019b368
2019-10-24 16:16:31 -07:00
Dan Willemsen
3d57878f5b Merge "Add support for 10.15 SDK" am: f887ee6765 am: 7cd9c0327f am: 029b0934c9
am: 8a94d49599

Change-Id: I30158593f89ac69257fbfc2dba1f8b3dfc5da7b2
2019-10-24 16:15:01 -07:00
Treehugger Robot
ac1b07e2dc Merge "fix: Override vndk-ext lib name with original lib" 2019-10-24 22:38:00 +00:00
Dan Willemsen
89dad60ed5 Add support for 10.15 SDK
I haven't found any issues so far.

Test: try the build
Change-Id: I1e2f4095795daead6eb96280d60a122c51ba66ba
2019-10-22 17:01:15 -07:00
Jooyung Han
4c2b942e92 fix: Override vndk-ext lib name with original lib
vndk-ext should have the same output filename with the lib which it
extends. "extends" property is "module name", not "filename" of output.

Bug: 143130384
Test: add "protox" as a vndk-ext module (extends 'libprotobuf-cpp-full')
      m protox.vendor && check output filename under /vendor/lib/vndk/
      (should have correct suffix)

Change-Id: I5741ea87b4f2ad375b69f54c93dcb8753d9952dd
2019-10-22 20:01:28 +09:00
Pete Bentley
ff3e42cb53 Handle partial link of a single object with a linker script. am: ab65ba9481 am: 89c1d5ff71 am: 2f46a1c7fd
am: 4980868264

Change-Id: Iee17558dcc3349d420571d632f06ff01133b74fa
2019-10-18 11:50:54 -07:00
Jooyung Han
7798857a0d Revert "Revert "Add __ANDROID_APEX_<NAME>__ for apex variants""
This reverts commit 12f629b26d.

Bug: 142582178
Test: m (soong test added)
2019-10-19 02:28:39 +09:00
Jooyung Han
31c470b5d5 Revert "Revert "Supports VNDK APEX with different versions""
This reverts commit 48dd4b5ea4.

Bug: 141451661
Bug: 139772411
Test: m (soong tests)
Test: boot with aosp_arm64 system image on Q vendor device
2019-10-19 02:28:39 +09:00
Pete Bentley
ab65ba9481 Handle partial link of a single object with a linker script.
Fixes: 142931094
Test: m bssl with -DNO_ASM and all assembly sources commented out
Change-Id: Id56d325fbf1d4a0777944512a88f3c086e930af7
2019-10-18 12:42:18 +01:00
Mitch Phillips
eb7ef10246 Merge "Re-plumb fuzz corpora." am: 43bfaf9f65 am: 04930779ba am: 6dd469a412
am: 56ab9e509f

Change-Id: Ib92ebf9818f9724acaa49c03742ddaae51f657d8
2019-10-17 20:23:47 -07:00
Treehugger Robot
43bfaf9f65 Merge "Re-plumb fuzz corpora." 2019-10-18 02:43:26 +00:00
Jiyong Park
b5448a47ae Merge "Prohibit dependencies outside of uses_sdks" am: c5bba642f1 am: 3cf346c51c am: 77448df733
am: 09a7fa1d57

Change-Id: Ief73a2e089c9563fc9d1a737f2e62d7add5bfad5
2019-10-17 18:05:15 -07:00
Treehugger Robot
c5bba642f1 Merge "Prohibit dependencies outside of uses_sdks" 2019-10-18 00:30:18 +00:00
Mitch Phillips
8a2bc0b9fd Re-plumb fuzz corpora.
Re-plumb the fuzz corpora through an intermediates directory.
Previously, due to the way that LOCAL_TEST_DATA is implemented, we would
break when corpora were included:
 a) outside of a corpus/ directory, or
 b) not directly under the module directory (i.e. my_module/subdir/corpus)

Corpora are now written into an intermediates directory so that they
play nice with LOCAL_TEST_DATA, because unfortunately the key-value pair
required there is not as simple as source:destination.

Test: m example_fuzzer && ls \
$ANDROID_PRODUCT_OUT/data/fuzz/arm64/example_fuzzer/corpus
Bug: N/A

Change-Id: I5888b06ed349781c6712f1ae77cc3582283a9552
2019-10-17 16:11:00 -07:00
Treehugger Robot
81a4016f61 Merge "Add android.hardware.neuralnetworks@1.3" 2019-10-17 22:47:15 +00:00