From 3340cf27f76a94b1536e66e5847b11e334c97b85 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 11 Sep 2024 16:51:10 +0000 Subject: [PATCH 1/8] Use -target-feature for MTE This combines with other features. Bug: 366222162 Change-Id: I74bab7e725eaa856d183987fa682f2ab0903ce70 --- core/config_sanitizers.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index ab2d5c1ddf..c0f2c6893f 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -284,9 +284,9 @@ endif ifneq ($(filter memtag_stack,$(my_sanitize)),) my_cflags += -fsanitize=memtag-stack my_ldflags += -fsanitize=memtag-stack - my_cflags += -march=armv8a+memtag - my_ldflags += -march=armv8a+memtag - my_asflags += -march=armv8a+memtag + my_cflags += -Xclang -target-feature -Xclang +mte + my_ldflags += -Xclang -target-feature -Xclang +mte + my_asflags += -Xclang -target-feature -Xclang +mte my_sanitize := $(filter-out memtag_stack,$(my_sanitize)) endif From 0d5776f88791fefdf1110442f744766d9d1efab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Thu, 19 Sep 2024 00:06:33 +0000 Subject: [PATCH 2/8] Add required makefile for ARMv9.2-A. Bug: 364383722 Test: presubmit, internal build for relevant device Change-Id: I7ab3ab54e946a40d6c69c0bc1234d4032c89370e --- core/combo/arch/arm64/armv9-2a.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 core/combo/arch/arm64/armv9-2a.mk diff --git a/core/combo/arch/arm64/armv9-2a.mk b/core/combo/arch/arm64/armv9-2a.mk new file mode 100644 index 0000000000..69ffde014b --- /dev/null +++ b/core/combo/arch/arm64/armv9-2a.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# .mk file required to support build for the ARMv9.2-A arch variant. +# The file just needs to be present, it does not need to contain anything. From ac740c3ef948093bb9d9e4a37e0e3714582067a8 Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Fri, 20 Sep 2024 00:33:25 +0900 Subject: [PATCH 3/8] Update OWNERS for allowlist Bug: n/a Test: n/a Change-Id: I7a186fbc89d5edf75efc76791e554c67bc02ef75 --- tools/filelistdiff/OWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/filelistdiff/OWNERS diff --git a/tools/filelistdiff/OWNERS b/tools/filelistdiff/OWNERS new file mode 100644 index 0000000000..690fb178fc --- /dev/null +++ b/tools/filelistdiff/OWNERS @@ -0,0 +1 @@ +per-file allowlist = justinyun@google.com, jeongik@google.com, kiyoungkim@google.com, inseob@google.com From 6bfe51ae53137dc87ca23563febfa9e59adff28c Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Thu, 19 Sep 2024 17:02:01 +0000 Subject: [PATCH 4/8] Add trendy team for desktop firmware team Bug: 357660887 Bug: 368101278 Bug: 368341182 Change-Id: Ieff334e1b718776a2f09ce31f909b816c310e5ec --- teams/Android.bp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teams/Android.bp b/teams/Android.bp index 94585fcb62..0f5b47529b 100644 --- a/teams/Android.bp +++ b/teams/Android.bp @@ -4440,3 +4440,10 @@ team { // go/trendy/manage/engineers/5097003746426880 trendy_team_id: "5097003746426880", } + +team { + name: "trendy_team_desktop_firmware", + + // go/trendy/manage/engineers/5787938454863872 + trendy_team_id: "5787938454863872", +} From 486c627e720e051c45bd2d783db6e5e1d440c9e2 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Thu, 19 Sep 2024 17:55:10 +0000 Subject: [PATCH 5/8] Revert "Revert "Add command line tool that generates NOTICE.xml...." Revert submission 3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP Reason for revert: reland it Reverted changes: /q/submissionid:3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP Change-Id: Ica8daafbc5f1bc0bc473c939c595666403349739 --- core/Makefile | 4 +- core/os_licensing.mk | 4 ++ tools/sbom/Android.bp | 14 +++++++ tools/sbom/gen_notice_xml.py | 81 ++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 tools/sbom/gen_notice_xml.py diff --git a/core/Makefile b/core/Makefile index b0392cdc8b..0bc6f1fc9e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1964,7 +1964,7 @@ target_system_dlkm_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_SYST installed_system_dlkm_notice_xml_gz := $(TARGET_OUT_SYSTEM_DLKM)/etc/NOTICE.xml.gz ALL_INSTALLED_NOTICE_FILES := \ - $(installed_notice_html_or_xml_gz) \ + $(if $(USE_SOONG_DEFINED_SYSTEM_IMAGE),,$(installed_notice_html_or_xml_gz)) \ $(installed_vendor_notice_xml_gz) \ $(installed_product_notice_xml_gz) \ $(installed_system_ext_notice_xml_gz) \ @@ -2051,7 +2051,9 @@ endif endif # PRODUCT_NOTICE_SPLIT +ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true) ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz) +endif need_vendor_notice:=false ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true) diff --git a/core/os_licensing.mk b/core/os_licensing.mk index 1e1b7df7a9..d15a3d0715 100644 --- a/core/os_licensing.mk +++ b/core/os_licensing.mk @@ -17,13 +17,17 @@ $(eval $(call xml-notice-rule,$(target_notice_file_xml_gz),"System image",$(syst $(eval $(call text-notice-rule,$(target_notice_file_txt),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS))) +ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true) $(installed_notice_html_or_xml_gz): $(target_notice_file_xml_gz) $(copy-file-to-target) endif +endif $(call declare-1p-target,$(target_notice_file_xml_gz)) +ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true) $(call declare-1p-target,$(installed_notice_html_or_xml_gz)) endif +endif .PHONY: vendorlicense vendorlicense: $(call corresponding-license-metadata, $(VENDOR_NOTICE_DEPS)) reportmissinglicenses diff --git a/tools/sbom/Android.bp b/tools/sbom/Android.bp index 6901b06720..74b3d626f6 100644 --- a/tools/sbom/Android.bp +++ b/tools/sbom/Android.bp @@ -109,3 +109,17 @@ python_binary_host { "sbom_lib", ], } + +python_binary_host { + name: "gen_notice_xml", + srcs: [ + "gen_notice_xml.py", + ], + version: { + py3: { + embedded_launcher: true, + }, + }, + libs: [ + ], +} diff --git a/tools/sbom/gen_notice_xml.py b/tools/sbom/gen_notice_xml.py new file mode 100644 index 0000000000..eaa6e5a74d --- /dev/null +++ b/tools/sbom/gen_notice_xml.py @@ -0,0 +1,81 @@ +# !/usr/bin/env python3 +# +# Copyright (C) 2024 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Generate NOTICE.xml.gz of a partition. +Usage example: + gen_notice_xml.py --output_file out/soong/.intermediate/.../NOTICE.xml.gz \ + --metadata out/soong/compliance-metadata/aosp_cf_x86_64_phone/compliance-metadata.db \ + --partition system \ + --product_out out/target/vsoc_x86_64 \ + --soong_out out/soong +""" + +import argparse + + +FILE_HEADER = '''\ + + +''' +FILE_FOOTER = '''\ + +''' + + +def get_args(): + parser = argparse.ArgumentParser() + parser.add_argument('-v', '--verbose', action='store_true', default=False, help='Print more information.') + parser.add_argument('-d', '--debug', action='store_true', default=True, help='Debug mode') + parser.add_argument('--output_file', required=True, help='The path of the generated NOTICE.xml.gz file.') + parser.add_argument('--partition', required=True, help='The name of partition for which the NOTICE.xml.gz is generated.') + parser.add_argument('--metadata', required=True, help='The path of compliance metadata DB file.') + parser.add_argument('--product_out', required=True, help='The path of PRODUCT_OUT, e.g. out/target/product/vsoc_x86_64.') + parser.add_argument('--soong_out', required=True, help='The path of Soong output directory, e.g. out/soong') + + return parser.parse_args() + + +def log(*info): + if args.verbose: + for i in info: + print(i) + + +def new_file_name_tag(file_metadata, package_name): + file_path = file_metadata['installed_file'].removeprefix(args.product_out) + lib = 'Android' + if package_name: + lib = package_name + return f'{file_path}\n' + + +def new_file_content_tag(): + pass + + +def main(): + global args + args = get_args() + log('Args:', vars(args)) + + with open(args.output_file, 'w', encoding="utf-8") as notice_xml_file: + notice_xml_file.write(FILE_HEADER) + notice_xml_file.write(FILE_FOOTER) + + +if __name__ == '__main__': + main() From 0b73dde4e9a33840bd66936271895a3b174fc679 Mon Sep 17 00:00:00 2001 From: Luca Farsi Date: Wed, 11 Sep 2024 14:31:30 -0700 Subject: [PATCH 6/8] Split out host shared libs target from device-tests Split out the building of the host shared libs zip from the device-tests target so it can be build separately. Building device-tests still still build both. Test: m device-tests, m device-tests-shared-libs Bug: 366308541 Change-Id: I13741ce22823622a6bf4744cb55026765c188b8c --- core/tasks/device-tests.mk | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/core/tasks/device-tests.mk b/core/tasks/device-tests.mk index 5850c4ed73..6164c2e94b 100644 --- a/core/tasks/device-tests.mk +++ b/core/tasks/device-tests.mk @@ -14,6 +14,7 @@ .PHONY: device-tests +.PHONY: device-tests-host-shared-libs device-tests-zip := $(PRODUCT_OUT)/device-tests.zip # Create an artifact to include a list of test config files in device-tests. @@ -23,37 +24,45 @@ device-tests-configs-zip := $(PRODUCT_OUT)/device-tests_configs.zip my_host_shared_lib_for_device_tests := $(call copy-many-files,$(COMPATIBILITY.device-tests.HOST_SHARED_LIBRARY.FILES)) device_tests_host_shared_libs_zip := $(PRODUCT_OUT)/device-tests_host-shared-libs.zip -$(device-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(device-tests-list-zip) $(device-tests-configs-zip) $(device_tests_host_shared_libs_zip) +$(device-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(device-tests-list-zip) $(device-tests-configs-zip) $(device-tests-zip) : PRIVATE_device_tests_list := $(PRODUCT_OUT)/device-tests_list $(device-tests-zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_device_tests) -$(device-tests-zip) : PRIVATE_device_host_shared_libs_zip := $(device_tests_host_shared_libs_zip) $(device-tests-zip) : $(COMPATIBILITY.device-tests.FILES) $(COMPATIBILITY.device-tests.SOONG_INSTALLED_COMPATIBILITY_SUPPORT_FILES) $(my_host_shared_lib_for_device_tests) $(SOONG_ZIP) - rm -f $@-shared-libs.list echo $(sort $(COMPATIBILITY.device-tests.FILES) $(COMPATIBILITY.device-tests.SOONG_INSTALLED_COMPATIBILITY_SUPPORT_FILES)) | tr " " "\n" > $@.list grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true grep -e .*\\.config$$ $@-host.list > $@-host-test-configs.list || true $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ echo $$shared_lib >> $@-host.list; \ - echo $$shared_lib >> $@-shared-libs.list; \ done - grep $(HOST_OUT_TESTCASES) $@-shared-libs.list > $@-host-shared-libs.list || true grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list -sha256 $(hide) $(SOONG_ZIP) -d -o $(device-tests-configs-zip) \ -P host -C $(HOST_OUT) -l $@-host-test-configs.list \ -P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list - $(SOONG_ZIP) -d -o $(PRIVATE_device_host_shared_libs_zip) \ - -P host -C $(HOST_OUT) -l $@-host-shared-libs.list rm -f $(PRIVATE_device_tests_list) $(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_device_tests_list) $(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_device_tests_list) $(hide) $(SOONG_ZIP) -d -o $(device-tests-list-zip) -C $(dir $@) -f $(PRIVATE_device_tests_list) rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \ - $@-shared-libs.list $@-host-shared-libs.list $(PRIVATE_device_tests_list) + $(PRIVATE_device_tests_list) + +$(device_tests_host_shared_libs_zip) : PRIVATE_device_host_shared_libs_zip := $(device_tests_host_shared_libs_zip) +$(device_tests_host_shared_libs_zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_device_tests) +$(device_tests_host_shared_libs_zip) : $(my_host_shared_lib_for_device_tests) $(SOONG_ZIP) + rm -f $@-shared-libs.list + $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ + echo $$shared_lib >> $@-shared-libs.list; \ + done + grep $(HOST_OUT_TESTCASES) $@-shared-libs.list > $@-host-shared-libs.list || true + $(SOONG_ZIP) -d -o $(PRIVATE_device_host_shared_libs_zip) \ + -P host -C $(HOST_OUT) -l $@-host-shared-libs.list device-tests: $(device-tests-zip) +device-tests-host-shared-libs: $(device_tests_host_shared_libs_zip) + $(call dist-for-goals, device-tests, $(device-tests-zip) $(device-tests-list-zip) $(device-tests-configs-zip) $(device_tests_host_shared_libs_zip)) +$(call dist-for-goals, device-tests-host-shared-libs, $(device_tests_host_shared_libs_zip)) $(call declare-1p-container,$(device-tests-zip),) $(call declare-container-license-deps,$(device-tests-zip),$(COMPATIBILITY.device-tests.FILES) $(my_host_shared_lib_for_device_tests),$(PRODUCT_OUT)/:/) From 8d5479a400408315c77757a78ae3a65f731fdd3b Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Wed, 18 Sep 2024 23:08:13 +0000 Subject: [PATCH 7/8] Package shared lib for camera-hal-tests Bug: 362195892 Test: presubmit Change-Id: Ia424942040c5e0d26f12cc0fcdb0925d90567809 --- core/main.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/main.mk b/core/main.mk index 80ffec43b7..e5f5b9d2c6 100644 --- a/core/main.mk +++ b/core/main.mk @@ -687,12 +687,12 @@ endef # Scan all modules in general-tests, device-tests and other selected suites and # flatten the shared library dependencies. define update-host-shared-libs-deps-for-suites -$(foreach suite,general-tests device-tests vts tvts art-host-tests host-unit-tests,\ +$(foreach suite,general-tests device-tests vts tvts art-host-tests host-unit-tests camera-hal-tests,\ $(foreach m,$(COMPATIBILITY.$(suite).MODULES),\ $(eval my_deps := $(call get-all-shared-libs-deps,$(m)))\ $(foreach dep,$(my_deps),\ $(foreach f,$(ALL_MODULES.$(dep).HOST_SHARED_LIBRARY_FILES),\ - $(if $(filter $(suite),device-tests general-tests art-host-tests host-unit-tests),\ + $(if $(filter $(suite),device-tests general-tests art-host-tests host-unit-tests camera-hal-tests),\ $(eval my_testcases := $(HOST_OUT_TESTCASES)),\ $(eval my_testcases := $$(COMPATIBILITY_TESTCASES_OUT_$(suite))))\ $(eval target := $(my_testcases)/$(lastword $(subst /, ,$(dir $(f))))/$(notdir $(f)))\ From 46986a4f02c6f9919bbd75981948b26782194527 Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Fri, 20 Sep 2024 13:15:56 +0000 Subject: [PATCH 8/8] aconfig: update cpp codegen Use access system call to check existence of a file to reduce the cost. Change-Id: Id64b419db81b2f8ac923b49f7293ee8a54aa78ca --- tools/aconfig/aconfig/templates/cpp_source_file.template | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/aconfig/aconfig/templates/cpp_source_file.template b/tools/aconfig/aconfig/templates/cpp_source_file.template index 623034a87b..852b905f32 100644 --- a/tools/aconfig/aconfig/templates/cpp_source_file.template +++ b/tools/aconfig/aconfig/templates/cpp_source_file.template @@ -2,7 +2,7 @@ {{ if allow_instrumentation }} {{ if readwrite- }} -#include +#include #include "aconfig_storage/aconfig_storage_read_api.hpp" #include #define LOG_TAG "aconfig_cpp_codegen" @@ -78,8 +78,7 @@ namespace {cpp_namespace} \{ , flag_value_file_(nullptr) , read_from_new_storage_(false) \{ - struct stat buffer; - if (stat("/metadata/aconfig/boot/enable_only_new_storage", &buffer) == 0) \{ + if (access("/metadata/aconfig/boot/enable_only_new_storage", F_OK) == 0) \{ read_from_new_storage_ = true; }