[S] Change in fuchsia/fuchsia[main]: [sdk] Include .ifs files in SDK

4 views
Skip to first unread message

Alex Brachet (Gerrit)

unread,
Jan 28, 2023, 1:42:07 AM1/28/23
to sdk-dev+a...@fuchsia.dev

Alex Brachet has uploaded this change for review.

View Change

[sdk] Include .ifs files in SDK

This can be used for testing architectures not currently
supported by the SDK.

In the future, we'll add a script to the SDK to easily
generate link stubs from all .ifs files in the SDK.

Bug: 92682
Change-Id: Idd74816f1d40a46194d44006b3b4dd9617fb7d65
---
M build/cpp/gen_sdk_prebuilt_meta_file.py
M build/cpp/sdk_shared_library.gni
M build/sdk/meta/cc_prebuilt_library.json
M build/sdk/meta/golden/cc_prebuilt_library.json.golden
4 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/build/cpp/gen_sdk_prebuilt_meta_file.py b/build/cpp/gen_sdk_prebuilt_meta_file.py
index c93f402..0f1f2d6 100755
--- a/build/cpp/gen_sdk_prebuilt_meta_file.py
+++ b/build/cpp/gen_sdk_prebuilt_meta_file.py
@@ -55,6 +55,10 @@
help=
'Path to the file where to write the file mapping for the debug library',
required=False)
+ parser.add_argument(
+ '--ifs',
+ help='Path to .ifs file',
+ required=False)
args = parser.parse_args()

metadata = {
@@ -71,6 +75,9 @@
},
}

+ if args.ifs:
+ metadata['ifs'] = args.ifs
+
if args.lib_debug_file:
# The path of the debug file in the SDK depends on its build id.
debug_path = binaries.get_sdk_debug_path(args.lib_debug_file)
diff --git a/build/cpp/sdk_shared_library.gni b/build/cpp/sdk_shared_library.gni
index bc9dbce..4f96075 100644
--- a/build/cpp/sdk_shared_library.gni
+++ b/build/cpp/sdk_shared_library.gni
@@ -372,6 +372,13 @@
},
]

+ if (defined(invoker.symbols_api)) {
+ sdk_files += [{
+ source = get_path_info(invoker.symbols_api, "abspath")
+ dest = "${sdk_root_path}/" + get_path_info(invoker.symbols_api, "file")
+ }]
+ }
+
if (generate_plasa_artifacts) {
_plasa_artifacts_target_name = "${main_target_name}_plasa"
plasa_fragment_cc(_plasa_artifacts_target_name) {
@@ -437,6 +444,9 @@
]
args += [ "--deps" ] + rebase_path(sdk_metas, root_build_dir)
args += [ "--headers" ] + sdk_metadata_headers
+ if (defined(invoker.symbols_api)) {
+ args += [ "--ifs" ] + [ get_path_info(invoker.symbols_api, "file") ]
+ }

deps = sdk_deps + [ shared_lib_target ]
}
diff --git a/build/sdk/meta/cc_prebuilt_library.json b/build/sdk/meta/cc_prebuilt_library.json
index 32d6e7f..cf4b9ba 100644
--- a/build/sdk/meta/cc_prebuilt_library.json
+++ b/build/sdk/meta/cc_prebuilt_library.json
@@ -46,6 +46,10 @@
},
"type": "array"
},
+ "ifs": {
+ "description": "llvm-ifs file used to describe the abi of the lirbary",
+ "type": "string"
+ },
"include_dir": {
"$ref": "common.json#/definitions/file",
"description": "Path to the base directory for includes"
diff --git a/build/sdk/meta/golden/cc_prebuilt_library.json.golden b/build/sdk/meta/golden/cc_prebuilt_library.json.golden
index 32d6e7f..cf4b9ba 100644
--- a/build/sdk/meta/golden/cc_prebuilt_library.json.golden
+++ b/build/sdk/meta/golden/cc_prebuilt_library.json.golden
@@ -46,6 +46,10 @@
},
"type": "array"
},
+ "ifs": {
+ "description": "llvm-ifs file used to describe the abi of the lirbary",
+ "type": "string"
+ },
"include_dir": {
"$ref": "common.json#/definitions/file",
"description": "Path to the base directory for includes"

To view, visit change 794363. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Idd74816f1d40a46194d44006b3b4dd9617fb7d65
Gerrit-Change-Number: 794363
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Brachet <abra...@google.com>
Gerrit-MessageType: newchange
Reply all
Reply to author
Forward
0 new messages