From 00b6b560268e9ca3da628542f0f5e7eb3d271f41 Mon Sep 17 00:00:00 2001 From: yangliping Date: Wed, 16 Oct 2024 12:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 编译输出stub.an的code-comment信息跨平台问题 Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAXGD6?from=project-issue Signed-off-by: yangliping --- ecmascript/compiler/BUILD.gn | 9 ++++----- script/run_ark_executable.py | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ecmascript/compiler/BUILD.gn b/ecmascript/compiler/BUILD.gn index f1b8b33103..613e67f3de 100644 --- a/ecmascript/compiler/BUILD.gn +++ b/ecmascript/compiler/BUILD.gn @@ -534,11 +534,10 @@ action("gen_stub_file") { "/thirdparty/bounds_checking_function:" + rebase_path("//prebuilts/clang/ohos/linux-x86_64/llvm/lib/"), ] - - outputs = [ - "$stub_file_gen_dir/stub.an", - "$stub_file_gen_dir/stub_code_comment.txt", - ] + outputs = [ "$stub_file_gen_dir/stub.an" ] + if (is_ohos) { + outputs += [ "$stub_file_gen_dir/stub_code_comment.txt" ] + } } ohos_prebuilt_shared_library("stub.an") { diff --git a/script/run_ark_executable.py b/script/run_ark_executable.py index f9e7f1fa71..9b6580c4b9 100755 --- a/script/run_ark_executable.py +++ b/script/run_ark_executable.py @@ -122,7 +122,11 @@ def process_open(args: object) -> [str, object]: def generate_stub_code_comment(out_str:str): flags = os.O_WRONLY | os.O_CREAT mode = stat.S_IWUSR | stat.S_IRUSR - fd = os.open('./gen/arkcompiler/ets_runtime/stub_code_comment.txt', flags, mode) + dir_path = './gen/arkcompiler/ets_runtime/' + if not os.path.exists(dir_path): + return + file_path = dir_path + 'stub_code_comment.txt' + fd = os.open(file_path, flags, mode) with os.fdopen(fd, "w") as code_comment_file: code_comment_file.write(out_str)