Commit Graph

5282 Commits

Author SHA1 Message Date
Rupert Shuttleworth 143be94016 Add temporary workaround for pack_relocations linker flag conversion for bp2build.
Test: added unit test
Test: bazel build //bionic/...
Change-Id: I28217026f5846820ea2cc32cf8790948a54a9365
2021-05-10 05:17:42 -04:00
Rupert Shuttleworth c50fa8dd05 Add support for shared_libs in cc_library targets.
Test: cd bp2build; go test

Test: bazel build //bionic/...

Test: ./build/bazel/scripts/run_presubmits.sh

Change-Id: I71e279470a0d69b243dd0a2b53ce31842fd36ee4
2021-05-10 03:35:32 -04:00
Elliott Hughes aa4c712989 Merge "Remove most of the remaining references to gccCmd." 2021-05-07 18:15:42 +00:00
Elliott Hughes 2e0436c7af Merge "Remove unused parts of the strip implementation." 2021-05-07 18:15:17 +00:00
Elliott Hughes b6788c0dc5 Remove most of the remaining references to gccCmd.
Bug: http://b/185257607
Bug: http://b/147452927
Test: treehugger
Change-Id: I5d2a8530b539811b9cb8147939b6adfaac115cc8
2021-05-06 12:25:56 -07:00
Elliott Hughes afcd339d96 Remove unused parts of the strip implementation.
The --use-gnu-strip option was removed from the shell script already,
and it no longer uses the $CROSS_COMPILE environment variable.

Bug: http://b/185257607
Bug: http://b/147452927
Test: treehugger
Change-Id: If9f7b75d52c1e9cd167d73eeba8f77054ffd63a7
2021-05-06 12:12:43 -07:00
Justin Yun 46f66059e9 Define test_min_vndk_version for cc_test
If a cc_test module defines test_options.test_min_vndk_version, the
test runs only if the ro.vndk.version of the device is defined as a
version code name or an integer value that is higher than or equal to
the value in the test_min_vndk_version proprety.

Also, move the existing test_min_api_level property to test_options
struct.

Bug: 186786268
Bug: 187258404
Test: manual test
Change-Id: I43f1cca5b60f102298726332d374e4b14c425948
2021-05-05 18:47:23 +09:00
Lukacs T. Berki 598dd00236 Refactor how bp2build gets arch-specific props.
Then plumb them to LabelAttribute.

This refactoring is required because the previous implementation did not
handle properties in shards other than the first one (e.g.
version_script) well. In addition, it also makes the code paths between
bp2build and analysis more similar.

Bug: 186650430
Test: Presubmits.
Change-Id: Ic4393e8ae47f4e88816bf45c89399efd61494d22
2021-05-05 09:00:01 +02:00
Treehugger Robot ee4e7fe76f Merge "bp2build: build static version of libstdc++." 2021-05-04 08:46:37 +00:00
Jingwen Chen 179856a69d bp2build: build static version of libstdc++.
This CL adds the ability to filter cc_library modules to only generate
their static variant of their shared variant isn't ready.

For example, the libstdc++ library is buildable as a static library,
which libc depends on. However, the shared variant of libstdc++ depends
on libc, which has to come later.

This CL introduces that abstraction to break up bp2build conversion into
more atomic steps to help with conversion.

Test: TH (bazel build //bionic/... incl. libstdc++'s static variant)
Bug: 186489250
Bug: 186822597

Change-Id: I3e2fe748e4e3d3b656760da4807f342d67c8f45f
2021-05-04 02:06:41 +00:00
David Srbecky 67f8051a86 Merge "Use create_minidebuginfo tool instead of bash script." 2021-05-03 15:42:01 +00:00
Treehugger Robot cbaef6ff0f Merge "Add debug ramdisk variant." 2021-05-02 23:54:40 +00:00
David Srbecky 69315e4ea7 Use create_minidebuginfo tool instead of bash script.
The behaviour is semantically identical, however,
the tool additionally sorts the symbols by address,
compresses frame unwind information more efficiently,
and improves random-accessibility for lazy decompression.

Overall, the changes balance and the output size is same,
however, libunwindstack can access the data much faster
while using less memory (due to the lazy decompression).
It will also enable further improvements in the future.

Bug: 110133331
Test: ART unwinding tests, run prefetto on the device.
Change-Id: Id48f9fe67fb67fcf2b90cc3b217b71bb8f5147ca
2021-05-01 00:06:07 +01:00
Lukacs T. Berki 1353e59690 Handle the version_script property.
Doesn't work when depends on arch/target/etc., but good enough for
libdl_android.

Bug: 186650430
Test: Presubmits.
Change-Id: Ib0facb41a89454717c74663e5e078aedd33d1b9c
2021-04-30 16:46:41 +02:00
Colin Cross e07056af41 Merge "Remove global state from vendor public libraries" 2021-04-29 16:16:42 +00:00
Inseob Kim 08758f08e9 Add debug ramdisk variant.
A module will be installed to /debug_ramdisk if debug_ramdisk is set to
true.

This is a reland of f84e9c05e2, with a fix
that removes /first_stage_ramdisk.

Bug: 184004542
Test: soong test
Change-Id: I739de63cfec6b0fec5a90f7c4741fc4d884d209c
2021-04-29 22:58:17 +09:00
Jingwen Chen 53681ef590 bp2build: make libdl build.
This CL adds support for the static and shared props, forwarding
whole_static_libs and srcs to the underlying shared library's
static_deps and static library's srcs respectively.

Test: TH
Fixes: 186609667
Change-Id: I84f838361c7758b256b2a163af894c502de03109
2021-04-29 08:59:02 +00:00
Colin Cross 5423a9c513 Merge "Remove obsolete llndk_library" 2021-04-28 23:25:06 +00:00
Paul Duffin f7c99f5983 Add GetEmbeddedPrebuilt and IsModulePrebuilt
Dedups the many repetitions of the code to obtain a *Prebuilt from a
module.

Bug: 177892522
Test: m nothing
Change-Id: I1ededbe9ee79e89ea6dd8882dfee4be0bf0b51b7
2021-04-28 14:02:04 +01:00
Colin Cross 09a2a2ce3a Merge "Remove llndk_headers" 2021-04-28 01:53:47 +00:00
Colin Cross 5271fea26c Remove global state from vendor public libraries
Remove the global list of vendor public library modules used to rewrite
dependencies from the vendor module to the stubs for system modules,
and replace it with building the stubs directly in the system variant
of the vendor module.

Bug: 178231622
Test: vendor_public_library_test.go
Change-Id: I826e69ffd507d7e85fa3d4d85b5157428c642143
2021-04-27 16:26:00 -07:00
Chris Parsons f60ecf081e Mixed builds: propagate includes from cc_* targets
This allows us to remove libasync_safe from the mixed builds denylist.

Test: mixed_libc.sh CI script
Change-Id: Ibafd231284864078bf30340f919d39e5098843ce
2021-04-27 15:04:37 -04:00
Colin Cross 8fb66f48c7 Merge "Add support for cc_library_headers to replace llndk_headers" 2021-04-27 16:40:48 +00:00
Colin Cross 4ba70ab48e Merge "Skip default dependencies for header libraries" 2021-04-27 16:40:37 +00:00
Jingwen Chen e32e9e07d7 bp2build: arch-specific exclude_srcs and srcs.
OS-specific exclude_srcs and srcs will be done in a follow-up, due to
complexities from merging multiple select statements together.

Test: TH
Bug: 186153868
Change-Id: I01b881e9a5a7cd41b4a507f8be7e9e65eab37bdc
2021-04-27 11:02:07 +00:00
Jingwen Chen 882bcc1c1c bp2build: remove header globs in generated srcs.
Not needed anymore for bp2build-incremental since https://android-review.googlesource.com/q/topic:no-include-check.

Not needed for mixed builds either, since cc compile actions aren't sandboxed.

Fixes: 186488830
Test: treehugger and go tests

Change-Id: Ib5d4908dcce6bf910a653c457bb251d726e717d4
2021-04-27 06:26:40 +00:00
Colin Cross 203b421043 Remove obsolete llndk_library
Remove llndk_library in favor of cc_library with llndk.symbol_file.

Bug: 170784825
Test: m checkbuild
Test: TestLlndkLibrary
Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
2021-04-26 18:41:00 -07:00
Colin Cross 627280f091 Remove llndk_headers
Replace llndk_headers with cc_library_headers with
llndk.llndk_headers: true.

Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Test: TestLlndkHeaders
Change-Id: I33b411cd4d474318796c2073375176b82dd8c216
2021-04-26 18:40:53 -07:00
Colin Cross 1f3f130e29 Add support for cc_library_headers to replace llndk_headers
Set llndk.llndk_headers: true to allow a cc_library_headers
module to be used by a cc_library module with llndk.symbol_file set.

Bug: 170784825
Test: TestLlndkHeaders
Change-Id: Ib65a4b70717dc9a54ae30f2991485bb1bb9b8409
2021-04-26 18:37:44 -07:00
Colin Cross be763f7b16 Skip default dependencies for header libraries
Header libraries don't compile anything, so they don't need the
default stl and libclang_rt dependencies.  Trimming the dependencies
simplifies using header libraries for LLNDK libraries, which need
extra variants that don't exist for the default dependencies.

Test: m checkbuild
Change-Id: Ib9864c3cc7048b2cc52acf304830777b65a51877
2021-04-26 18:23:45 -07:00
Colin Cross b719c0194e Fix and test vendor public libraries for product modules
Vendor public libraries are checked for product modules, but never
reached because the VNDK check occurs first, and wouldn't work anyways
because vendor_public_library did not have the product_available
property.  Reorder the rewrite checks and add VendorProperties, and
add a test.

Bug: 178231622
Test: vendor_public_library_test.go
Change-Id: Idbd2802fbd134d22c30600762cb0465633703506
2021-04-26 18:23:45 -07:00
Colin Cross f12db530d0 Move TestVendorPublicLibraries into vendor_public_library_test.go
Bug: 178231622
Test: TestVendorPublicLibraries
Change-Id: Ic57202a7e4e186483506ceca3125f3d6a855f3ff
2021-04-26 17:43:32 -07:00
Rupert Shuttleworth 375451edfe Add support for per-target exported includes.
Test: Added unit test
Change-Id: I8ab58ddc73c15d5ec0f515e43407542bd4e8081a
2021-04-26 07:49:08 -04:00
Treehugger Robot 459c532e44 Merge "Incorporate cc_library_headers into mixed builds" 2021-04-23 15:14:55 +00:00
Liz Kammer b6a55bf065 Incorporate cc_library_headers into mixed builds
Test: go soong tests
Test: bp2build generate & sync; mixed build libc; mixed build su (su is
      an Android.mk target that relies on converted a cc_library_headers)
Bug: 181552740
Change-Id: I9efd587970551fd41f642a208f0aa0a80e8694e0
2021-04-23 09:37:33 -04:00
Treehugger Robot 39e03144a0 Merge "Revert^3 "Add debug ramdisk variant"" 2021-04-23 13:09:24 +00:00
Colin Cross 7c6a485f64 Merge changes from topic "remove_llndk_library1"
* changes:
  Support cc_library as LLNDK without llndk_library
  Dedup include dir paths
2021-04-22 23:33:29 +00:00
Inseob Kim aeb6bad073 Revert^3 "Add debug ramdisk variant"
836a8f3d61

Change-Id: If59529238e26a197bc33b10245b88f538f280ed0
2021-04-22 23:14:58 +00:00
Florian Mayer 4d48aa5255 Merge "Revert^2 "Add debug ramdisk variant"" 2021-04-22 16:40:24 +00:00
Florian Mayer 836a8f3d61 Revert^2 "Add debug ramdisk variant"
78ea2f5eac

Change-Id: I6a6a2ee82e2807045364bab105ec03a1934b411f
2021-04-22 16:38:47 +00:00
Treehugger Robot f9c6744e28 Merge "Revert "Add debug ramdisk variant"" 2021-04-22 15:28:06 +00:00
Jingwen Chen ed9c17d033 bp2build: refactor/standardize cc_* bp2build converters
This CL refactors the cc* bp2build converters to use the common
attribute extractors in cc/bp2build.go.

This also adds include_build_directory to be handled by the compiler
attr extractor to generate recursive headers as inputs.

This also turns include_dirs and local_include_dirs into the
execroot-relative -I flags.

e.g. if a module in  bionic/libc has "private" in local_include_dirs,
the "-Ibionic/libc/private" copt is generated for it.

Fixes: 185139955

Test: TH
Test: Forrest for mixed_clean-droid
Change-Id: Ib67056482227e62068fbbea0455035bdf5d56319
2021-04-22 08:31:24 +00:00
Bowgo Tsai 78ea2f5eac Revert "Add debug ramdisk variant"
This reverts commit f84e9c05e2.

Because this breaks the usage of boot-debug.img and
vendor_boot-debug.img

Bug: 185970130
Bug: 185990198
Test: make bootimage_debug
Change-Id: I7886c971982faae1d5bc34688643de8d94d6e201
2021-04-22 09:49:24 +08:00
Elliott Hughes 7c0abf6f3c Merge "Move some make variables from GNU binutils to LLVM equivalents." 2021-04-21 22:59:09 +00:00
Elliott Hughes a960a0d5de Move some make variables from GNU binutils to LLVM equivalents.
There are others still to look at, but this set doesn't seem to break
anything for me.

Bug: http://b/147452927
Test: treehugger
Change-Id: I794684e23eee1326deb34bb4d5ed5831a47b8fa3
2021-04-21 10:22:55 -07:00
Colin Cross 0fb7fcd3a6 Support cc_library as LLNDK without llndk_library
Allow cc_library modules to configure themselves as an LLNDK library
using llndk.symbol_file instead of llndk_stubs pointing to an
llndk_library module.

Bug: 170784825
Test: TestEmbeddedLlndkLibrary
Change-Id: Id884cdada7094bbea6809a98e687e039778c5dc6
2021-04-20 22:24:11 -07:00
Jiyong Park 08bd0dd8c5 Merge "android_system_image that generates linker.config.pb" 2021-04-21 04:57:49 +00:00
Colin Cross c82e6e2e8f Dedup include dir paths
Remove duplicates from include dir paths before setting
FlagExporterInfoProvider.  Duplicates often occur, for example due to
inheriting export_include_dirs from the static variant of a library to
the shared variant of the library that also gets the same
export_include_dirs.

Test: m checkbuild
Change-Id: I71f9e841547db64cbabcd95288ee93ef21fab4fb
2021-04-20 18:22:58 -07:00
Jiyong Park fa616137a2 android_system_image that generates linker.config.pb
android_system_image module type is a specialization of the
android_filesystem module type. Currently, it adds a build rule for
creating linker.config.pb from the information about all the other files
in the filesystem and includes linker.config.pb to the filesystem as
well.

To do so, the filesystem module now provides a function pointer which
subtype modules like android_system_image can implement to pass extra
files that they want to package in the filesystem.

In addition, the linkerconfig package is revised to make it possible to
build linker.config.pb file outside of the package.

Bug: 185391776
Test: m microdroid and inspect etc/linker.config.pb in it.

Change-Id: Id89c40b519213062860d7306029b8413d8d36a2d
2021-04-21 09:11:21 +09:00
Elliott Hughes 2cb4cfc593 Merge "Move builder.go over to llvm-objcopy." 2021-04-20 21:30:58 +00:00