From f84037714eb6b208c6ddb3ab94ba6b8c19c968e0 Mon Sep 17 00:00:00 2001 From: gongyuhang Date: Fri, 9 Jun 2023 16:35:46 +0800 Subject: [PATCH] make ark_standalone_build of linux_x64/ohos_arm/ohos_arm64/mingw_x86_64 use "-flto=thin" Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/I7CAQR Test: command of ark_standalone_build Signed-off-by: gongyuhang Change-Id: I7f9fe21230932faf65f3fb25bd5c8d921a7e5e72 --- build/compile_script/ark.py | 12 ++++++------ build/config/BUILDCONFIG.gn | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index 755f43d1..d2bce878 100644 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -83,7 +83,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system linux and " "target-central-processing-unit x64.", - "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x64\"\n", + "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "x64", }, "linux_x86": { @@ -91,7 +91,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system linux and " "target-central-processing-unit x86.", - "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x86\"\n", + "expression_to_args_gn": "target_os = \"linux\"\ntarget_cpu = \"x86\"\nuse_flto = false\n", "prefix_of_name_of_out_dir_of_second_level": "x86", }, "ohos_arm": { @@ -99,7 +99,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system ohos and " "target-central-processing-unit arm.", - "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm\"\n", + "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "arm", }, "ohos_arm64": { @@ -107,7 +107,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system ohos and " "target-central-processing-unit arm64.", - "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm64\"\n", + "expression_to_args_gn": "target_os = \"ohos\"\ntarget_cpu = \"arm64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "arm64", }, "android_arm64": { @@ -115,7 +115,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system android and " "target-central-processing-unit arm64.", - "expression_to_args_gn": "target_os = \"android\"\ntarget_cpu = \"arm64\"\n", + "expression_to_args_gn": "target_os = \"android\"\ntarget_cpu = \"arm64\"\nuse_flto = false\n", "prefix_of_name_of_out_dir_of_second_level": "android_arm64", }, "mingw_x86_64": { @@ -123,7 +123,7 @@ class ArkPy: "description": "Build for arkcompiler target of target-operating-system MinGW(Minimalist GNU on Windows) and " "target-central-processing-unit x86_64.", - "expression_to_args_gn": "target_os = \"mingw\"\ntarget_cpu = \"x86_64\"\n", + "expression_to_args_gn": "target_os = \"mingw\"\ntarget_cpu = \"x86_64\"\nuse_flto = true\n", "prefix_of_name_of_out_dir_of_second_level": "mingw_x86_64", }, }, diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 58e4a0b7..ba452c8a 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -27,6 +27,7 @@ declare_args() { # Debug build. Enabling official builds automatically sets is_debug to false. is_debug = false is_standard_system = false + use_flto = false } declare_args() { -- Gitee