Commit graph

782 commits

Author SHA1 Message Date
Treehugger Robot
714203c354 Merge "Update bindgen clang version to r468909b" 2022-10-20 21:53:42 +00:00
Muhammad Haseeb Ahmad
431ddf9b76 Output shared dependendencies of JNI libs for Java fuzzers
Test: m example_java_jni_fuzzer
Bug: 252846698
Change-Id: Ib583de335482350bfe293f9c3d021a595edd4f44
2022-10-20 00:55:58 +00:00
Colin Cross
8a5a1e2074 Update bindgen clang version to r468909b
r468909b is the first version to contain musl libclang.so.

Bug: 216192129
Test: m checkbuild
Change-Id: If4c986e285914ca909981ea5dc972c3047c2ac7c
2022-10-18 12:25:05 -07:00
Florian Mayer
296d595260 Driveby: remove duplicate condition
Change-Id: I8deddf40542d92a69d87334a292d6d1c038ae69a
2022-10-12 19:30:15 +00:00
Colin Cross
a497606f1d Merge changes I154a6f3a,I79f0c20a,I605ae9af,I647c7305,I95e96e3e, ...
* changes:
  Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
  Support AllowMissingDependencies in prebuilt_apex modules
  Support AllowMissingDependencies for apex dependencies
  Add AllowMissingDependencies support for prebuilt_etc module with no src property
  Make OutputFileForModule work for AllowMissingDependencies
  Fix panics when target arch is riscv64
2022-10-05 21:25:17 +00:00
Jihoon Kang
0b5f7f153f Merge "Specify jnilib partition in Android-<target>.mk" 2022-10-05 16:19:51 +00:00
Colin Cross
31d89b4e0c Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
Make rust and cc fuzzers collect their shared libraries once in
GenerateAndroidBuildActions and store it for later use by the
packaging singleton.  Also use android.OutputFileForModule to get
the paths.  Together this will fix fuzzers that depend on architecture
specific prebuilt shared libraries that are missing a prebuilt for an
architecture when building with AllowMissingDependencies.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I154a6f3a767c883e9fe7067003615db73ee78e2d
2022-10-04 19:15:45 -07:00
Colin Cross
a2aaa2fdef Fix panics when target arch is riscv64
Fix panics in api_level.go and apex.go when using riscv64 as the target
arch.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I85c7685f3d14fa2dc7ffbcdea7f490feca304ef7
2022-10-04 10:53:07 -07:00
Martin Geisler
b9f744157a Merge "Remove spurious trailing backslash in prefer_rlib docstring" 2022-10-04 08:48:58 +00:00
Jihoon Kang
f78a890183 Specify jnilib partition in Android-<target>.mk
Context
- Android-<target>.mk currently does not contain information about partition for its dependent unembedded jni libraries, but only lists the name of the unembedded jni libraries.
- If an android_app module depends on an unembedded jni library that is located in a different partition, make cannot find the library.

Implementation
- Create a string field partition in jniLib struct.
- Add variable "LOCAL_SOONG_JNI_LIBS_PARTITION_<target>", an array of mappings of the name of the jni library to its partition.

Bug: 154162945
Test: m
Change-Id: I6b8e1272ff59dc70e3dd6ce8c6c8e4686dad76df
2022-10-04 03:26:05 +00:00
Treehugger Robot
b9238c0b72 Merge "Drop rust dependency on musl_linker_script" 2022-10-03 20:12:51 +00:00
Colin Cross
9531e42407 Merge changes from topic "soong-riscv64"
* changes:
  Add riscv64-linux-android support
  Removed unused GCC references
2022-10-03 19:41:45 +00:00
Colin Cross
f05b0d35d2 Add riscv64-linux-android support
Add barebones riscv64-linux-android support.  This should be enough
to add riscv64-specific entries to Android.bp files, but can't
actually compile anything until there are riscv64 toolchains.

Test: arch_test.go
Change-Id: I0dcc7e797d9352dd38243be908a7f19004ff3db1
2022-10-03 08:43:13 -07:00
Colin Cross
9382c0628c Drop rust dependency on musl_linker_script
musl_linker_script is no longer required as the entry point is now
_start.

Bug: 242601708
Test: m USE_HOST_MUSL=true host-native
Change-Id: I5acfaeb181a2dd39aac72edd94bd2030881d9d27
2022-09-30 15:12:25 -07:00
Treehugger Robot
f99087d6d7 Merge "rust: Don't propagate apex across customBindgenTag" 2022-09-30 02:47:01 +00:00
Matthew Maurer
581b6d82ab rust: Don't propagate apex across customBindgenTag
customBindgenTag is used to describe a particular host tool - don't
propagate apex dependency across it.

Bug: 249849807
Test: Adding rusqlite to apex no longer requires bindgen allowed
Change-Id: Ifcb2a94c577c72558f757bf10e975212558fe790
2022-09-29 16:46:25 -07:00
Martin Geisler
46329e9ba4 Remove spurious trailing backslash in prefer_rlib docstring
Change-Id: I851306c73cb86df4bc4c82c3471ce3b6eaad9ded
2022-09-29 13:12:27 +00:00
Charisee
a688a793e4 rustc-1.64.0 Build 9099361
Test: m rust
Change-Id: I0f104dec7027a01524be155a63cae05f494c7101
2022-09-23 20:41:53 +00:00
Chris Wailes
af1e89e07b rustc-1.63.0 Build 8951290
Bug: https://issuetracker.google.com/issues/241303140
Test: m rust
Change-Id: Ie641a90154d5c3b9cedf671901116f68e5e47edb
2022-08-24 10:04:40 -07:00
Zhenhuang Wang
0ac5a431a9 Move common test_options properties into the android package
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.

Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
2022-08-17 01:19:15 +08:00
Matthew Maurer
18fa8f641a Merge "Revert^4 "rust: Only allow bindgen to produce rlibs."" 2022-08-11 17:50:17 +00:00
Matthew Maurer
e94f3e73dd Revert^4 "rust: Only allow bindgen to produce rlibs."
199c188502

Change-Id: I28b353fa89354cc572806b2274169342a473a03c
2022-08-10 20:25:50 +00:00
Treehugger Robot
3a4088dfd1 Merge "Introduce cc_api_library" 2022-08-10 04:12:32 +00:00
Kiyoung Kim
487689eaee Introduce cc_api_library
Introduce cc_api_library, which reflects imported API from other
inner-tree. This cc_api_library module type will later refer from
the other ninja module which generates stub library from the interface
description.

Tested environment :
* original libc definition has been removed temporarily, to ensure that
  imported api stub library is being used from build
* Added new definition of libc as below
 cc_api_library {
  name: "libc",
  arch: {
    x86: {
      src: "libs/x86/libc.so",
    },
    x86_64: {
      src: "libs/x86_64/libc.so",
    },
  },
  header_libs: [
    "libc_headers",
  ],
  export_header_lib_headers: ["libc_headers"],
  min_sdk_version: "9",
  vendor_available: true,
 }

Bug: 236087698
Test: `ALLOW_MISSING_DEPENDENCIES=true m vendorimage` succeeded
Change-Id: I67070b0f3561aa2afd73b6c1c0fdf4255218baac
2022-08-10 10:12:18 +09:00
Matthew Maurer
801b058fe3 Merge "Revert^3 "rust: Only allow bindgen to produce rlibs."" 2022-08-02 23:28:26 +00:00
Matthew Maurer
199c188502 Revert^3 "rust: Only allow bindgen to produce rlibs."
9cc801ab7a

Change-Id: Ib59840b51b316c0ad03bc66565814dd96be0b072
2022-08-02 23:26:16 +00:00
Treehugger Robot
c4ee5535f1 Merge "Revert^2 "rust: Only allow bindgen to produce rlibs."" 2022-08-02 21:36:37 +00:00
Matthew Maurer
9cc801ab7a Revert^2 "rust: Only allow bindgen to produce rlibs."
b983c8971b

Change-Id: Ic82433885f7932be8cfe65433330527214807684
2022-08-02 16:57:30 +00:00
Matthew Maurer
d13d15a9c0 Merge "Revert "rust: Only allow bindgen to produce rlibs."" 2022-08-01 22:19:32 +00:00
Matthew Maurer
b983c8971b Revert "rust: Only allow bindgen to produce rlibs."
This reverts commit 53a452d1ff.

Reason for revert: Broken build

Change-Id: I4c1c6f2166c3729ef1916ad7c21e32599c5e692f
2022-08-01 21:59:00 +00:00
Matthew Maurer
a8ea3ff66e Merge "rust: Only allow bindgen to produce rlibs." 2022-08-01 20:50:41 +00:00
Matthew Maurer
53a452d1ff rust: Only allow bindgen to produce rlibs.
Generated bindings are intended to be slim translation layers, usually
consisting of nothing more than type signatures and constants.
Generally, they should also be used in exactly one location by the safe
wrapper for these bindings. By preventing them from building as
`dylib`s, we avoid the per-library overhead of these non-reused pieces
of code.

Additionally, default visibility restrict all bindgen modules to their
subpackages. This is being done both:
* to encourage use of a single safe bindings crate
* to avoid diamond dependency graphs with mixed rlib/dylib dependencies

Bug: 166332519
Test: m; Make sample module use dylib bindgen dependency, see build failure.
Change-Id: I8e9d9cb851c2ec99f4ed63e6e18c4ba26b29721c
2022-08-01 16:28:51 +00:00
Matthew Maurer
cf3844c879 rust: Rust is now GA for platform usage
Rust is now approved for general platform use without project-specific
review.

Bug: 240501326
Test: m
Change-Id: I6fd4c22ba2c6a3a5bac6f91fd087fe5cffe46c01
2022-07-28 06:57:26 -07:00
Charisee
d6a5b15dfe rustc-1.62.0.p1 Build 8836667
Test: m rust
Change-Id: I8e22ce766ccfb64263eba794aa75144c58ebb71a
2022-07-18 22:15:44 +00:00
Yi Kong
cc3ad51a36 Merge changes from topic "llvm-stable-r458507"
* changes:
  [bindgen] Allow unrecognised -Wno-* flags on LLVM_NEXT
  Add extra cflags for LLVM_NEXT
2022-07-15 07:30:57 +00:00
Cory Barker
b1c8940be1 Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" 2022-07-14 16:26:41 +00:00
Yi Kong
4f664e9128 [bindgen] Allow unrecognised -Wno-* flags on LLVM_NEXT
Test: LLVM_NEXT=true m
Bug: 236798112
Change-Id: I5d1625a30d7271c94cba71347f17fbcb0b87f4ae
2022-07-14 12:38:06 +00:00
Cory Barker
a1da26fa9b Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie4fbd258c87663cf81d7d64d575b3da1d5febc17
2022-07-12 21:31:47 +00:00
Cory Barker
14058f2c4a Merge "Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."" 2022-07-12 20:20:00 +00:00
Cory Barker
7bc91232d1 Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."
Revert submission 2124256-AFLpp support in Soong

Reason for revert: It is breaking the build
Reverted Changes:
Ie07ec3368:Adding support for building AFLpp Test: Build AFL ...
I5bd6d1e9b:Adding support for building AFLpp Test: Built AFL ...

Change-Id: Id2eec1060f7532fec46293d0c207be800e6eaa03
2022-07-12 18:04:17 +00:00
Cory Barker
7e0b4bae8a Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" 2022-07-12 17:21:05 +00:00
Cory Barker
f4b1c3a7a7 Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie07ec336892649192a844a4d0d231196673e34a0
2022-07-12 01:20:17 +00:00
Charisee
30332aee9b rustc-1.62.0 Build 8809119
Test: m rust
Change-Id: I6daa0f00428dc46bfb5cc1ca1ae8818fd233d708
2022-07-11 19:02:33 +00:00
Colin Cross
a8941ec69f Don't use prebuilt rust stdlibs for linux bionic
Linux bionic doesn't have rust stdlib prebuilts, don't use the prebuilts
when it is configured as the host os.

Bug: 216192129
Test: builds
Change-Id: I03425dee4b2e3659bf90c0a0c808cc286daa4b7f
2022-07-01 18:30:17 +00:00
Colin Cross
567d342ed8 Use musl rust prebuilts for USE_HOST_MUSL=true
Building rust code with musl enabled can load proc macro crates built
against musl into rustc, so we have to use a version of rustc also
built against musl.

Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Icd23b542a4b64a975850a8a4bb4b69183cc6c2c6
2022-07-01 02:58:14 +00:00
Colin Cross
1faf82305a Add rust musl arm and arm64 toolchains
Add rust toolchain configurations for arm-linux-musleabihf and
aarch64-linux-musl.

Bug: 236052820
Test: builds with linux musl arm64 host cross configured
Change-Id: Icfa73a75eac710e955f71a073cb4b7bb1cdfcc7a
2022-06-28 15:16:15 -07:00
Ivan Lozano
7f67c2a665 rust: Allow rust_ffi_shared in jni_libs
Allow listing rust_ffi_shared modules as a jni_libs dependency
in conjunction with platform_api: true. This allows inclusion by
android_app modules.

Bug: 237304791
Test: android_app module builds with a rust_ffi_shared dependency.
Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
2022-06-27 16:00:26 -04:00
Lukacs T. Berki
6c71676d6c Migrate sanitizers to transition mutators.
The logic is not 100% provably the same since HEAD was quite
confusing at some points, but I did make an effort to preserve
functional equivalence.

In case that effort was not enough, it should be pretty easy to
tweak the logic at HEAD since it's still quite malleable.

Bug: 231370928
Test: Presubmits.
Change-Id: I17b2efbfb5c4d0aedd922caed54ff8d857e578df
2022-06-18 06:20:28 +02:00
Chris Wailes
0a02aba00e rustc-1.61.0.p2 Build 8709792
Bug: https://issuetracker.google.com/issues/232437287
Bug: https://issuetracker.google.com/issues/216192129
Test: m rust
Change-Id: I84d4b9e70a53c0f057a286b77eb7dea6161c03a8
2022-06-13 12:05:33 -07:00
Treehugger Robot
fdc0540751 Merge "[rust/coverage] Use new flag for coverage instrumentation" 2022-06-07 23:44:02 +00:00