Commit graph

7684 commits

Author SHA1 Message Date
Elliott Hughes
9f0c951862 Remove a flag from riscv64 that was copied from arm64.
This causes us to align the text section to 4KiB, not just the data
section. From the bug that added this for arm64, there was an admission
that it costs 17MiB across the tree, and a not entirely convincing claim
of a performance improvement (undermined by the fact that "some stuff
was faster, some stuff was slower"). See http://b/150506341 for that.

Anyway, let's assume we don't want this for riscv64 for now.

Test: `mm -j` in bionic and readelf on the resulting libtest_empty.so
Change-Id: I0ed592a97ef705175191d9c66271a599af4eb18f
2022-11-15 00:56:04 +00:00
Kiyoung Kim
7cc632d3d6 Merge "Make variant headers as arch variant" 2022-11-14 01:01:59 +00:00
Elliott Hughes
35b83adeae Merge "Revert "Disable stripping for riscv64"" 2022-11-11 20:59:45 +00:00
Vinh Tran
59834cc56d Merge "Remove AfdoAdditionalProfileDirs product variable" 2022-11-11 13:26:49 +00:00
Hsin-Yi Chen
06223aed5e Merge "Fix the condition for LLNDK ABI diff" 2022-11-11 06:02:09 +00:00
Kiyoung Kim
3d776f4e66 Make variant headers as arch variant
Make cc_api_variant's header property as arch variant, so headers can be
differed by arch variant

Bug: 244244438
Test: Panther vendorimage build succeeded
Change-Id: I400301793209c9e0214fc118cd4981194d507fbd
2022-11-11 12:59:21 +09:00
Vinh Tran
7a8362c252 Remove AfdoAdditionalProfileDirs product variable
AfdoAdditionalProfileDirs is unconnected to build/make/core/soong_config.mk and is currently unused. Removing AfdoAdditionalProfileDirs will cut down on complexity when we migrate the support of auto-fdo profiles to Bazel cc rules.

b/258684450 proposes an alternative to support the use cases that were meant to be supported by AfdoAdditionalProfileDirs.

Test: existing go tests
Bug: 253540178
Change-Id: I024e48598a560717a1d6c19b16bde3fe65ff1961
2022-11-11 03:29:31 +00:00
Elliott Hughes
8cf3236519 Revert "Disable stripping for riscv64"
This reverts commit 1deeade634.

Reason for revert: create_minidebuginfo is fixed now.

Change-Id: I0cd6136b74d4af0e8a6b9718f6b7172b14522743
2022-11-11 00:59:14 +00:00
Wei Li
877336cc3a Merge "Fix the git_master_bazel mixed build breakage." 2022-11-10 21:22:56 +00:00
Sam Delmerico
1bde1cb668 Merge changes from topics "bp2build-tidy-disabled-srcs", "bp2build-tidy-timeout-srcs"
* changes:
  bp2build for tidy_timeout_srcs
  bp2build for tidy_disabled_srcs
2022-11-10 16:27:24 +00:00
Hsin-Yi Chen
7584bda227 Fix the condition for LLNDK ABI diff
IsLlndk() returns whether the library is an LLNDK stub. The ABI check
should identify LLNDK implementation by isImplementationForLLNDKPublic().

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      && make
Bug: 227282691
Change-Id: I570871e24d9029992a722b3052f8bb6e7f3c0f52
2022-11-10 16:29:44 +08:00
Wei Li
0643c4ebb5 Fix the git_master_bazel mixed build breakage.
There is no cflags defined for cortex-a9 CPU variant, set it to ArmGenericCflags to fix the mixed build breakage for now.

Bug: 258397103
Test: m com.android.build --bazel-mode-staging
Change-Id: I79a9877846ced6334c09a4f5caf115c436f600e6
2022-11-09 22:43:53 -08:00
Treehugger Robot
01dd619766 Merge changes from topic "clang-tidy-mixed-builds"
* changes:
  add tidy files to mixed builds
  add --norun_validations to bazel build action
2022-11-10 01:00:15 +00:00
Spandan Das
a8fff19350 Merge "Do not glob headers in out/" 2022-11-09 19:27:58 +00:00
Sam Delmerico
9a9f652bdd add tidy files to mixed builds
Bug: 195029134
Test: m --bazel-mode-dev
Change-Id: I6fa370334c6ff2b6ae4313a7fcbaa34b16b0fa92
2022-11-09 10:12:00 -05:00
Treehugger Robot
492a8b1dee Merge "CcApiLibrary Variants for LLNDK" 2022-11-09 02:36:26 +00:00
Liz Kammer
ecc659cc14 Add test for static lib that specifies san
Test: golang tests
Change-Id: Ifd54f3e36f7091e16efbc2fc147b6a3a116ab01c
2022-11-08 17:25:39 -05:00
Sam Delmerico
4c902d696a bp2build for tidy_timeout_srcs
Bug: 195029134
Test: m bp2build
Change-Id: I59fdc16d8c224f42167e3b5a3857f4ff2f546825
2022-11-08 17:18:52 -05:00
Sam Delmerico
c9b8fbdda0 bp2build for tidy_disabled_srcs
Bug: 195029134
Test: m bp2build
Change-Id: I9591439213dbf0ef68cd33151b3e32f6f6c68551
2022-11-08 17:17:52 -05:00
Kiyoung Kim
ee58c93075 CcApiLibrary Variants for LLNDK
Define CcApiLibrary Variants for LLNDK. Each variant will be defined as
below.

cc_api_variant {
  name: "libc",
  variant: "llndk",
  arch: {
    x86_64: {
      src: "libs/x86_64/libc.so",
    },
    ...
  },
}

And CcApiLibrary will be marked to use this variant as below.

cc_api_library {
  name: "libc",
  ...
  variants: [
    "llndk",
    ...
  ]
}

Soong will replace source of libc cc_api_library as src from
cc_api_variant during build time.

Bug: 244244438
Test: cf vendor build succeeded with LLNDK variants
Change-Id: I317ed1f558beb1f82f9f2d70811fa8f765bcad2b
2022-11-08 12:57:08 +09:00
Treehugger Robot
5ed292ade1 Merge "Remove deprecated experimental-new-pass-manager flag." 2022-11-03 22:01:12 +00:00
Treehugger Robot
d704f6ad69 Merge "Fix error handling" 2022-11-03 19:29:13 +00:00
Mitch Phillips
bbebe7f5a4 Remove deprecated experimental-new-pass-manager flag.
https://reviews.llvm.org/D136789 removed this flag, it's been a no-op
since 15.0.0. The current Android compiler is 15.0.3, but upcoming
compilers will error on the fact that this flag doesn't exist any more.

Change-Id: I54666175b521ed5cdd76c53ed700ad4ddf6931da
Test: make
Bug: N/A
2022-11-03 18:04:21 +00:00
Spandan Das
925cb2a822 Do not glob headers in out/
Currently, it skips it for files in out/soong/. This was a valid
assumption since all intermediate artifacts in soong are placed under
out/soong, and soong modules cannot depend on make modules.

However, this might change in multitree, since the headers provided by
build orchestrator will be under out/api_surfaces (next CL in this stack). The good side effect
of this is that we do not retrigger a rebuild of soong/build.ninja if a
new API file (.h/.map.txt) is added to this directory (ctx.GlobWithDeps
adds the files to the deps of out/soong/build.ninja).

Test: TH
Change-Id: I3c3722390d04a50d793b1646df00cdf7acb12b49
2022-11-03 16:34:12 +00:00
Kris Alder
38e14242fe Merge "add ../../lib to rpath for vendor fuzz targets" 2022-11-03 16:09:51 +00:00
Treehugger Robot
95a3752ab1 Merge "cc_fuzz targets depend on fuzz_interceptors for HWASan builds" 2022-11-02 21:57:20 +00:00
Kris Alder
c263481f28 add ../../lib to rpath for vendor fuzz targets
For "normal" fuzz targets, the binary goes in
/data/fuzz/<arch>/<fuzzer_name>/fuzzer_name>
with libraries in
/data/fuzz/<arch>/lib/

If 'vendor: true' is set, the fuzz target binary get placed in
/data/fuzz/<arch>/<fuzzer_name>/vendor/<fuzzer_name>.

We need an extra '..' in the rpath to link to the included libraries
correctly.

Bug: 254723623
Test: built libsrtp2-fuzzer, checked linking with ldd
Change-Id: I24282d7b252142ed795a6091fece2d56125329dc
2022-11-02 13:46:51 -07:00
Kris Alder
d406da104b cc_fuzz targets depend on fuzz_interceptors for HWASan builds
This allows us fuzzers to get coverage feedback and mutate more
intelligently based on feedback from strcmp, memcpy, and similar
functions.

Bug: 208297094
Test: make and run 'example_fuzzer', build 'haiku'
Change-Id: Ic51c207f8644cda885fb3f453cc583e2ee1e8c1d
2022-11-02 11:25:59 -07:00
Alan Stokes
73d3245e30 Fix error handling
We log an error message, but then carry on and attempt to use the invalid impl, which then panics.

Change-Id: I440cdf728cb32479a10cbaecc5aadbdd97f215de
2022-11-01 14:05:13 +00:00
Sam Delmerico
14f9f10a4e Merge "add comment to sync Bazel clang-tidy rules" 2022-10-31 18:55:24 +00:00
Sam Delmerico
13fbf4ac83 add comment to sync Bazel clang-tidy rules
The Bazel rules now have a separate implementation of the logic to
add flags to clang-tidy. This should be kept up to date with the Soong
implementation.

Bug: 195029134
Change-Id: I61efda081bf1627d352887b13a70d1d53944d368
2022-10-31 14:43:27 -04:00
Sam Delmerico
8604df6fb1 Merge "export clang-tidy variables to soong_injection" 2022-10-31 17:23:19 +00:00
Spandan Das
e1ef88c197 Merge "Assemble API surface headers before compiling rdeps" 2022-10-31 16:53:17 +00:00
Sam Delmerico
2b8462997a Merge "add clang_tidy properties to bp2build" 2022-10-31 14:49:21 +00:00
Yabin Cui
9b019134c2 Merge "Prepare to build clang-r475365" 2022-10-28 17:53:35 +00:00
Yabin Cui
0ebe7c8eb3 Prepare to build clang-r475365
Allow single-bit-bitfield-constant-conversion warnings to pass
with r475365.

Bug: 253033919
Test: run test_compiler.py
Change-Id: Icc1f1c6c013418f1e5bb839ef70ebe8498b9cedc
2022-10-27 15:55:03 -07:00
Hsin-Yi Chen
d2079b646c Enable ABI diff between the source code and the previous version
This commit removes "-advice-only from" the command of cross-version ABI
diff. The ABI changes that are incompatible with the previous version
are propagated as build errors. The developers need to follow the
error message to resolve the ABI difference.

Test: make
Bug: 244520027
Change-Id: Ic6e7757d2b35b619afcc8f50c892d1cfe989c800
2022-10-27 18:03:09 +08:00
Spandan Das
a3c8a175ca Assemble API surface headers before compiling rdeps
The current combined multi-tree build graph is not accurate. A vendor.c
file currently does not have a dependency on the assembled .h file in
multi-tree out. Previous successful builds of
`multitree_build vendor/vendorimage` were a happy
coincidence (presumably because the actions which copy the .h files from
a speciific inner tree to out/ are at the bottom of the build graph).

Fix this by exporting `cc_api_library.src` to be an order only
dependency of its rdeps (both compile and link). Making an .so file an
order only dependency of _compilation_ is probably confusing, but I
think it will be less confusing than the other alternative I could think
of (creating .timestamp files for each api_surface include dir and
creating phony targets to make them available from top-level to chdir'd
inner tree)

Test: go test ./cc
Test: orchestrator/prebuilts/build-tools/linux-x86/bin/nsjail --config
out/nsjail.cfg --
orchestrator/prebuilts/build-tools/linux-x86/bin/ninja -f
out/multitree.ninja -t path
vendor/out/soong/.intermediates/external/angle/angle_common/android_arm64_armv8-a_cortex-a53_static/obj/external/angle/src/common/android_util.o
out/api_surfaces/vendorapi/current/libc/libc_headers.contribution.androidos_include/features.h

(Path did not exist before this CL)

Change-Id: I74391100f2108993448004019eeba6456af0c12a
2022-10-26 21:10:44 +00:00
Sam Delmerico
b9b6c6773e export clang-tidy variables to soong_injection
Change-Id: If6470c35f5ee8f4867177d641640cdc2806de574
2022-10-25 15:55:17 -04:00
Sam Delmerico
fb3bb32bff add clang_tidy properties to bp2build
Bug: 195029134
Test: m bp2build
Change-Id: I9ca2436ef792911be72788b6640287726a609e2f
2022-10-25 15:55:06 -04:00
Kiyoung Kim
11d9108cc7 Replace with stubs only for Android non-native-bridge targets
Host tools and native-bridge targets should be built on top of original
module rather than stubs. This change updates DepsMutator not to replace
to API surface stubs if target is not Android or target is
native-bridge.

Bug: N/A
Test: CF vendor build succeeded
Change-Id: I97eb98d9e63dcf15632468aa32211a14d48986a0
2022-10-25 04:04:20 +00:00
Treehugger Robot
1227abee34 Merge changes from topic "api_library_missing_deps"
* changes:
  Do not register missing deps
  Skip existence check for stub library files
2022-10-25 03:12:07 +00:00
Treehugger Robot
2238c73723 Merge "Export all constants for linux_bionic" 2022-10-24 20:06:48 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
c4d11bc470 Export all constants for linux_bionic
They need to be referenced in adding a `linux_bionic` Bazel cc_toolchain

Test: CI
Bug: 205771732
Change-Id: I5469eac5559cdf76e02fdeccaf496e5ffcc1b08e
2022-10-24 18:08:56 +00:00
Spandan Das
c6c10fa34f Do not register missing deps
This is a fix to aosp/2260763 and skips the existence check corectly.
Previously, it would not throw an exception during Soong analysis, but
would add the path to a `MissingDeps` object. The ninja graph generated
using this would throw an exception during ninja execution.

We should not do this check for `cc_api_library`. The prebuilt
library.so is missing in the build graph of the inner tree (expected),
but it will be present when the orchestrator creates the combined
multi-tree ninja graph.

Test: rm -rf out && multitree_build vendor/vendorimage
(I did not clean out/ in aosp/2260763, and therefore did not catch this
earlier)
Test: go test ./cc

Change-Id: I68d245acae3bfb777bfc8a72fb7cd4909cb0a289
2022-10-22 02:26:30 +00:00
Krzysztof Kosiński
e0774afdd0 Merge "Globally enable -Wdefaulted-function-deleted." 2022-10-21 04:29:12 +00:00
Treehugger Robot
26e62c8d74 Merge "Set -fno-emulated-tls for riscv64" 2022-10-21 03:31:38 +00:00
Colin Cross
e127b4d060 Merge "Disable LTO and CFI for riscv64" 2022-10-20 23:47:54 +00:00
Colin Cross
7c376043e0 Merge "Use static libclang_rt.ubsan_standalone runtime for musl" 2022-10-20 21:53:58 +00:00
Colin Cross
2c435a00ff Set -fno-emulated-tls for riscv64
Building for riscv64 fails with link errors on __thread variables.
Set -fno-emulated-tls to fix it.

Bug: 254713216
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true ndk_sysroot
Change-Id: I3dca81dfd277d681b6c868a5e8385e3a37335a5f
2022-10-20 14:31:24 -07:00