Commit graph

797 commits

Author SHA1 Message Date
Jooyung Han
358875fbe6 Pass LOCAL_MIN_SDK_VERSION to clang triple
Like soong modules, pass LOCAL_MIN_SDK_VERSION to clang when it's set.

Bug: 317676192
Test: manual check (set LOCAL_MIN_SDK_VERSION as 34 for wpa_supplicant
  and see if generated build commands has android34)
Change-Id: I48928e54417f47f2e0c2417f04e5893764c3edb9
2024-01-04 10:48:51 +09:00
Justin Yun
2c583744cb Define __ANDROID_VENDOR_API__
cc modules can use __ANDROID_VENDOR_API__ to read BOARD_API_LEVEL
that is the API level of the vendor surface.

Bug: 313822931
Test: check ninja commands to have -D__ANDROID_VENDOR_API__=<version>
Change-Id: I868b88ae72b4f60bc3d5ad567fbacd2222dd62d7
2023-11-30 05:30:48 +00:00
Colin Cross
710c3cb5fb Remove code related to unused LOCAL_* variables
LOCAL_JETIFIER_ENABLED, LOCAL_NO_PIC, LOCAL_PREBUILT_STRIP_COMMENTS,
LOCAL_RMTYPEDEFS, and *.vts sources are never used.  Remove them
and the code related to them.

Test: no change to out/build-aosp_cf_x86_64_phone.ninja
Change-Id: I2ca9e674602057cc163b8bc28b0c57a0b7cc4361
2023-11-02 10:45:33 -07:00
Colin Cross
34fe77a493 Removed unused license code
Nothing ever reads ALL_DEPS.*.LICENSE, and its an ever-growing list
that is sorted every time, which is extremely expensive.

notice_target is never set after I4cddf9a381a1258bdc2b1b42be72c447df10d234,
remove all the related code.

Test: no change to out/build-aosp_cf_x86_64_phone.ninja
Change-Id: I0fa6a46e62ef8aa78873b43d3064b57b1c54de51
2023-11-02 10:10:36 -07:00
Steven Moreland
78549acb47 BOARD_VNDK_VERSION must be set first pass
Removing all places that consider that this might not be
set.

Bug: 122954981
Test: build
Change-Id: I62107d041410f4ee1d3652e394ed5e7688c12f25
2023-06-07 20:57:38 +00:00
Dan Albert
1d7f51da6f Adapt to rearranged NDK sysroot.
Soong didn't have any explicit references to these paths because it
depends directly on the modules, but the make side of the build still
needs to construct these paths explicitly.

I removed a bunch of dead code that made the fix less obvious while I
was here.

Bug: None
Test: treehugger
Change-Id: I1a283a3bc98a94fc5481c869b3b0a4eacf69d859
2023-04-04 21:28:51 +00:00
zijunzhao
deaf24812d Add GLOBAL_CLANG_CFLAGS_64_NO_OVERRIDE support to Make
Bug: b/261642850
Test: Build and check warnings. Add two xfail tests in art and see the
results locally.

Change-Id: I122ee2cbfa37bdb71026781efe6cb7131b873ae0
2023-01-25 04:06:34 +00:00
Colin Cross
af7ac3986e Add basic musl support to make
There are still devices that set BUILD_BROKEN_USES_BUILD_HOST_* and
build host modules in Make.  Add basic support for building against
libc_musl in Make when USE_HOST_MUSL is set.

Bug: 258535366
Test: build a host tool defined in Android.mk file in internal branch
Change-Id: I9150be749bbeaac2ac5a33b2cf915004aa3033df
2022-11-09 16:40:25 -08:00
Brad Hinegardner
3e7f6b737c Revert "Fix typo"
Revert "Revert ^2 "Prevent unspecified values in soong_config_st..."

Revert submission 2262062-colefaust_soong_config_string_variable_2nd_try

Reason for revert: breaks builds, b/255996492 among others
Reverted Changes:
I3e2f59e5f:Fix typo
Id3bcd9a46:Revert ^2 "Prevent unspecified values in soong_con...

Change-Id: I9a9a150844c19eb8421575f5753b335f80ab6c66
2022-10-27 19:01:15 +00:00
Cole Faust
841ef28d32 Fix typo
build_test is only run on presubmit in internal master
for cls that change build/make and a few other repos,
but notably not build/soong. Add this cl to a topic
with a build/soong change we'd like to test with build_test.

Bug: 220375749
Test: Presubmits
Change-Id: I3e2f59e5f341cce486368dac9bf2f28f265e53fd
2022-10-26 11:24:06 -07:00
Kiyoung Kim
ad0d7710fe Replace dependencies from the Makefile to API imported modules
There are some module definitions in the Makefile, which needs to be
built with API imported module. This change replaces existing
dependencies from the Makefile, to append suffix on the reference, so it
can be linked to API imported modules.

Bug: 243736650
Test: 'ALLOW_MISSING_DEPENDENCIES=true m halutil' succeeded.
Change-Id: I12baa36e41c0c69228be5f0d08fb4c18eb8a22b1
2022-09-02 13:15:05 +09:00
Yi Kong
ee99ddf900 Rename modulesAddedWall to modulesWarningsAllowed
MODULES_ADDED_WALL is deceiving and it actually meant which modules are
allowed to have warnings (do not automatically append -Werror flag).

Test: presubmit
Bug: 233183337
Change-Id: Ia2eb972d3d76ba245840f9872cbcc66d2894dab3
2022-05-19 20:16:00 +08:00
Colin Cross
a1de5df4bd Remove ALL_GENERATED_SOURCES
ALL_GENERATED_SOURCES contains the generated sources of modules
defined in Make.  They always have a path inside the intermediates
directories.  The only readers of ALL_GENERATED_SOURCES are filtering
for files in the output directories, and will never match anything.

Test: m checkbuild
Change-Id: Ic9af8761d445fa90088f838c385bd2aea3bc3048
2022-03-22 09:25:58 -07:00
Pirama Arumuga Nainar
d6b0a87ed7 Add GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE to third-party code
Bug: http://b/215753485

This allows enabling a new warning from the compiler update for
first-party code.  This is less precise than the check in build/soong
(also overrides for vendor/google, for e.g.) because of being written in
Make.

Test: With new clang, verify the following:
    lunch oriole;
    m out/target/product/oriole/obj_arm/SHARED_LIBRARIES/libexynosdisplay_intermediates/libresource/ExynosMPP.o
Change-Id: I13080fec71e282c4b528a6d01b967b1c0c4aef02
2022-02-05 13:50:41 -08:00
Stephen Hines
d49aa55cf1 Remove all unused, legacy FDO build rules
There are no current users of this feature. All remaining references are
legacy scripts that aren't actually in-use today.

https://source.corp.google.com/search?q=BUILD_FDO_INSTRUMENT%20-file:build%2F
https://source.corp.google.com/search?q=LOCAL_FDO&ct=os&sq=package:%5Eandroid$

Test: build
Change-Id: I86ff6531a0868fb8e30741f0d04de1739fba4586
2021-04-05 17:13:00 -07:00
Ryan Prichard
6d74870a67 Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 9cd4aff304.

Bug: http://b/153025717
Test: treehugger
Change-Id: I548ca3dd5bdddb52199b4b5e1455832ee1d28125
2021-03-31 15:33:35 -07:00
Ryan Prichard
9cd4aff304 Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 85a1213232.

Reason for revert: b/184095989

Change-Id: I4643a7bb2fea6411d7c673ec4017fdbab6070b9d
2021-03-31 03:25:26 +00:00
Ryan Prichard
85a1213232 Switch platform-NDK unwinder to LLVM libunwind.a prebuilt
Link against the libunwind.a shipped with the NDK so it matches what's
linked into the NDK's libc++_shared.so.

For arm32, binary.mk and cxx_stl_setup.mk had been adding two different
versions of the LLVM unwinder to the same linker command-line. Remove
the duplicate one from cxx_stl_setup.mk.

-Wl,--exclude-libs is now unnecessary because the symbols are marked
hidden in the archive itself.

Bug: http://b/153025717
Test: device boots, manually inspect some linker command lines
Change-Id: Ie7182bd565014348b16448976dc6587d2885ba99
2021-03-22 14:00:59 -07:00
Justin Yun
69f7191d5d Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__
__ANDROID_VNDK__ is defined for the modules that are able to use the
VNDK libraries. As both product and vendor variants define
__ANDROID_VNDK__, we don't know if a module is built for vendor or
product on build time.

__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to
specify the image-variant-dependent codes.

Bug: 180646847
Test: m nothing
Change-Id: I9a37607b1e1e4e16eab02fb6c96d1a92158c96b8
2021-03-15 18:17:35 +09:00
Orion Hodson
ea7db8120e Remove implicit include path for jni.h
Bug: 152482542
Test: m checkbuild
Change-Id: I1479c35005033f60fb8f3a22bfabc3ee05d48b33
2020-09-24 14:43:26 +01:00
Treehugger Robot
14350c575f Merge "Use the soong-built NDK CRT objects." 2020-08-12 22:01:27 +00:00
Treehugger Robot
5610430667 Merge "Don't use the remote pool when using clang-tidy" 2020-08-06 19:27:17 +00:00
Dan Willemsen
ceba3cb656 Don't use the remote pool when using clang-tidy
In Make, clang-tidy and clang run in the same action, but only clang can
be remoted via RBE/GOMA. So to prevent running up to 500 clang-tidy
instances at the same time and overloading the machine, use the local
pool when using clang-tidy. This does limit the parallelism of the clang
actions attached to clang-tidy, but hopefully that's not that much of a
problem. Clang-tidy isn't enabled by default (opt-in per-build /
per-module), and Soong does not run into this problem.

Bug: 162615762
Test: m WITH_TIDY=1 nothing; build-aosp_flame.ninja is identical before/after
Test: use_rbe m WITH_TIDY=1; inspect build-aosp_flame.ninja, see local_pool
Change-Id: I7dd196fcf4183d175b9608d3d48cdcdf81b514ce
Merged-In: I7dd196fcf4183d175b9608d3d48cdcdf81b514ce
2020-08-06 18:44:25 +00:00
Inseob Kim
8b0ccdafbb Separate lists of soong sanitize modules
Dependencies of makefile modules are being redirected according to
SOONG_CFI_STATIC_LIBRARIES and SOONG_HWASAN_STATIC_LIBRARIES. But the
variables are shared among all variants (e.g. core, vendor, product,
arch), which can cause build error.

This splits the Makefile variables into several lists, one list per each
arch and each image variant, to correctly make the redirection.

Bug: 162476652
Test: build and inspect ninja
Change-Id: I8a46804d4b7c1c485e59e10710cc514a89333fa4
2020-08-04 17:18:01 +09:00
Kevin Lau Fang
c45b82c23b Update binary.mk language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 162241205
2020-07-29 22:16:49 +00:00
Dan Albert
f9f035de19 Use the soong-built NDK CRT objects.
Test: treehugger
Bug: http://b/159925977
Change-Id: I9f0109ccd6c5ccd8c4ff0eaf6b34e5004db86161
2020-07-17 15:23:57 -07:00
Joe Onorato
02fb89a4d7 Add mk2bp_catalog.py that outputs more data about makefiles to be converted to soong.
- Adds makefile and which files are installed to the SOONG_CONV CSV file
- Updates soong_to_convert.py to be able to parse that
- Adds new script that is more detailed.
- Outputs that file as part of the droidcore build to
  $(OUT_DIR)/target/product/$(TARGET_DEVICE)/mk2bp_remaining.html

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/mk2bp_remaining.html
Change-Id: I7c380b6070754f4329bf3965595751e4dac794a0
2020-07-16 18:19:15 -07:00
Roland Levillain
cd80a6afea Turn COVERAGE_PATHS and COVERAGE_EXCLUDE_PATHS into obsolete variables.
(cherry picked from commit c276bf4f3cc72e479d21c7bd0b34673d93e76f9a)

Test: m nothing
Bug: 158212027
Change-Id: Ibc0dbfd21465ab6fc5b826a52bf605910af283e7
Merged-In: Ibc0dbfd21465ab6fc5b826a52bf605910af283e7
2020-07-08 12:56:29 +01:00
Dan Albert
016da58c3c Dedup lists of NDK libraries from Soong.
Test: treehugger
Bug: None
Change-Id: I56bca0e8dc6d42a7107ac421d0b608a533e38580
2020-06-30 12:46:41 -07:00
Roland Levillain
d160a49df3 Merge "Rename native code coverage paths product variables in Make." 2020-06-15 10:12:10 +00:00
Roland Levillain
bad8b386e6 Rename native code coverage paths product variables in Make.
Rename `CoveragePath` and `CoverageExcludePaths` as
`NativeCoveragePath` and `NativeCoverageExcludePaths` (resp.).
Also, populate `NativeCoveragePath` and `NativeCoverageExcludePaths`
from environment variables `NATIVE_COVERAGE_PATHS` and
`NATIVE_COVERAGE_EXCLUDE_PATHS` (resp.).

Test: m nothing
Bug: 158212027
Change-Id: I409dbb04b09744a7bd95a4b69361e858b9f89e23
2020-06-14 19:14:56 +01:00
Colin Cross
c3ad80467e Use inclusive language in build/make
Test: m checkbuild
Change-Id: I54a7e55d3fdd5571ef1ae33ebe443c10d138fd28
2020-06-11 14:37:54 -07:00
Dan Willemsen
fd1e67b8ce More performance improvements
Instead of using `x := $(x) foo`, make sure `x` is initialized first,
then use `x += foo`.

For a aosp-master/aosp_crosshatch-userdebug build, this takes the build
from 49s to 33s (no significant difference in peak memory)

Bug: 158488548
Test: build-aosp_crosshatch.ninja is the same before/after
Change-Id: I41fb7611030dd3ba824f896a9c9eadbdd218f464
2020-06-08 19:10:23 -07:00
Dan Willemsen
e6bd1d2060 Remove TARGET_PROJECT[_SYSTEM]_INCLUDES
Everything should be getting device specific kernel headers from the
device_kernel_headers header library these days.

This does change the behavior of system libraries on devices using the
VNDK -- they no longer get device-specific kernel headers by default, as
we generally expect the system image to be device-independent. The few
libraries that may still need this can use:

 LOCAL_HEADER_LIBRARIES += device_kernel_headers

Test: treehugger
Change-Id: I90ccb921d58b8d27dd0118a974202696e0af745f
2020-05-01 17:43:45 -07:00
Colin Cross
e0c5e44360 Revert "Revert "Use sdk variant of Soong modules when LOCAL_SDK_..."
Revert^2 "Add sdk mutator for native modules"

f8e80229fedb47302e9cfd32990859a6308020cf

Change-Id: Ib686b52339ae5031434a2fb6a0e7f5b0c0dc5641
2020-04-07 16:50:32 +00:00
Colin Cross
79e5a55122 Revert "Use sdk variant of Soong modules when LOCAL_SDK_VERSION ..."
Revert "Add sdk mutator for native modules"

Revert submission 1242911-sdk_version_variant

Reason for revert: b/153394225
Reverted Changes:
Ife99745fb:Use libnativewindow for platform variant of libagq...
I1bae84c43:Use libnativewindow for platform variant of androi...
I6e6021ed3:Use stl to depend on libc++
Ife99745fb:Use libnativewindow for platform variant of libRSS...
I2c9f439b9:Fix static dependency on libprotobuf-cpp-lite-ndk
Iff2aff9cf:Set sdk_version for cc_genrules used by modules wi...
I7d72934aa:Add sdk mutator for native modules
Ief378a007:Use sdk variant of Soong modules when LOCAL_SDK_VE...

Bug: 149591340
Change-Id: I6cd4de221ece29e48d58a8b1297dc2512b2dad13
Fixes: 153394225
2020-04-07 04:21:21 +00:00
Colin Cross
b934116994 Use sdk variant of Soong modules when LOCAL_SDK_VERSION is set
Soong now makes a variant of native modules that set sdk_version.
Use the new variant for native modules or apps with JNI that are
defined in Make and set LOCAL_SDK_VERSION.

Test: m checkbuild
Bug: 149591340
Change-Id: Ief378a007e43b0aea31fd5845410bbffec0ffae6
2020-03-24 10:48:24 -07:00
Elliott Hughes
f71c05a8e5 Remove unused mips workarounds.
This was never really finished, and hasn't been supported for years.

Test: treehugger
Change-Id: I7668088d1449f33025aaf36fae0817894c84a877
2020-03-06 16:46:59 -08:00
Ivan Lozano
3cd1ebeaee Remove execute-only support.
With kernel support being removed for execute-only memory layouts,
remove support for XOM until there's kernel support again.

This allows us to gain the code-size improvements from
"-z noseparate-code".

Bug: 147300048
Test: Compiled binaries no longer marked XOM by default.

Change-Id: I08a054e903b202f513d3b3381afd606bb87cf257
2020-02-13 14:20:28 -05:00
Inseob Kim
f0cec69de9 Implement BOARD_VNDK_VERSION
This allows BOARD_VNDK_VERSION to be set to old versions. With VNDK
snapshot and vendor snapshot installed, newer system and older vendor
image can be built in the same time.

Bug: 65377115
Test: 1) VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk vendor-snapshot
Test: 2) install snapshot under source tree
Test: 3) set BOARD_VNDK_VERSION and boot cuttlefish
Change-Id: Ic5fefc8bcb866584b27f021a429cb6670a2e3048
2020-01-23 12:52:25 +00:00
Justin Yun
2bfe0a1a25 Restore "Linktype check for native:product"
Similar to native:vendor, native:product can use VNDK libs but not
vndk_private.
It is activated when PRODUCT_PRODUCT_VNDK_VERSION is set.

This restores the reverted commit
4e7e76fe5a (aosp/1197274).
The problem of the original CL was assuming no modules have both
LOCAL_PRODUCT_MODULE and LOCAL_USE_VNDK in the old implementations.
But many vendor modules in the targets without setting
PRODUCT_PRODUCT_VNDK_VERSION in old branches had both flags that
caused link failures.
To make it no-op without PRODUCT_PRODUCT_VNDK_VERSION, I defined
LOCAL_USE_VNDK_PRODUCT that is set to true if
PRODUCT_PRODUCT_VNDK_VERSION is defined and LOCAL_PRODUCT_MODULE is
true.

Bug: 146620523
Test: build with PRODUCT_PRODUCT_VNDK_VERSION := current
Change-Id: I344c7dc1c47f08706c101e486ff07c3f10aff8ac
2020-01-22 00:16:25 +00:00
Justin Yun
dd5401713c Revert "Linktype check for native:product"
This reverts commit 4e7e76fe5a.

Reason for revert: build breaks (bid: 6147225) and postsubmit test fails.
There are some modules that have both "product_specific: true" and "vendor_available: true", which tags the module as "native:product" unintentionally.
We need to clean up these cases first and revisit this CL.

Bug: 146620523
Bug: 147987741
Change-Id: Ib07543235d72a135b6b732aaa909c147d2df832b
2020-01-20 07:39:41 +00:00
Justin Yun
4e7e76fe5a Linktype check for native:product
Similar to native:vendor, native:product can use VNDK libs but not
vndk_private.
It is activated when PRODUCT_PRODUCT_VNDK_VERSION is set.

Bug: 146620523
Test: build with PRODUCT_PRODUCT_VNDK_VERSION := current
Change-Id: Icfd94dfc30e77581991799d9e2f408f57da22cea
2020-01-19 23:46:47 +00:00
Dan Willemsen
38dc09d39a Use our prebuilt M4 for flex and bison
And ensure we've got all the proper dependencies.

Bug: 117561006
Test: treehugger
Change-Id: Ia9690b2c0d73a48744c8e33fe83196d02b1e904d
2020-01-08 22:31:12 -08:00
Nick Desaulniers
9882f6f7be build: make: use -Wl,-z,separate-code w/ -Wl,--execute-only
Also, prefer
-Wl,--execute-only
rather than
-Wl,-execute-only

Bug: 139945549
Bug: 146144180
Test: m
Change-Id: I4a07978c7a84a0a7e841b9e059305b0f443d0e95
Suggested-by: Ryan Prichard <rprichard@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-12-16 09:55:05 -08:00
Treehugger Robot
9e0b4ed82a Merge "Improve checks for include dirs outside the source tree" 2019-12-06 21:49:25 +00:00
Ivan Lozano
deaf3fc74a Merge "Exclude dirs from binder interface whitelisting" 2019-12-06 02:25:10 +00:00
Dan Willemsen
0cb422f0e7 Improve checks for include dirs outside the source tree
See the Changes.md addition for more details.

Test: treehugger (build_test on downstream branches)
Change-Id: I6ad6b454a6fccf93772fda26cfc7dd6bbfc07c40
2019-12-05 13:11:04 -08:00
Ivan Lozano
b18979aa20 Exclude dirs from binder interface whitelisting
Exclude vendor/ and hardware/ from the manually written binder interface
whitelist.

Bug: 136279235
Test: interfaces in excluded directories are not checked against whitelist.
Change-Id: I71152995466a25e92b6d0b153538ebfc1b252f5b
2019-12-05 12:09:38 -08:00
Yifan Hong
88adfc6349 Mark BOARD_HAL_STATIC_LIBRARIES as obsolete.
No device in our tree use this obsolete thing now.
OEM devices with libhealthd should define health HAL
2.1 instead.

Test: builds
Fixes: 127677771
Change-Id: I1861452a3f7fc97ee20615c8f9f25422f9f507e2
2019-12-04 14:50:59 -08:00