Commit graph

808 commits

Author SHA1 Message Date
Michael Bestas
36727b55ff
Replace device_kernel_headers with generated_kernel_headers
Change-Id: I54a969d63f9644f89a231d52f2ef0919edd5b784
2024-10-24 19:31:52 +02:00
Chirayu Desai
1c390cd216
Replace old-style kernel headers only when building inline
Change-Id: I71b891928a13771c176adc0eaa79b46503cb176f
2024-10-24 19:30:14 +02:00
Ricardo Cerqueira
3329a204d2
build: Squash of allowing a device to generically define its own headers
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   2011-04-12 10:57:22 +0100
    Allow a device to generically define its own headers

    We have a few cases of devices including specific versions of projects
    just because of modified headers (msm_mdp.h comes to mind), and I just
    had enough of ifdeffing header files for specific cases (the P990 needs
    a lot of these).
    Now... if a target defines a TARGET_SPECIFIC_HEADER_PATH, any headers in
    there will take precedence over the standard ones; for example, on the
    p990, I have

    TARGET_SPECIFIC_HEADER_PATH := device/lge/p990/include

    which makes, for example, the
    device/lge/p990/include/hardware_legacy/AudioHardwareInterface.h be
    used instead of
    hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h
    whenever a source file uses <hardware_legacy/AudioHardwareInterface.h>

    Change-Id: I41b62668b60e3f62a6ebd3738d8d2675103a81e6a

    build: fix target header overlay

    LOCAL_C_INCLUDES as defined by the makefile should be put AFTER
    the overlay includes so the overlay always takes precedence.

    Change-Id: I489b2aab6dbacd9122d834f85e07b63ed1271f07

Author: Jan Altensen <info@stricted.net>
Date:   2020-09-10 15:18:49 +0200
    soong: add TARGET_SPECIFIC_HEADER_PATH

    Change-Id: I582ae8e6e010016b33fd9b020b723e5fc2dc442b

Change-Id: I3c885fe504ce4f646001697119cffd674db9ec49
2024-10-24 19:28:26 +02:00
Rashed Abdel-Tawab
a6a4d684dc
build: Automatically replace old-style kernel header includes with new header lib
This is a combination of 3 commits.
This is the 1st commit message:

build: add kernel header dependency if module uses kernel headers

Many of the QCOM components use kernel headers, but don't declare
the dependency on them.  This is fine in CAF because of the way they
build the boot.img before anything else.  In CM, we don't build the
boot.img the same, so we run into a race between the kernel build &
these modules... and the modules lose.

Warn about modules that have this missing dependency, and add it for
them so we don't have to modify each Android.mk.

Change-Id: I95f1e47b5ef440f6f5d8f64a0c3f38d9572e839e

============================================================================
This is the commit message #2:

build: Switch kernel header inclusion

The build is switching to the target INSTALLED_KERNEL_HEADERS to
declare dependencies on kernel headers.

Change-Id: I913e74681b02dfcf1eaed3d1e47ff4ab2300b12d

============================================================================
This is the commit message #3:

build: Automatically replace old-style kernel header includes with new header lib

Since we do this via soong and the result is a header library, just replace all
legacy include paths that point to the old header location with calls to the new
header library. Since we no longer have the legacy include, we can also remove
the additional dependency.

This reverts commit fa798218e5b7f96e12ab3acc9d47a3f26a140777.

Change-Id: I716955534e50831e6568ca01e480aa8b90075d92
2024-10-24 19:25:32 +02:00
Florian Mayer
0349db6826 Use memtag_stack variants in make
Bug: 309446520
Change-Id: Ib67b37e97d9fabd2be3236d80a695c4883eccb7b
2024-05-01 10:41:09 -07:00
Aditya Kumar
9aa1265fbe Merge "Add CLANG_EXTERNAL_CFLAGS to both vendor and hardware directories" into main 2024-03-05 17:50:10 +00:00
AdityaK
3bf7c4fc22 Add CLANG_EXTERNAL_CFLAGS to both vendor and hardware directories
Bug: b/323229700

Change-Id: I0c6f8fbbc061e713ddacbd44018a07c478f27bf0
2024-03-01 14:59:59 -08:00
Kiyoung Kim
454265c233 Reapply "Rename LOCAL_USE_VNDK"
LOCAL_USE_VNDK property refers if the module uses VNDK, and this
property is being used to check if the module is installed in vendor or
product. However, the term no longer makes sense with VNDK deprecation,
so it should be renamed. Similar to change in aosp/2897612, rename
LOCAL_USE_VNDK as LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: I2da2e2027ccabbcfbb444abc6828addeb3b22e13
2024-02-05 11:01:41 +09:00
Kiyoung Kim
0bf6c284e0 Revert "Rename LOCAL_USE_VNDK"
Revert submission 2931430-local_use_vndk

Reason for revert: build fails with barbet targets

Reverted changes: /q/submissionid:2931430-local_use_vndk

Change-Id: I40277cfb26bb4da5dc398b99fc4ab009d91405fc
2024-02-02 08:06:57 +00:00
Kiyoung Kim
f4c9330e24 Rename LOCAL_USE_VNDK
LOCAL_USE_VNDK property refers if the module uses VNDK, and this
property is being used to check if the module is installed in vendor or
product. However, the term no longer makes sense with VNDK deprecation,
so it should be renamed. Similar to change in aosp/2897612, rename
LOCAL_USE_VNDK as LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: Icfd1707953eba2e29044468ab6728b39d7998048
2024-01-30 17:10:39 +09:00
Joey Jiao
946ca19d49 Enable clang coverage
This is to align with build/soong to support clang coverage.
- support env CLANG_COVERAGE and CLANG_COVERAGE_CONTINUOUS_MODE.
- support kill -37 signal to dump coverage.
- support build clang coverage together with hwasan.

Bug: 309894892
Change-Id: I14f75d7fdfdf872d2db3bbceb2c10d6572bcfebf
2024-01-04 13:48:33 -08:00
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