diff --git a/0001-feat-Adapt-to-Openeuler-python-export-lld.patch b/0001-feat-Adapt-to-Openeuler-python-export-lld.patch new file mode 100644 index 0000000000000000000000000000000000000000..a577d34dd63d1494ef75821697d365ee8e7c1cf1 --- /dev/null +++ b/0001-feat-Adapt-to-Openeuler-python-export-lld.patch @@ -0,0 +1,59 @@ +From 9d1e0dcc61af68410c3662c64553c8235385d4d1 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0001 + +--- + build_scripts/build.sh | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/build_scripts/build.sh b/build_scripts/build.sh +index cd2ab20..51f2e5e 100755 +--- a/build_scripts/build.sh ++++ b/build_scripts/build.sh +@@ -109,8 +109,27 @@ case $(uname -s) in + exit $RET + esac + ++args=$@ ++while test $# -gt 0 ++do ++ case "$1" in --product-name) ++ shift ++ product_name=$1 ++ ;; ++ *) ++ shift ++ ;; ++ esac ++done ++ + # set python3 +-PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/ ++if [ "$product_name" == "openeuler" ]; then ++ PYTHON3_DIR=/usr ++ LLD_PATH=/usr/lib64/llvm15/bin ++else ++ PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/ ++ LLD_PATH="" ++fi + PYTHON3=${PYTHON3_DIR}/bin/python3 + PYTHON=${PYTHON3_DIR}/bin/python + if [[ ! -f "${PYTHON3}" ]]; then +@@ -122,11 +141,11 @@ else + fi + fi + +-export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH ++export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLD_PATH}:$PATH + + ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py + +-${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $@ ++${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $args + + if [[ "$?" -ne 0 ]]; then + echo -e "\033[31m=====build ${product_name} error=====\033[0m" +-- +2.33.0 + diff --git a/0002-feat-Adapt-to-Openeuler-for-compilation.patch b/0002-feat-Adapt-to-Openeuler-for-compilation.patch new file mode 100644 index 0000000000000000000000000000000000000000..37ee9ae362161ae973b2064b6f08c8755c340898 --- /dev/null +++ b/0002-feat-Adapt-to-Openeuler-for-compilation.patch @@ -0,0 +1,677 @@ +From 15ecabfa18a391b57ee46ed94b3b0aa74e00b5af Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0002 + +--- + config/BUILDCONFIG.gn | 45 ++++- + config/compiler/compiler.gni | 3 +- + config/ohos/BUILD.gn | 3 + + core/gn/BUILD.gn | 14 +- + ohos/images/BUILD.gn | 325 ++++++++++++++++++----------------- + ohos/packages/BUILD.gn | 12 +- + ohos_var.gni | 14 ++ + templates/cxx/cxx.gni | 48 ++++-- + 8 files changed, 275 insertions(+), 189 deletions(-) + +diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn +index ff1319b..ffff773 100755 +--- a/config/BUILDCONFIG.gn ++++ b/config/BUILDCONFIG.gn +@@ -64,6 +64,20 @@ declare_args() { + device_name = "" + } + ++declare_args() { ++ if (product_name == "openeuler") { ++ build_openeuler = true ++ } else { ++ build_openeuler = false ++ } ++} ++ ++declare_args() { ++ if (defined(build_openeuler) && build_openeuler && !defined(product_path)) { ++ product_path = "" ++ } ++} ++ + declare_args() { + preloader_output_dir = "//out/preloader/${product_name}" + } +@@ -232,10 +246,14 @@ declare_args() { + is_desktop_linux = current_os == "linux" + + # Set to true when compiling with the Clang compiler. +- is_clang = current_os != "linux" || +- (current_cpu != "s390x" && current_cpu != "s390" && +- current_cpu != "ppc64" && current_cpu != "ppc" && +- current_cpu != "mips" && current_cpu != "mips64") ++ if (defined(build_openeuler) && build_openeuler) { ++ is_clang = true ++ } else { ++ is_clang = current_os != "linux" || ++ (current_cpu != "s390x" && current_cpu != "s390" && ++ current_cpu != "ppc64" && current_cpu != "ppc" && ++ current_cpu != "mips" && current_cpu != "mips64") ++ } + + # Allows the path to a custom target toolchain to be injected as a single + # argument, and set as the default toolchain. +@@ -256,7 +274,11 @@ declare_args() { + } + + declare_args() { +- use_musl = true ++ if (defined(build_openeuler) && build_openeuler) { ++ use_musl = false ++ } else { ++ use_musl = true ++ } + } + + declare_args() { +@@ -309,6 +331,9 @@ declare_args() { + } else { + full_mini_debug = true + } ++ if (build_openeuler) { ++ full_mini_debug = false ++ } + } + + declare_args() { +@@ -604,6 +629,11 @@ if (is_standard_system) { + "//build/config/clang:extra_warnings", + ] + } ++ if (build_openeuler) { ++ default_compiler_configs += [ ++ "//build/openeuler:openeuler_include_dirs", ++ ] ++ } + + # Debug/release-related defines. + if (is_debug) { +@@ -612,6 +642,11 @@ if (is_standard_system) { + default_compiler_configs += [ "//build/config:release" ] + } + ++ if (build_openeuler) { ++ default_compiler_configs += [ ++ "//build/openeuler:openeuler_config", ++ ] ++ } + # Static libraries and source sets use only the compiler ones. + default_static_library_configs = default_compiler_configs + default_source_set_configs = default_compiler_configs +diff --git a/config/compiler/compiler.gni b/config/compiler/compiler.gni +index 254e744..d3e4a3f 100755 +--- a/config/compiler/compiler.gni ++++ b/config/compiler/compiler.gni +@@ -147,7 +147,8 @@ declare_args() { + use_lld = is_clang && + (is_win || (use_thin_lto && target_os != "chromeos") || + (is_linux && current_cpu == "x64" && target_os != "chromeos") || +- (is_ohos && (current_cpu != "arm" || arm_version >= 7))) ++ (is_ohos && (current_cpu != "arm" || arm_version >= 7)) || ++ (is_linux && current_cpu == "arm64")) + } + + declare_args() { +diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn +index f177a03..a41763d 100755 +--- a/config/ohos/BUILD.gn ++++ b/config/ohos/BUILD.gn +@@ -43,6 +43,9 @@ config("compiler") { + + cflags += [ "--target=$abi_target" ] + include_dirs = [ "${musl_sysroot}/usr/include/${abi_target}" ] ++ if (build_openeuler) { ++ include_dirs += [ "//build/openeuler/compiler_include" ] ++ } + + ldflags += [ "--target=$abi_target" ] + +diff --git a/core/gn/BUILD.gn b/core/gn/BUILD.gn +index abec57e..e87d50d 100755 +--- a/core/gn/BUILD.gn ++++ b/core/gn/BUILD.gn +@@ -56,10 +56,16 @@ if (product_name == "ohos-sdk") { + + group("build_all_test_pkg") { + testonly = true +- deps = [ +- "$root_build_dir/build_configs:parts_test", +- "//test/testfwk/developer_test:make_temp_test", +- ] ++ if (build_openeuler) { ++ deps = [ ++ "$root_build_dir/build_configs:parts_test", ++ ] ++ } else { ++ deps = [ ++ "$root_build_dir/build_configs:parts_test", ++ "//test/testfwk/developer_test:make_temp_test", ++ ] ++ } + } + + group("make_test") { +diff --git a/ohos/images/BUILD.gn b/ohos/images/BUILD.gn +index 7b0d11f..ae509ea 100644 +--- a/ohos/images/BUILD.gn ++++ b/ohos/images/BUILD.gn +@@ -17,188 +17,195 @@ import("//build/ohos/build_var.gni") + + # import target_platform_list + import("${build_configs_path}/platforms_list.gni") +-group("make_images") { +- deps = [] +- if (is_standard_system) { +- deps = [ +- "//third_party/e2fsprogs:e2fsprogs_host_toolchain", +- "//third_party/f2fs-tools:f2fs-tools_host_toolchain", +- ] +- foreach(_platform, target_platform_list) { +- deps += [ +- ":${_platform}_sys_prod_image", +- ":${_platform}_system_image", +- ":${_platform}_userdata_image", +- ":${_platform}_vendor_image", ++ ++if (build_openeuler) { ++ group("make_images") { ++ deps = [] ++ if (is_standard_system) { ++ foreach(_platform, target_platform_list) { ++ deps += [ ++ "//build/ohos/packages:${_platform}_install_modules" ++ ] ++ } ++ } ++ } ++} else { ++ group("make_images") { ++ deps = [] ++ if (is_standard_system) { ++ deps = [ ++ "//third_party/e2fsprogs:e2fsprogs_host_toolchain", ++ "//third_party/f2fs-tools:f2fs-tools_host_toolchain", + ] +- if (enable_ramdisk) { ++ foreach(_platform, target_platform_list) { + deps += [ +- ":${_platform}_ramdisk_image", +- ":${_platform}_updater_ramdisk_image", ++ ":${_platform}_sys_prod_image", ++ ":${_platform}_system_image", ++ ":${_platform}_userdata_image", ++ ":${_platform}_vendor_image", + ] +- } else { +- deps += [ ":${_platform}_updater_image" ] ++ if (enable_ramdisk) { ++ deps += [ ++ ":${_platform}_ramdisk_image", ++ ":${_platform}_updater_ramdisk_image", ++ ] ++ } else { ++ deps += [ ":${_platform}_updater_image" ] ++ } + } ++ deps += [ ":chip_prod_image" ] ++ } else { ++ deps += [ "//build/ohos/packages:packer" ] + } +- deps += [ ":chip_prod_image" ] +- } else { +- deps += [ "//build/ohos/packages:packer" ] + } +-} + +-group("chip_prod_image") { +- deps = [] +- if (is_standard_system) { +- deps += [ +- "//third_party/e2fsprogs:e2fsprogs_host_toolchain", +- "//third_party/f2fs-tools:f2fs-tools_host_toolchain", +- ] +- } +- foreach(_platform, target_platform_list) { +- if (chip_product_list == []) { +- deps += [ ":${_platform}_chip_prod_image" ] +- } else { +- foreach(_product, chip_product_list) { +- deps += [ ":${_platform}_${_product}_chip_prod_image" ] ++ group("chip_prod_image") { ++ deps = [] ++ if (is_standard_system) { ++ deps += [ ++ "//third_party/e2fsprogs:e2fsprogs_host_toolchain", ++ "//third_party/f2fs-tools:f2fs-tools_host_toolchain", ++ ] ++ } ++ foreach(_platform, target_platform_list) { ++ if (chip_product_list == []) { ++ deps += [ ":${_platform}_chip_prod_image" ] ++ } else { ++ foreach(_product, chip_product_list) { ++ deps += [ ":${_platform}_${_product}_chip_prod_image" ] ++ } + } + } + } +-} +- +-build_image_tools_path = [ +- "//out/${device_name}/clang_x64/thirdparty/e2fsprogs", +- "//out/${device_name}/clang_x64/thirdparty/f2fs_tools", +- "//third_party/e2fsprogs/prebuilt/host/bin", +- "//build/ohos/images/mkimage", +-] + +-foreach(_platform, target_platform_list) { +- current_platform = _platform +- current_platform_dir = "${product_output_dir}/$current_platform" ++ foreach(_platform, target_platform_list) { ++ current_platform = _platform ++ current_platform_dir = "${product_output_dir}/$current_platform" + +- system_module_info_list = "${current_platform_dir}/system_module_info.json" +- system_modules_list = "${current_platform_dir}/system_modules_list.txt" ++ system_module_info_list = "${current_platform_dir}/system_module_info.json" ++ system_modules_list = "${current_platform_dir}/system_modules_list.txt" + +- image_list = [ +- "system", +- "vendor", +- "userdata", +- "sys_prod", +- "chip_prod", +- ] +- if (enable_ramdisk) { +- image_list += [ +- "ramdisk", +- "updater_ramdisk", ++ image_list = [ ++ "system", ++ "vendor", ++ "userdata", ++ "sys_prod", ++ "chip_prod", + ] +- } else { +- image_list += [ "updater" ] +- } +- foreach(_image_name, image_list) { +- action_with_pydeps("${_platform}_${_image_name}_image") { +- script = "//build/ohos/images/build_image.py" +- depfile = "$target_gen_dir/$target_name.d" +- deps = [ "//build/ohos/packages:${_platform}_install_modules" ] +- if (!asan_detector) { +- deps += [ "//build/ohos/packages:high_privilege_process_validate" ] +- } ++ if (enable_ramdisk) { ++ image_list += [ ++ "ramdisk", ++ "updater_ramdisk", ++ ] ++ } else { ++ image_list += [ "updater" ] ++ } ++ foreach(_image_name, image_list) { ++ action_with_pydeps("${_platform}_${_image_name}_image") { ++ script = "//build/ohos/images/build_image.py" ++ depfile = "$target_gen_dir/$target_name.d" ++ deps = [ "//build/ohos/packages:${_platform}_install_modules" ] ++ if (!asan_detector) { ++ deps += [ "//build/ohos/packages:high_privilege_process_validate" ] ++ } + +- image_config_file = +- "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" +- if (is_debug) { + image_config_file = +- "//build/ohos/images/mkimage/debug/${_image_name}_image_conf.txt" +- } +- device_image_config_file = +- "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" +- if (_image_name == "ramdisk" || _image_name == "updater_ramdisk") { +- output_image_file = "$root_build_dir/${_image_name}.img" +- } else { +- output_image_file = "$current_platform_dir/images/${_image_name}.img" +- } +- if (_image_name == "updater_ramdisk") { +- image_input_path = "$current_platform_dir/updater" +- } else { +- image_input_path = "$current_platform_dir/${_image_name}" +- } +- if (_image_name == "userdata") { +- image_input_path = "$current_platform_dir/data" +- } ++ "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" ++ if (is_debug) { ++ image_config_file = ++ "//build/ohos/images/mkimage/debug/${_image_name}_image_conf.txt" ++ } ++ device_image_config_file = ++ "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" ++ if (_image_name == "ramdisk" || _image_name == "updater_ramdisk") { ++ output_image_file = "$root_build_dir/${_image_name}.img" ++ } else { ++ output_image_file = "$current_platform_dir/images/${_image_name}.img" ++ } ++ if (_image_name == "updater_ramdisk") { ++ image_input_path = "$current_platform_dir/updater" ++ } else { ++ image_input_path = "$current_platform_dir/${_image_name}" ++ } ++ if (_image_name == "userdata") { ++ image_input_path = "$current_platform_dir/data" ++ } + +- sources = [ +- image_config_file, +- system_module_info_list, +- system_modules_list, +- ] +- outputs = [ output_image_file ] +- args = [ +- "--depfile", +- rebase_path(depfile, root_build_dir), +- "--image-name", +- _image_name, +- "--input-path", +- rebase_path(image_input_path, root_build_dir), +- "--image-config-file", +- rebase_path(image_config_file, root_build_dir), +- "--device-image-config-file", +- rebase_path(device_image_config_file, root_build_dir), +- "--output-image", +- rebase_path(output_image_file, root_build_dir), +- "--target-cpu", +- target_cpu, +- "--build-image-tools-path", +- ] +- args += rebase_path(build_image_tools_path, root_build_dir) +- if (sparse_image) { +- args += [ "--sparse-image" ] ++ sources = [ ++ image_config_file, ++ system_module_info_list, ++ system_modules_list, ++ ] ++ outputs = [ output_image_file ] ++ args = [ ++ "--depfile", ++ rebase_path(depfile, root_build_dir), ++ "--image-name", ++ _image_name, ++ "--input-path", ++ rebase_path(image_input_path, root_build_dir), ++ "--image-config-file", ++ rebase_path(image_config_file, root_build_dir), ++ "--device-image-config-file", ++ rebase_path(device_image_config_file, root_build_dir), ++ "--output-image", ++ rebase_path(output_image_file, root_build_dir), ++ "--target-cpu", ++ target_cpu, ++ "--build-image-tools-path", ++ ] ++ args += rebase_path(build_image_tools_path, root_build_dir) ++ if (sparse_image) { ++ args += [ "--sparse-image" ] ++ } + } + } +- } + +- # Used to generate chip_prod images of different products +- foreach(_product, chip_product_list) { +- _image_name = "chip_prod" +- action_with_pydeps("${_platform}_${_product}_chip_prod_image") { +- script = "//build/ohos/images/build_image.py" +- depfile = "$target_gen_dir/$target_name.d" +- deps = [ "//build/ohos/packages:${_platform}_install_modules" ] ++ # Used to generate chip_prod images of different products ++ foreach(_product, chip_product_list) { ++ _image_name = "chip_prod" ++ action_with_pydeps("${_platform}_${_product}_chip_prod_image") { ++ script = "//build/ohos/images/build_image.py" ++ depfile = "$target_gen_dir/$target_name.d" ++ deps = [ "//build/ohos/packages:${_platform}_install_modules" ] + +- image_config_file = +- "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" +- device_image_config_file = +- "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" +- image_input_path = "${current_platform_dir}/${_image_name}/${_product}" +- output_image_file = +- "${current_platform_dir}/images/${_product}/${_image_name}.img" ++ image_config_file = ++ "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" ++ device_image_config_file = ++ "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" ++ image_input_path = "${current_platform_dir}/${_image_name}/${_product}" ++ output_image_file = ++ "${current_platform_dir}/images/${_product}/${_image_name}.img" + +- sources = [ +- image_config_file, +- system_module_info_list, +- system_modules_list, +- ] +- outputs = [ output_image_file ] ++ sources = [ ++ image_config_file, ++ system_module_info_list, ++ system_modules_list, ++ ] ++ outputs = [ output_image_file ] + +- args = [ +- "--depfile", +- rebase_path(depfile, root_build_dir), +- "--image-name", +- _image_name, +- "--input-path", +- rebase_path(image_input_path, root_build_dir), +- "--image-config-file", +- rebase_path(image_config_file, root_build_dir), +- "--device-image-config-file", +- rebase_path(device_image_config_file, root_build_dir), +- "--output-image", +- rebase_path(output_image_file, root_build_dir), +- "--target-cpu", +- target_cpu, +- "--build-image-tools-path", +- ] +- args += rebase_path(build_image_tools_path, root_build_dir) +- if (sparse_image) { +- args += [ "--sparse-image" ] ++ args = [ ++ "--depfile", ++ rebase_path(depfile, root_build_dir), ++ "--image-name", ++ _image_name, ++ "--input-path", ++ rebase_path(image_input_path, root_build_dir), ++ "--image-config-file", ++ rebase_path(image_config_file, root_build_dir), ++ "--device-image-config-file", ++ rebase_path(device_image_config_file, root_build_dir), ++ "--output-image", ++ rebase_path(output_image_file, root_build_dir), ++ "--target-cpu", ++ target_cpu, ++ "--build-image-tools-path", ++ ] ++ args += rebase_path(build_image_tools_path, root_build_dir) ++ if (sparse_image) { ++ args += [ "--sparse-image" ] ++ } + } + } + } +-} +\ No newline at end of file ++} +diff --git a/ohos/packages/BUILD.gn b/ohos/packages/BUILD.gn +index 4915b62..847d2e8 100755 +--- a/ohos/packages/BUILD.gn ++++ b/ohos/packages/BUILD.gn +@@ -591,8 +591,12 @@ group("package_testcase") { + + group("build_all_test_pkg") { + testonly = true +- deps = [ +- "$root_build_dir/build_configs:parts_test", +- "//test/testfwk/developer_test:make_temp_test", +- ] ++ if (build_openeuler) { ++ deps = [] ++ } else { ++ deps = [ ++ "$root_build_dir/build_configs:parts_test", ++ "//test/testfwk/developer_test:make_temp_test", ++ ] ++ } + } +diff --git a/ohos_var.gni b/ohos_var.gni +index b49d97e..0ba4b70 100755 +--- a/ohos_var.gni ++++ b/ohos_var.gni +@@ -151,6 +151,20 @@ declare_args() { + load_test_config = true + } + ++if (build_openeuler) { ++ load_test_config = false ++} ++ ++declare_args() { ++ # hiviewdfx ++ enable_hiviewdfx_hisysevent = false ++ enable_hiviewdfx_hitrace = false ++ enable_hiviewdfx_hidumper = false ++ ++ # security ++ enable_security_accesstoken = false ++} ++ + declare_args() { + # Skip module_info generation when the packaging image is not needed + skip_gen_module_info = false +diff --git a/templates/cxx/cxx.gni b/templates/cxx/cxx.gni +index b2e4554..1c82f82 100755 +--- a/templates/cxx/cxx.gni ++++ b/templates/cxx/cxx.gni +@@ -105,9 +105,11 @@ template("ohos_executable") { + ]) + } + +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) ++ if (defined(build_openeuler) && !build_openeuler) { ++ _sanitize_config_target = "${target_name}__sanitizer_config" ++ ohos_sanitizer_config(_sanitize_config_target) { ++ forward_variables_from(invoker, [ "sanitize" ]) ++ } + } + + _test_target = defined(invoker.testonly) && invoker.testonly +@@ -159,7 +161,9 @@ template("ohos_executable") { + if (defined(invoker.remove_configs)) { + configs -= invoker.remove_configs + } +- configs += [ ":$_sanitize_config_target" ] ++ if (defined(build_openeuler) && !build_openeuler) { ++ configs += [ ":$_sanitize_config_target" ] ++ } + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -423,9 +427,11 @@ template("ohos_shared_library") { + ]) + } + +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) ++ if (defined(build_openeuler) && !build_openeuler) { ++ _sanitize_config_target = "${target_name}__sanitizer_config" ++ ohos_sanitizer_config(_sanitize_config_target) { ++ forward_variables_from(invoker, [ "sanitize" ]) ++ } + } + + _test_target = defined(invoker.testonly) && invoker.testonly +@@ -488,7 +494,9 @@ template("ohos_shared_library") { + configs -= invoker.remove_configs + } + +- configs += [ ":$_sanitize_config_target" ] ++ if (defined(build_openeuler) && !build_openeuler) { ++ configs += [ ":$_sanitize_config_target" ] ++ } + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -763,9 +771,11 @@ template("ohos_static_library") { + ]) + } + +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) ++ if (defined(build_openeuler) && !build_openeuler) { ++ _sanitize_config_target = "${target_name}__sanitizer_config" ++ ohos_sanitizer_config(_sanitize_config_target) { ++ forward_variables_from(invoker, [ "sanitize" ]) ++ } + } + + _test_target = defined(invoker.testonly) && invoker.testonly +@@ -811,7 +821,9 @@ template("ohos_static_library") { + if (is_standard_system) { + configs -= [ "//build/config/compiler:thin_archive" ] + } +- configs += [ ":$_sanitize_config_target" ] ++ if (defined(build_openeuler) && !build_openeuler) { ++ configs += [ ":$_sanitize_config_target" ] ++ } + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -935,9 +947,11 @@ template("ohos_source_set") { + ]) + } + +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) ++ if (defined(build_openeuler) && !build_openeuler) { ++ _sanitize_config_target = "${target_name}__sanitizer_config" ++ ohos_sanitizer_config(_sanitize_config_target) { ++ forward_variables_from(invoker, [ "sanitize" ]) ++ } + } + + _test_target = defined(invoker.testonly) && invoker.testonly +@@ -982,7 +996,9 @@ template("ohos_source_set") { + configs -= invoker.remove_configs + } + +- configs += [ ":$_sanitize_config_target" ] ++ if (defined(build_openeuler) && !build_openeuler) { ++ configs += [ ":$_sanitize_config_target" ] ++ } + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +-- +2.33.0 + diff --git a/0003-feat-Adapt-to-Openeuler-add-clang.patch b/0003-feat-Adapt-to-Openeuler-add-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..f70d1d39e34636c33d4fa4c702df6fba908e243e --- /dev/null +++ b/0003-feat-Adapt-to-Openeuler-add-clang.patch @@ -0,0 +1,69 @@ +From 6e60ac76bd9c5502b7ce23cb7c566075f1e22dce Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0003 + +--- + toolchain/gcc_toolchain.gni | 7 ++++++- + toolchain/linux/BUILD.gn | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 36 insertions(+), 1 deletion(-) + +diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni +index 271d556..f521d7c 100755 +--- a/toolchain/gcc_toolchain.gni ++++ b/toolchain/gcc_toolchain.gni +@@ -584,7 +584,12 @@ template("clang_toolchain") { + } + + gcc_toolchain(target_name) { +- prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ if (build_openeuler) { ++ prefix = "/usr/bin" ++ toolprefix = "/usr/bin/" ++ } else { ++ prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ } + cc = "$prefix/clang" + cxx = "$prefix/clang++" + ld = cxx +diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn +index 6b2d618..59449f6 100755 +--- a/toolchain/linux/BUILD.gn ++++ b/toolchain/linux/BUILD.gn +@@ -116,3 +116,33 @@ gcc_toolchain("x64") { + is_clang = false + } + } ++ ++clang_toolchain("linux_clang_x86_64") { ++ # Output linker map files for binary size analysis. ++ enable_linker_map = true ++ ++ strip = "/usr/bin/llvm-strip" ++ toolchain_args = { ++ current_cpu = "x64" ++ current_os = "linux" ++ } ++ shlib_extension = ".so" ++} ++clang_toolchain("clang_x86_64") { ++ # Output linker map files for binary size analysis. ++ enable_linker_map = true ++ ++ strip = "/usr/bin/llvm-strip" ++ toolchain_args = { ++ current_cpu = "x64" ++ current_os = "linux" ++ } ++ shlib_extension = ".so" ++} ++ ++clang_toolchain("linux_clang_arm64") { ++ toolchain_args = { ++ current_cpu = "arm64" ++ current_os = "linux" ++ } ++} +-- +2.33.0 + diff --git a/0004-feat-Adapt-to-Openeuler-add-include-file.patch b/0004-feat-Adapt-to-Openeuler-add-include-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..229cb60b84af4078e73898accdee87577bee693e --- /dev/null +++ b/0004-feat-Adapt-to-Openeuler-add-include-file.patch @@ -0,0 +1,92 @@ +From 855454a4fdde2256be75ad6703fddde0fa7c5e8b Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0004 + +--- + openeuler/BUILD.gn | 13 ++++++ + openeuler/compiler_include/linux/ashmem.h | 50 +++++++++++++++++++++++ + 2 files changed, 63 insertions(+) + create mode 100644 openeuler/BUILD.gn + create mode 100644 openeuler/compiler_include/linux/ashmem.h + +diff --git a/openeuler/BUILD.gn b/openeuler/BUILD.gn +new file mode 100644 +index 0000000..9c175aa +--- /dev/null ++++ b/openeuler/BUILD.gn +@@ -0,0 +1,13 @@ ++config("openeuler_config") { ++ cflags = [ ++ "-Wno-error", ++ "-Wno-error=implicit-fallthrough", ++ "-Wno-error=unused-command-line-argument", ++ ] ++} ++ ++config("openeuler_include_dirs") { ++ include_dirs = [ ++ "//build/openeuler/compiler_include", ++ ] ++} +\ No newline at end of file +diff --git a/openeuler/compiler_include/linux/ashmem.h b/openeuler/compiler_include/linux/ashmem.h +new file mode 100644 +index 0000000..5e56454 +--- /dev/null ++++ b/openeuler/compiler_include/linux/ashmem.h +@@ -0,0 +1,50 @@ ++/* ++ * drivers/staging/android/uapi/ashmem.h ++ * ++ * Copyright 2008 Google Inc. ++ * Author: Robert Love ++ * ++ * This file is dual licensed. It may be redistributed and/or modified ++ * under the terms of the Apache 2.0 License OR version 2 of the GNU ++ * General Public License. ++ */ ++ ++#ifndef _UAPI_LINUX_ASHMEM_H ++#define _UAPI_LINUX_ASHMEM_H ++ ++#include ++#include ++ ++#define ASHMEM_NAME_LEN 256 ++ ++#define ASHMEM_NAME_DEF "dev/ashmem" ++ ++/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ ++#define ASHMEM_NOT_PURGED 0 ++#define ASHMEM_WAS_PURGED 1 ++ ++/* Return values from ASHMEM_GET_PIN_STATUS: Is the mapping pinned? */ ++#define ASHMEM_IS_UNPINNED 0 ++#define ASHMEM_IS_PINNED 1 ++ ++typedef uint32_t __u32, __le32; ++ ++struct ashmem_pin { ++ __u32 offset; /* offset into region, in bytes, page-aligned */ ++ __u32 len; /* length forward from offset, in bytes, page-aligned */ ++}; ++ ++#define __ASHMEMIOC 0x77 ++ ++#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) ++#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) ++#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) ++#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) ++#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) ++#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) ++#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin) ++#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin) ++#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9) ++#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) ++ ++#endif /* _UAPI_LINUX_ASHMEM_H */ +\ No newline at end of file +-- +2.33.0 + diff --git a/0005-feat-use-pyyaml-on-openeuler.patch b/0005-feat-use-pyyaml-on-openeuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d63a59e08d37ae4c110d9d3bf51dc53cb112c0f --- /dev/null +++ b/0005-feat-use-pyyaml-on-openeuler.patch @@ -0,0 +1,25 @@ +From 42b71076304a0efb17fa7dfcc3286c727be35a73 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0005 + +--- + ohos/hisysevent/gen_def_from_all_yaml.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ohos/hisysevent/gen_def_from_all_yaml.py b/ohos/hisysevent/gen_def_from_all_yaml.py +index 058ec0c..a2d4c92 100755 +--- a/ohos/hisysevent/gen_def_from_all_yaml.py ++++ b/ohos/hisysevent/gen_def_from_all_yaml.py +@@ -24,7 +24,7 @@ sys.path.append( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))) + +-from third_party.PyYAML.lib import yaml # noqa: E402 ++import yaml # noqa: E402 + + + def format_validation(pattern, content): +-- +2.33.0 + diff --git a/0006-feat-add-base-config.json-for-openeuler.patch b/0006-feat-add-base-config.json-for-openeuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..318ea4baed11eecb1b429c08eac5f680adaebb35 --- /dev/null +++ b/0006-feat-add-base-config.json-for-openeuler.patch @@ -0,0 +1,127 @@ +From aea0f5f7f298a45b287151e1d53d26cdd6db1268 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0006 + +--- + .../vendor/openeuler/openeuler/config.json | 108 ++++++++++++++++++ + 1 file changed, 108 insertions(+) + create mode 100644 openeuler/vendor/openeuler/openeuler/config.json + +diff --git a/openeuler/vendor/openeuler/openeuler/config.json b/openeuler/vendor/openeuler/openeuler/config.json +new file mode 100644 +index 0000000..f20f9c3 +--- /dev/null ++++ b/openeuler/vendor/openeuler/openeuler/config.json +@@ -0,0 +1,108 @@ ++{ ++ "product_name": "openeuler", ++ "device_company": "openeuler", ++ "device_build_path": "device/board/openeuler/openeuler", ++ "target_os": "linux", ++ "type": "standard", ++ "version": "3.0", ++ "board": "openeuler", ++ "api_version": 8, ++ "enable_ramdisk": false, ++ "build_selinux": false, ++ "build_seccomp": false, ++ "support_jsapi": false, ++ "inherit": [], ++ "subsystems": [ ++ { ++ "subsystem": "commonlibrary", ++ "components": [ ++ { ++ "component": "c_utils", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "hiviewdfx", ++ "components": [ ++ { ++ "component": "hilog_native", ++ "features": [] ++ }, ++ { ++ "component": "hiviewdfx_hilog_native", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "notification", ++ "components": [ ++ { ++ "component": "eventhandler", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "startup", ++ "components": [ ++ { ++ "component": "init", ++ "features": [ ++ "enable_ohos_startup_init_feature_ab_partition = false", ++ "enable_ohos_startup_init_feature_loader = false" ++ ] ++ } ++ ] ++ }, ++ { ++ "subsystem": "security", ++ "components": [ ++ { ++ "component": "huks", ++ "features": [] ++ }, ++ { ++ "component": "device_auth", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "communication", ++ "components": [ ++ { ++ "component": "ipc", ++ "features": [] ++ }, ++ { ++ "component": "dsoftbus", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "systemabilitymgr", ++ "components": [ ++ { ++ "component": "safwk", ++ "features": [] ++ }, ++ { ++ "component": "samgr", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "distributedhardware", ++ "components": [ ++ { ++ "component": "device_manager", ++ "features": [] ++ } ++ ] ++ } ++ ] ++} +-- +2.33.0 + diff --git a/0007-feat-add-gn-files-to-use-packages-on-openeuler.patch b/0007-feat-add-gn-files-to-use-packages-on-openeuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..cb7e95d7a2adf094839242db98f6cec14f67e1c1 --- /dev/null +++ b/0007-feat-add-gn-files-to-use-packages-on-openeuler.patch @@ -0,0 +1,129 @@ +From b6fa9cb06682311714ce18e6a65f243c6299af2f Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0007 + +--- + .../bounds_checking_function/BUILD.gn | 28 +++++++++++++++++++ + .../bounds_checking_function/include | 1 + + .../compiler_gn/third_party/cJSON/BUILD.gn | 25 +++++++++++++++++ + .../compiler_gn/third_party/cJSON/cJSON.h | 1 + + .../compiler_gn/third_party/libxml2/BUILD.gn | 11 ++++++++ + .../third_party/libxml2/include/libxml | 1 + + 6 files changed, 67 insertions(+) + create mode 100644 openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn + create mode 120000 openeuler/compiler_gn/third_party/bounds_checking_function/include + create mode 100644 openeuler/compiler_gn/third_party/cJSON/BUILD.gn + create mode 120000 openeuler/compiler_gn/third_party/cJSON/cJSON.h + create mode 100644 openeuler/compiler_gn/third_party/libxml2/BUILD.gn + create mode 120000 openeuler/compiler_gn/third_party/libxml2/include/libxml + +diff --git a/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn b/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn +new file mode 100644 +index 0000000..ae44b79 +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/bounds_checking_function/BUILD.gn +@@ -0,0 +1,28 @@ ++# Copyright (c) 2021 Huawei Device Co., Ltd. ++# 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. ++import("//build/ohos.gni") ++ ++config("libsec_public_config") { ++ include_dirs = [ "include" ] ++ libs = [ "boundscheck" ] ++} ++ ++ohos_static_library("libsec_static") { ++ #libs = [ "boundscheck" ] ++ all_dependent_configs = [ ":libsec_public_config" ] ++} ++ ++ohos_shared_library("libsec_shared") { ++ #libs = [ "boundscheck" ] ++ all_dependent_configs = [ ":libsec_public_config" ] ++} +diff --git a/openeuler/compiler_gn/third_party/bounds_checking_function/include b/openeuler/compiler_gn/third_party/bounds_checking_function/include +new file mode 120000 +index 0000000..bc414ef +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/bounds_checking_function/include +@@ -0,0 +1 @@ ++/usr/include/ +\ No newline at end of file +diff --git a/openeuler/compiler_gn/third_party/cJSON/BUILD.gn b/openeuler/compiler_gn/third_party/cJSON/BUILD.gn +new file mode 100644 +index 0000000..48864a4 +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/cJSON/BUILD.gn +@@ -0,0 +1,25 @@ ++#Copyright (c) 2019-2021 Huawei Device Co., Ltd. ++#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. ++ ++import("//build/ohos.gni") ++import("//build/config/sysroot.gni") ++config("cJSON_config") { ++ include_dirs = [ "${sysroot}/usr/include/cjson" ] ++ libs = [ "cjson" ] ++} ++ohos_static_library("cjson_static") { ++ public_configs = [ ":cJSON_config" ] ++} ++ohos_shared_library("cjson") { ++ public_configs = [ ":cJSON_config" ] ++} +diff --git a/openeuler/compiler_gn/third_party/cJSON/cJSON.h b/openeuler/compiler_gn/third_party/cJSON/cJSON.h +new file mode 120000 +index 0000000..a75d9ff +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/cJSON/cJSON.h +@@ -0,0 +1 @@ ++/usr/include/cjson/cJSON.h +\ No newline at end of file +diff --git a/openeuler/compiler_gn/third_party/libxml2/BUILD.gn b/openeuler/compiler_gn/third_party/libxml2/BUILD.gn +new file mode 100644 +index 0000000..f097e1d +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/libxml2/BUILD.gn +@@ -0,0 +1,11 @@ ++import("//build/ohos.gni") ++import("//build/config/sysroot.gni") ++config("libxml2_private_config") { ++ include_dirs = [ "${sysroot}/usr/include/libxml2" ] ++ libs = [ "xml2" ] ++} ++ ++ohos_shared_library("libxml2") { ++ public_configs = [ ":libxml2_private_config" ] ++} ++ +diff --git a/openeuler/compiler_gn/third_party/libxml2/include/libxml b/openeuler/compiler_gn/third_party/libxml2/include/libxml +new file mode 120000 +index 0000000..8eb8d2d +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/libxml2/include/libxml +@@ -0,0 +1 @@ ++/usr/include/libxml2/libxml/ +\ No newline at end of file +-- +2.33.0 + diff --git a/0008-feat-Adapt-to-openeuler.patch b/0008-feat-Adapt-to-openeuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..898f451dca7ee6aa3209d9e0fcce0c316a561260 --- /dev/null +++ b/0008-feat-Adapt-to-openeuler.patch @@ -0,0 +1,895 @@ +From 36899a1bd498e730983259e8330a006eb09ff702 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0008 + +--- + build_scripts/build.sh | 27 +-- + common/BUILD.gn | 10 +- + common/bundle.json | 3 +- + config/BUILDCONFIG.gn | 54 ++---- + config/compiler/compiler.gni | 2 +- + config/ohos/BUILD.gn | 3 - + core/gn/BUILD.gn | 14 +- + ohos/images/BUILD.gn | 354 +++++++++++++++++------------------ + ohos/packages/BUILD.gn | 12 +- + ohos_var.gni | 15 +- + templates/cxx/cxx.gni | 58 ++---- + toolchain/gcc_toolchain.gni | 8 +- + toolchain/linux/BUILD.gn | 10 +- + toolchain/toolchain.gni | 3 +- + 14 files changed, 244 insertions(+), 329 deletions(-) + +diff --git a/build_scripts/build.sh b/build_scripts/build.sh +index 51f2e5e..dea04e9 100755 +--- a/build_scripts/build.sh ++++ b/build_scripts/build.sh +@@ -109,29 +109,12 @@ case $(uname -s) in + exit $RET + esac + +-args=$@ +-while test $# -gt 0 +-do +- case "$1" in --product-name) +- shift +- product_name=$1 +- ;; +- *) +- shift +- ;; +- esac +-done +- + # set python3 +-if [ "$product_name" == "openeuler" ]; then +- PYTHON3_DIR=/usr +- LLD_PATH=/usr/lib64/llvm15/bin +-else +- PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/ +- LLD_PATH="" +-fi ++# PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/ ++PYTHON3_DIR=/usr + PYTHON3=${PYTHON3_DIR}/bin/python3 + PYTHON=${PYTHON3_DIR}/bin/python ++LLVM=/usr/lib64/llvm15/bin + if [[ ! -f "${PYTHON3}" ]]; then + echo -e "\033[33m Please execute the build/prebuilts_download.sh \033[0m" + exit 1 +@@ -141,11 +124,11 @@ else + fi + fi + +-export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLD_PATH}:$PATH ++export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLVM}:$PATH + + ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py + +-${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $args ++${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $@ + + if [[ "$?" -ne 0 ]]; then + echo -e "\033[31m=====build ${product_name} error=====\033[0m" +diff --git a/common/BUILD.gn b/common/BUILD.gn +index 1a0ac2f..4daf6bd 100755 +--- a/common/BUILD.gn ++++ b/common/BUILD.gn +@@ -25,9 +25,9 @@ group("common_packages") { + } + deps = [ "//third_party/sqlite:sqlite" ] + +- deps += [ "musl:musl_install" ] ++ # deps += [ "musl:musl_install" ] + +- deps += [ "asan:libclang_rt.asan.so" ] ++ # deps += [ "asan:libclang_rt.asan.so" ] + + if (is_asan) { + deps += [ +@@ -38,9 +38,9 @@ group("common_packages") { + } else { + # ubsan.cfg defines the log_path, different with asan.cfg + deps += [ +- "ubsan:libclang_rt.ubsan_minimal.so", +- "ubsan:libclang_rt.ubsan_standalone.so", +- "ubsan:ubsan.cfg", ++ # "ubsan:libclang_rt.ubsan_minimal.so", ++ # "ubsan:libclang_rt.ubsan_standalone.so", ++ # "ubsan:ubsan.cfg", + ] + } + } +diff --git a/common/bundle.json b/common/bundle.json +index c329e14..6104fcf 100644 +--- a/common/bundle.json ++++ b/common/bundle.json +@@ -11,8 +11,7 @@ + "deps": {}, + "build": { + "sub_component": [ +- "//build/common:common_packages", +- "//third_party/f2fs-tools:f2fs-tools_host_toolchain" ++ "//build/common:common_packages" + ] + } + } +diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn +index ffff773..280894e 100755 +--- a/config/BUILDCONFIG.gn ++++ b/config/BUILDCONFIG.gn +@@ -65,25 +65,22 @@ declare_args() { + } + + declare_args() { +- if (product_name == "openeuler") { +- build_openeuler = true +- } else { +- build_openeuler = false +- } ++ preloader_output_dir = "//out/preloader/${product_name}" + } + + declare_args() { +- if (defined(build_openeuler) && build_openeuler && !defined(product_path)) { +- product_path = "" +- } ++ enable_lto_O0 = false + } + + declare_args() { +- preloader_output_dir = "//out/preloader/${product_name}" +-} ++ if (!defined(product_path)) { ++ product_path = "" ++ } ++ enable_hiviewdfx_hisysevent = false ++ enable_hiviewdfx_hitrace = false ++ enable_hiviewdfx_hidumper = false + +-declare_args() { +- enable_lto_O0 = false ++ enable_security_accesstoken = false + } + + product_build_config = +@@ -246,14 +243,10 @@ declare_args() { + is_desktop_linux = current_os == "linux" + + # Set to true when compiling with the Clang compiler. +- if (defined(build_openeuler) && build_openeuler) { +- is_clang = true +- } else { +- is_clang = current_os != "linux" || +- (current_cpu != "s390x" && current_cpu != "s390" && +- current_cpu != "ppc64" && current_cpu != "ppc" && +- current_cpu != "mips" && current_cpu != "mips64") +- } ++ is_clang = current_os != "linux" || ++ (current_cpu != "s390x" && current_cpu != "s390" && ++ current_cpu != "ppc64" && current_cpu != "ppc" && ++ current_cpu != "mips" && current_cpu != "mips64") + + # Allows the path to a custom target toolchain to be injected as a single + # argument, and set as the default toolchain. +@@ -274,11 +267,8 @@ declare_args() { + } + + declare_args() { +- if (defined(build_openeuler) && build_openeuler) { +- use_musl = false +- } else { +- use_musl = true +- } ++ # use_musl = true ++ use_musl = false + } + + declare_args() { +@@ -329,9 +319,7 @@ declare_args() { + if (host_os == "mac" && host_cpu == "arm64") { + full_mini_debug = false + } else { +- full_mini_debug = true +- } +- if (build_openeuler) { ++ # full_mini_debug = true + full_mini_debug = false + } + } +@@ -627,11 +615,8 @@ if (is_standard_system) { + default_compiler_configs += [ + "//build/config/clang:find_bad_constructs", + "//build/config/clang:extra_warnings", +- ] +- } +- if (build_openeuler) { +- default_compiler_configs += [ + "//build/openeuler:openeuler_include_dirs", ++ "//build/openeuler:openeuler_config", + ] + } + +@@ -642,11 +627,6 @@ if (is_standard_system) { + default_compiler_configs += [ "//build/config:release" ] + } + +- if (build_openeuler) { +- default_compiler_configs += [ +- "//build/openeuler:openeuler_config", +- ] +- } + # Static libraries and source sets use only the compiler ones. + default_static_library_configs = default_compiler_configs + default_source_set_configs = default_compiler_configs +diff --git a/config/compiler/compiler.gni b/config/compiler/compiler.gni +index d3e4a3f..766a9d8 100755 +--- a/config/compiler/compiler.gni ++++ b/config/compiler/compiler.gni +@@ -146,7 +146,7 @@ declare_args() { + # Linux. + use_lld = is_clang && + (is_win || (use_thin_lto && target_os != "chromeos") || +- (is_linux && current_cpu == "x64" && target_os != "chromeos") || ++ (is_linux && (current_cpu == "x64" || current_cpu == "arm64") && target_os != "chromeos") || + (is_ohos && (current_cpu != "arm" || arm_version >= 7)) || + (is_linux && current_cpu == "arm64")) + } +diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn +index a41763d..f177a03 100755 +--- a/config/ohos/BUILD.gn ++++ b/config/ohos/BUILD.gn +@@ -43,9 +43,6 @@ config("compiler") { + + cflags += [ "--target=$abi_target" ] + include_dirs = [ "${musl_sysroot}/usr/include/${abi_target}" ] +- if (build_openeuler) { +- include_dirs += [ "//build/openeuler/compiler_include" ] +- } + + ldflags += [ "--target=$abi_target" ] + +diff --git a/core/gn/BUILD.gn b/core/gn/BUILD.gn +index e87d50d..8344335 100755 +--- a/core/gn/BUILD.gn ++++ b/core/gn/BUILD.gn +@@ -56,16 +56,10 @@ if (product_name == "ohos-sdk") { + + group("build_all_test_pkg") { + testonly = true +- if (build_openeuler) { +- deps = [ +- "$root_build_dir/build_configs:parts_test", +- ] +- } else { +- deps = [ +- "$root_build_dir/build_configs:parts_test", +- "//test/testfwk/developer_test:make_temp_test", +- ] +- } ++ deps = [ ++ "$root_build_dir/build_configs:parts_test", ++ # "//test/testfwk/developer_test:make_temp_test", ++ ] + } + + group("make_test") { +diff --git a/ohos/images/BUILD.gn b/ohos/images/BUILD.gn +index ae509ea..813c89a 100644 +--- a/ohos/images/BUILD.gn ++++ b/ohos/images/BUILD.gn +@@ -18,194 +18,192 @@ import("//build/ohos/build_var.gni") + # import target_platform_list + import("${build_configs_path}/platforms_list.gni") + +-if (build_openeuler) { +- group("make_images") { +- deps = [] +- if (is_standard_system) { +- foreach(_platform, target_platform_list) { +- deps += [ +- "//build/ohos/packages:${_platform}_install_modules" +- ] +- } +- } +- } +-} else { +- group("make_images") { +- deps = [] +- if (is_standard_system) { +- deps = [ +- "//third_party/e2fsprogs:e2fsprogs_host_toolchain", +- "//third_party/f2fs-tools:f2fs-tools_host_toolchain", +- ] +- foreach(_platform, target_platform_list) { +- deps += [ +- ":${_platform}_sys_prod_image", +- ":${_platform}_system_image", +- ":${_platform}_userdata_image", +- ":${_platform}_vendor_image", +- ] +- if (enable_ramdisk) { +- deps += [ +- ":${_platform}_ramdisk_image", +- ":${_platform}_updater_ramdisk_image", +- ] +- } else { +- deps += [ ":${_platform}_updater_image" ] +- } +- } +- deps += [ ":chip_prod_image" ] +- } else { +- deps += [ "//build/ohos/packages:packer" ] +- } +- } ++# group("make_images") { ++# deps = [] ++# if (is_standard_system) { ++# deps = [ ++# "//third_party/e2fsprogs:e2fsprogs_host_toolchain", ++# "//third_party/f2fs-tools:f2fs-tools_host_toolchain", ++# ] ++# foreach(_platform, target_platform_list) { ++# deps += [ ++# ":${_platform}_sys_prod_image", ++# ":${_platform}_system_image", ++# ":${_platform}_userdata_image", ++# ":${_platform}_vendor_image", ++# ] ++# if (enable_ramdisk) { ++# deps += [ ++# ":${_platform}_ramdisk_image", ++# ":${_platform}_updater_ramdisk_image", ++# ] ++# } else { ++# deps += [ ":${_platform}_updater_image" ] ++# } ++# } ++# deps += [ ":chip_prod_image" ] ++# } else { ++# deps += [ "//build/ohos/packages:packer" ] ++# } ++# } + +- group("chip_prod_image") { +- deps = [] +- if (is_standard_system) { +- deps += [ +- "//third_party/e2fsprogs:e2fsprogs_host_toolchain", +- "//third_party/f2fs-tools:f2fs-tools_host_toolchain", +- ] +- } +- foreach(_platform, target_platform_list) { +- if (chip_product_list == []) { +- deps += [ ":${_platform}_chip_prod_image" ] +- } else { +- foreach(_product, chip_product_list) { +- deps += [ ":${_platform}_${_product}_chip_prod_image" ] +- } +- } +- } +- } ++# group("chip_prod_image") { ++# deps = [] ++# if (is_standard_system) { ++# deps += [ ++# "//third_party/e2fsprogs:e2fsprogs_host_toolchain", ++# "//third_party/f2fs-tools:f2fs-tools_host_toolchain", ++# ] ++# } ++# foreach(_platform, target_platform_list) { ++# if (chip_product_list == []) { ++# deps += [ ":${_platform}_chip_prod_image" ] ++# } else { ++# foreach(_product, chip_product_list) { ++# deps += [ ":${_platform}_${_product}_chip_prod_image" ] ++# } ++# } ++# } ++# } + +- foreach(_platform, target_platform_list) { +- current_platform = _platform +- current_platform_dir = "${product_output_dir}/$current_platform" ++# foreach(_platform, target_platform_list) { ++# current_platform = _platform ++# current_platform_dir = "${product_output_dir}/$current_platform" + +- system_module_info_list = "${current_platform_dir}/system_module_info.json" +- system_modules_list = "${current_platform_dir}/system_modules_list.txt" ++# system_module_info_list = "${current_platform_dir}/system_module_info.json" ++# system_modules_list = "${current_platform_dir}/system_modules_list.txt" + +- image_list = [ +- "system", +- "vendor", +- "userdata", +- "sys_prod", +- "chip_prod", +- ] +- if (enable_ramdisk) { +- image_list += [ +- "ramdisk", +- "updater_ramdisk", +- ] +- } else { +- image_list += [ "updater" ] +- } +- foreach(_image_name, image_list) { +- action_with_pydeps("${_platform}_${_image_name}_image") { +- script = "//build/ohos/images/build_image.py" +- depfile = "$target_gen_dir/$target_name.d" +- deps = [ "//build/ohos/packages:${_platform}_install_modules" ] +- if (!asan_detector) { +- deps += [ "//build/ohos/packages:high_privilege_process_validate" ] +- } ++# image_list = [ ++# "system", ++# "vendor", ++# "userdata", ++# "sys_prod", ++# "chip_prod", ++# ] ++# if (enable_ramdisk) { ++# image_list += [ ++# "ramdisk", ++# "updater_ramdisk", ++# ] ++# } else { ++# image_list += [ "updater" ] ++# } ++# foreach(_image_name, image_list) { ++# action_with_pydeps("${_platform}_${_image_name}_image") { ++# script = "//build/ohos/images/build_image.py" ++# depfile = "$target_gen_dir/$target_name.d" ++# deps = [ "//build/ohos/packages:${_platform}_install_modules" ] ++# if (!asan_detector) { ++# deps += [ "//build/ohos/packages:high_privilege_process_validate" ] ++# } + +- image_config_file = +- "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" +- if (is_debug) { +- image_config_file = +- "//build/ohos/images/mkimage/debug/${_image_name}_image_conf.txt" +- } +- device_image_config_file = +- "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" +- if (_image_name == "ramdisk" || _image_name == "updater_ramdisk") { +- output_image_file = "$root_build_dir/${_image_name}.img" +- } else { +- output_image_file = "$current_platform_dir/images/${_image_name}.img" +- } +- if (_image_name == "updater_ramdisk") { +- image_input_path = "$current_platform_dir/updater" +- } else { +- image_input_path = "$current_platform_dir/${_image_name}" +- } +- if (_image_name == "userdata") { +- image_input_path = "$current_platform_dir/data" +- } ++# image_config_file = ++# "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" ++# if (is_debug) { ++# image_config_file = ++# "//build/ohos/images/mkimage/debug/${_image_name}_image_conf.txt" ++# } ++# device_image_config_file = ++# "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" ++# if (_image_name == "ramdisk" || _image_name == "updater_ramdisk") { ++# output_image_file = "$root_build_dir/${_image_name}.img" ++# } else { ++# output_image_file = "$current_platform_dir/images/${_image_name}.img" ++# } ++# if (_image_name == "updater_ramdisk") { ++# image_input_path = "$current_platform_dir/updater" ++# } else { ++# image_input_path = "$current_platform_dir/${_image_name}" ++# } ++# if (_image_name == "userdata") { ++# image_input_path = "$current_platform_dir/data" ++# } + +- sources = [ +- image_config_file, +- system_module_info_list, +- system_modules_list, +- ] +- outputs = [ output_image_file ] +- args = [ +- "--depfile", +- rebase_path(depfile, root_build_dir), +- "--image-name", +- _image_name, +- "--input-path", +- rebase_path(image_input_path, root_build_dir), +- "--image-config-file", +- rebase_path(image_config_file, root_build_dir), +- "--device-image-config-file", +- rebase_path(device_image_config_file, root_build_dir), +- "--output-image", +- rebase_path(output_image_file, root_build_dir), +- "--target-cpu", +- target_cpu, +- "--build-image-tools-path", +- ] +- args += rebase_path(build_image_tools_path, root_build_dir) +- if (sparse_image) { +- args += [ "--sparse-image" ] +- } +- } +- } ++# sources = [ ++# image_config_file, ++# system_module_info_list, ++# system_modules_list, ++# ] ++# outputs = [ output_image_file ] ++# args = [ ++# "--depfile", ++# rebase_path(depfile, root_build_dir), ++# "--image-name", ++# _image_name, ++# "--input-path", ++# rebase_path(image_input_path, root_build_dir), ++# "--image-config-file", ++# rebase_path(image_config_file, root_build_dir), ++# "--device-image-config-file", ++# rebase_path(device_image_config_file, root_build_dir), ++# "--output-image", ++# rebase_path(output_image_file, root_build_dir), ++# "--target-cpu", ++# target_cpu, ++# "--build-image-tools-path", ++# ] ++# args += rebase_path(build_image_tools_path, root_build_dir) ++# if (sparse_image) { ++# args += [ "--sparse-image" ] ++# } ++# } ++# } + +- # Used to generate chip_prod images of different products +- foreach(_product, chip_product_list) { +- _image_name = "chip_prod" +- action_with_pydeps("${_platform}_${_product}_chip_prod_image") { +- script = "//build/ohos/images/build_image.py" +- depfile = "$target_gen_dir/$target_name.d" +- deps = [ "//build/ohos/packages:${_platform}_install_modules" ] ++# # Used to generate chip_prod images of different products ++# foreach(_product, chip_product_list) { ++# _image_name = "chip_prod" ++# action_with_pydeps("${_platform}_${_product}_chip_prod_image") { ++# script = "//build/ohos/images/build_image.py" ++# depfile = "$target_gen_dir/$target_name.d" ++# deps = [ "//build/ohos/packages:${_platform}_install_modules" ] + +- image_config_file = +- "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" +- device_image_config_file = +- "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" +- image_input_path = "${current_platform_dir}/${_image_name}/${_product}" +- output_image_file = +- "${current_platform_dir}/images/${_product}/${_image_name}.img" ++# image_config_file = ++# "//build/ohos/images/mkimage/${_image_name}_image_conf.txt" ++# device_image_config_file = ++# "${product_output_dir}/imagesconf/${_image_name}_image_conf.txt" ++# image_input_path = "${current_platform_dir}/${_image_name}/${_product}" ++# output_image_file = ++# "${current_platform_dir}/images/${_product}/${_image_name}.img" + +- sources = [ +- image_config_file, +- system_module_info_list, +- system_modules_list, +- ] +- outputs = [ output_image_file ] ++# sources = [ ++# image_config_file, ++# system_module_info_list, ++# system_modules_list, ++# ] ++# outputs = [ output_image_file ] + +- args = [ +- "--depfile", +- rebase_path(depfile, root_build_dir), +- "--image-name", +- _image_name, +- "--input-path", +- rebase_path(image_input_path, root_build_dir), +- "--image-config-file", +- rebase_path(image_config_file, root_build_dir), +- "--device-image-config-file", +- rebase_path(device_image_config_file, root_build_dir), +- "--output-image", +- rebase_path(output_image_file, root_build_dir), +- "--target-cpu", +- target_cpu, +- "--build-image-tools-path", +- ] +- args += rebase_path(build_image_tools_path, root_build_dir) +- if (sparse_image) { +- args += [ "--sparse-image" ] +- } +- } ++# args = [ ++# "--depfile", ++# rebase_path(depfile, root_build_dir), ++# "--image-name", ++# _image_name, ++# "--input-path", ++# rebase_path(image_input_path, root_build_dir), ++# "--image-config-file", ++# rebase_path(image_config_file, root_build_dir), ++# "--device-image-config-file", ++# rebase_path(device_image_config_file, root_build_dir), ++# "--output-image", ++# rebase_path(output_image_file, root_build_dir), ++# "--target-cpu", ++# target_cpu, ++# "--build-image-tools-path", ++# ] ++# args += rebase_path(build_image_tools_path, root_build_dir) ++# if (sparse_image) { ++# args += [ "--sparse-image" ] ++# } ++# } ++# } ++# } ++ ++group("make_images") { ++ deps = [] ++ if (is_standard_system) { ++ foreach(_platform, target_platform_list) { ++ deps += [ ++ "//build/ohos/packages:${_platform}_install_modules" ++ ] + } + } + } +diff --git a/ohos/packages/BUILD.gn b/ohos/packages/BUILD.gn +index 847d2e8..18a5ee3 100755 +--- a/ohos/packages/BUILD.gn ++++ b/ohos/packages/BUILD.gn +@@ -591,12 +591,8 @@ group("package_testcase") { + + group("build_all_test_pkg") { + testonly = true +- if (build_openeuler) { +- deps = [] +- } else { +- deps = [ +- "$root_build_dir/build_configs:parts_test", +- "//test/testfwk/developer_test:make_temp_test", +- ] +- } ++ deps = [ ++ "$root_build_dir/build_configs:parts_test", ++ # "//test/testfwk/developer_test:make_temp_test", ++ ] + } +diff --git a/ohos_var.gni b/ohos_var.gni +index 0ba4b70..1e94387 100755 +--- a/ohos_var.gni ++++ b/ohos_var.gni +@@ -148,23 +148,10 @@ declare_args() { + } + + declare_args() { +- load_test_config = true +-} +- +-if (build_openeuler) { ++ # load_test_config = true + load_test_config = false + } + +-declare_args() { +- # hiviewdfx +- enable_hiviewdfx_hisysevent = false +- enable_hiviewdfx_hitrace = false +- enable_hiviewdfx_hidumper = false +- +- # security +- enable_security_accesstoken = false +-} +- + declare_args() { + # Skip module_info generation when the packaging image is not needed + skip_gen_module_info = false +diff --git a/templates/cxx/cxx.gni b/templates/cxx/cxx.gni +index 1c82f82..a937643 100755 +--- a/templates/cxx/cxx.gni ++++ b/templates/cxx/cxx.gni +@@ -105,12 +105,10 @@ template("ohos_executable") { + ]) + } + +- if (defined(build_openeuler) && !build_openeuler) { +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) +- } +- } ++ # _sanitize_config_target = "${target_name}__sanitizer_config" ++ # ohos_sanitizer_config(_sanitize_config_target) { ++ # forward_variables_from(invoker, [ "sanitize" ]) ++ # } + + _test_target = defined(invoker.testonly) && invoker.testonly + if (!_test_target) { +@@ -161,9 +159,7 @@ template("ohos_executable") { + if (defined(invoker.remove_configs)) { + configs -= invoker.remove_configs + } +- if (defined(build_openeuler) && !build_openeuler) { +- configs += [ ":$_sanitize_config_target" ] +- } ++ # configs += [ ":$_sanitize_config_target" ] + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -427,12 +423,10 @@ template("ohos_shared_library") { + ]) + } + +- if (defined(build_openeuler) && !build_openeuler) { +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) +- } +- } ++ # _sanitize_config_target = "${target_name}__sanitizer_config" ++ # ohos_sanitizer_config(_sanitize_config_target) { ++ # forward_variables_from(invoker, [ "sanitize" ]) ++ # } + + _test_target = defined(invoker.testonly) && invoker.testonly + if (!_test_target) { +@@ -493,10 +487,7 @@ template("ohos_shared_library") { + if (defined(invoker.remove_configs)) { + configs -= invoker.remove_configs + } +- +- if (defined(build_openeuler) && !build_openeuler) { +- configs += [ ":$_sanitize_config_target" ] +- } ++ # configs += [ ":$_sanitize_config_target" ] + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -771,12 +762,10 @@ template("ohos_static_library") { + ]) + } + +- if (defined(build_openeuler) && !build_openeuler) { +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) +- } +- } ++ # _sanitize_config_target = "${target_name}__sanitizer_config" ++ # ohos_sanitizer_config(_sanitize_config_target) { ++ # forward_variables_from(invoker, [ "sanitize" ]) ++ # } + + _test_target = defined(invoker.testonly) && invoker.testonly + if (!_test_target) { +@@ -821,9 +810,7 @@ template("ohos_static_library") { + if (is_standard_system) { + configs -= [ "//build/config/compiler:thin_archive" ] + } +- if (defined(build_openeuler) && !build_openeuler) { +- configs += [ ":$_sanitize_config_target" ] +- } ++ # configs += [ ":$_sanitize_config_target" ] + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +@@ -947,12 +934,10 @@ template("ohos_source_set") { + ]) + } + +- if (defined(build_openeuler) && !build_openeuler) { +- _sanitize_config_target = "${target_name}__sanitizer_config" +- ohos_sanitizer_config(_sanitize_config_target) { +- forward_variables_from(invoker, [ "sanitize" ]) +- } +- } ++ # _sanitize_config_target = "${target_name}__sanitizer_config" ++ # ohos_sanitizer_config(_sanitize_config_target) { ++ # forward_variables_from(invoker, [ "sanitize" ]) ++ # } + + _test_target = defined(invoker.testonly) && invoker.testonly + if (!_test_target) { +@@ -995,10 +980,7 @@ template("ohos_source_set") { + if (defined(invoker.remove_configs)) { + configs -= invoker.remove_configs + } +- +- if (defined(build_openeuler) && !build_openeuler) { +- configs += [ ":$_sanitize_config_target" ] +- } ++ # configs += [ ":$_sanitize_config_target" ] + configs += [ ":$_security_config_target" ] + + if (defined(invoker.use_exceptions) && invoker.use_exceptions) { +diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni +index f521d7c..0c91ccf 100755 +--- a/toolchain/gcc_toolchain.gni ++++ b/toolchain/gcc_toolchain.gni +@@ -584,12 +584,8 @@ template("clang_toolchain") { + } + + gcc_toolchain(target_name) { +- if (build_openeuler) { +- prefix = "/usr/bin" +- toolprefix = "/usr/bin/" +- } else { +- prefix = rebase_path("$clang_base_path/bin", root_build_dir) +- } ++ # prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ prefix = "/usr/bin" + cc = "$prefix/clang" + cxx = "$prefix/clang++" + ld = cxx +diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn +index 59449f6..353b13d 100755 +--- a/toolchain/linux/BUILD.gn ++++ b/toolchain/linux/BUILD.gn +@@ -120,29 +120,31 @@ gcc_toolchain("x64") { + clang_toolchain("linux_clang_x86_64") { + # Output linker map files for binary size analysis. + enable_linker_map = true +- ++ toolprefix = "/usr/bin/" + strip = "/usr/bin/llvm-strip" + toolchain_args = { + current_cpu = "x64" + current_os = "linux" + } +- shlib_extension = ".so" ++ shlib_extension = ".z.so" + } + clang_toolchain("clang_x86_64") { + # Output linker map files for binary size analysis. + enable_linker_map = true +- ++ toolprefix = "/usr/bin/" + strip = "/usr/bin/llvm-strip" + toolchain_args = { + current_cpu = "x64" + current_os = "linux" + } +- shlib_extension = ".so" ++ shlib_extension = ".z.so" + } + + clang_toolchain("linux_clang_arm64") { ++ toolprefix = "/usr/bin/" + toolchain_args = { + current_cpu = "arm64" + current_os = "linux" + } ++ shlib_extension = ".z.so" + } +diff --git a/toolchain/toolchain.gni b/toolchain/toolchain.gni +index a079f0f..1e95b63 100755 +--- a/toolchain/toolchain.gni ++++ b/toolchain/toolchain.gni +@@ -68,7 +68,8 @@ if (is_mac) { + shlib_extension = ".dll" + executable_extension = ".exe" + } else if (is_posix) { +- shlib_extension = ".so" ++ # shlib_extension = ".so" ++ shlib_extension = ".z.so" + } else if (is_win) { + shlib_extension = ".dll" + } else { +-- +2.33.0 + diff --git a/0009-feat-add-common-subsystem-and-delete-useless-config.patch b/0009-feat-add-common-subsystem-and-delete-useless-config.patch new file mode 100644 index 0000000000000000000000000000000000000000..671a2a7841fe72ccddfd63546ec3a8693826090a --- /dev/null +++ b/0009-feat-add-common-subsystem-and-delete-useless-config.patch @@ -0,0 +1,39 @@ +From 617f6a50de2e620d087aeacae0c1b228796cb9ba Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:52 +0800 +Subject: [PATCH] 0009 + +--- + openeuler/vendor/openeuler/openeuler/config.json | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/openeuler/vendor/openeuler/openeuler/config.json b/openeuler/vendor/openeuler/openeuler/config.json +index f20f9c3..2dfbb49 100644 +--- a/openeuler/vendor/openeuler/openeuler/config.json ++++ b/openeuler/vendor/openeuler/openeuler/config.json +@@ -1,7 +1,6 @@ + { + "product_name": "openeuler", + "device_company": "openeuler", +- "device_build_path": "device/board/openeuler/openeuler", + "target_os": "linux", + "type": "standard", + "version": "3.0", +@@ -13,6 +12,14 @@ + "support_jsapi": false, + "inherit": [], + "subsystems": [ ++ { ++ "subsystem": "common", ++ "components": [ ++ { ++ "component": "common" ++ } ++ ] ++ }, + { + "subsystem": "commonlibrary", + "components": [ +-- +2.33.0 + diff --git a/0010-feat-use-include-samgr-for-samgr-include-files-confi.patch b/0010-feat-use-include-samgr-for-samgr-include-files-confi.patch new file mode 100644 index 0000000000000000000000000000000000000000..9648db2c89a2e82c09530ba44ca5a60985a319ac --- /dev/null +++ b/0010-feat-use-include-samgr-for-samgr-include-files-confi.patch @@ -0,0 +1,59 @@ +From 7526b048d75a773274144236209eea422e2307c5 Mon Sep 17 00:00:00 2001 +From: tian hang +Date: Fri, 19 May 2023 09:34:27 +0000 +Subject: [PATCH 10/11] feat:use include/samgr for samgr include files config + +--- + .../systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn | 2 -- + .../systemabilitymgr/samgr/interfaces/innerkits/common/include | 2 +- + .../samgr/interfaces/innerkits/samgr_proxy/include | 2 +- + .../foundation/systemabilitymgr/samgr/services/lsamgr/include | 2 +- + 4 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn +index a129d8b..bf8ddb3 100644 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn +@@ -27,7 +27,6 @@ config("config_samgr_common") { + libs = ["samgr_common",] + } + +-################################################################################ + group("samgr_common") { + + public_configs = [ ":config_samgr_common" ] +@@ -35,4 +34,3 @@ group("samgr_common") { + all_dependent_configs = [ ":all_config_samgr_common" ] + + } +-################################################################################ +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/include b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/include +index bc414ef..fa4da59 120000 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/include ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/include +@@ -1 +1 @@ +-/usr/include/ +\ No newline at end of file ++/usr/include/samgr/ +\ No newline at end of file +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include +index bc414ef..fa4da59 120000 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include +@@ -1 +1 @@ +-/usr/include/ +\ No newline at end of file ++/usr/include/samgr/ +\ No newline at end of file +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/services/lsamgr/include b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/services/lsamgr/include +index bc414ef..fa4da59 120000 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/services/lsamgr/include ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/services/lsamgr/include +@@ -1 +1 @@ +-/usr/include/ +\ No newline at end of file ++/usr/include/samgr/ +\ No newline at end of file +-- +2.33.0 + diff --git a/0011-feat-use-.z-for-libs-name.patch b/0011-feat-use-.z-for-libs-name.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2c1a8569561c78f785eafd4fb4281ac2d73884a --- /dev/null +++ b/0011-feat-use-.z-for-libs-name.patch @@ -0,0 +1,47 @@ +From 9801c82c2e5f8f2fd20115c3af413d912d305e4b Mon Sep 17 00:00:00 2001 +From: tian hang +Date: Fri, 19 May 2023 09:37:15 +0000 +Subject: [PATCH 11/11] feat:use .z for libs name + +--- + .../samgr/interfaces/innerkits/common/BUILD.gn | 4 ++-- + .../samgr/interfaces/innerkits/samgr_proxy/BUILD.gn | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn +index bf8ddb3..4b46680 100644 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/common/BUILD.gn +@@ -17,14 +17,14 @@ config("all_config_samgr_common") { + include_dirs = [ + "include", + ] +- libs = ["samgr_common",] ++ libs = ["samgr_common.z",] + } + + config("config_samgr_common") { + include_dirs = [ + "include", + ] +- libs = ["samgr_common",] ++ libs = ["samgr_common.z",] + } + + group("samgr_common") { +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/BUILD.gn +index 44b42ad..b68ec17 100644 +--- a/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/BUILD.gn ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/BUILD.gn +@@ -20,7 +20,7 @@ config("samgr_proxy_config") { + "//third_party/libxml2/include", + ] + +- libs = ["samgr_proxy",] ++ libs = ["samgr_proxy.z",] + } + + #config("samgr_proxy_private_config") { +-- +2.33.0 + diff --git a/0012-fix-rpm-build-fail-caused-by-wrong-useless-code.patch b/0012-fix-rpm-build-fail-caused-by-wrong-useless-code.patch new file mode 100644 index 0000000000000000000000000000000000000000..d8610fd5a375a2fc726cf002c7fd108157a7098e --- /dev/null +++ b/0012-fix-rpm-build-fail-caused-by-wrong-useless-code.patch @@ -0,0 +1,24 @@ +From 1cbc7b95aae9da56ed4fa257d7132ac03c378601 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0012 + +--- + config/mac/xcrun.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/mac/xcrun.py b/config/mac/xcrun.py +index 0e29287..4f48d12 100755 +--- a/config/mac/xcrun.py ++++ b/config/mac/xcrun.py +@@ -25,6 +25,6 @@ if __name__ == '__main__': + if rv == 0 and args.stamp: + if os.path.exists(args.stamp): + os.unlink(args.stamp) +- with open(args.stamp, 'w+') as fp: ++ #with open(args.stamp, 'w+') as fp: + + sys.exit(rv) +-- +2.33.0 + diff --git a/0013-feature-use-llvm-tools-version-15-for-build.patch b/0013-feature-use-llvm-tools-version-15-for-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..2de1e9c9978385857f8d82a9328247b839967711 --- /dev/null +++ b/0013-feature-use-llvm-tools-version-15-for-build.patch @@ -0,0 +1,104 @@ +From cf30b6c5ecd1dc864bf25c3eea3c3b420797d6f3 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0013 + +--- + build_scripts/build.sh | 3 +-- + config/clang/clang.gni | 4 ++-- + config/ohos/BUILD.gn | 2 +- + config/ohos/config.gni | 2 +- + toolchain/gcc_toolchain.gni | 2 +- + toolchain/toolchain.gni | 2 +- + 6 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/build_scripts/build.sh b/build_scripts/build.sh +index dea04e9..f17f9fe 100755 +--- a/build_scripts/build.sh ++++ b/build_scripts/build.sh +@@ -114,7 +114,6 @@ esac + PYTHON3_DIR=/usr + PYTHON3=${PYTHON3_DIR}/bin/python3 + PYTHON=${PYTHON3_DIR}/bin/python +-LLVM=/usr/lib64/llvm15/bin + if [[ ! -f "${PYTHON3}" ]]; then + echo -e "\033[33m Please execute the build/prebuilts_download.sh \033[0m" + exit 1 +@@ -124,7 +123,7 @@ else + fi + fi + +-export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLVM}:$PATH ++export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH + + ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py + +diff --git a/config/clang/clang.gni b/config/clang/clang.gni +index 38719bb..9728e12 100755 +--- a/config/clang/clang.gni ++++ b/config/clang/clang.gni +@@ -4,9 +4,9 @@ + + import("//build/toolchain/toolchain.gni") + +-default_clang_base_path = "//prebuilts/clang/ohos/${host_platform_dir}/llvm" ++default_clang_base_path = "/usr/lib64/llvm15/" + clang_lib_path = +- "//prebuilts/clang/ohos/${host_platform_dir}/llvm/lib/clang/12.0.1/lib" ++ "${default_clang_base_path}/lib/clang/15.0.7/lib" + + declare_args() { + # Indicates if the build should use the Chrome-specific plugins for enforcing +diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn +index f177a03..84a3ea1 100755 +--- a/config/ohos/BUILD.gn ++++ b/config/ohos/BUILD.gn +@@ -79,7 +79,7 @@ config("runtime_library") { + + ldflags += [ + "-L" + rebase_path("${musl_sysroot}/usr/lib/${abi_target}", root_build_dir), +- "-L" + rebase_path("${clang_base_path}/lib/clang/12.0.1/lib/${abi_target}", ++ "-L" + rebase_path("${clang_base_path}/lib/clang/15.0.7/lib/${abi_target}", + root_build_dir), + ] + +diff --git a/config/ohos/config.gni b/config/ohos/config.gni +index b7e1c45..e5d4d54 100644 +--- a/config/ohos/config.gni ++++ b/config/ohos/config.gni +@@ -37,5 +37,5 @@ if (is_ohos) { + assert(false, "Architecture not supported") + } + +- libclang_rt_file = "${clang_base_path}/lib/clang/12.0.1/lib/${abi_target}/libclang_rt.builtins.a" ++ libclang_rt_file = "${clang_base_path}/lib/clang/15.0.7/lib/${abi_target}/libclang_rt.builtins.a" + } +diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni +index 0c91ccf..6a68e42 100755 +--- a/toolchain/gcc_toolchain.gni ++++ b/toolchain/gcc_toolchain.gni +@@ -585,7 +585,7 @@ template("clang_toolchain") { + + gcc_toolchain(target_name) { + # prefix = rebase_path("$clang_base_path/bin", root_build_dir) +- prefix = "/usr/bin" ++ prefix = "/usr/lib64/llvm15/bin" + cc = "$prefix/clang" + cxx = "$prefix/clang++" + ld = cxx +diff --git a/toolchain/toolchain.gni b/toolchain/toolchain.gni +index 1e95b63..7794e6f 100755 +--- a/toolchain/toolchain.gni ++++ b/toolchain/toolchain.gni +@@ -46,7 +46,7 @@ hermetic_xcode_path = + declare_args() { + if (is_clang) { + # Clang compiler version. Clang files are placed at version-dependent paths. +- clang_version = "12.0.1" ++ clang_version = "15.0.7" + } + use_custom_clang = true + } +-- +2.33.0 + diff --git a/0014-feat-delete-the-default-sqlite-deps.patch b/0014-feat-delete-the-default-sqlite-deps.patch new file mode 100644 index 0000000000000000000000000000000000000000..9486e4b9201c2502e0c344e26414bab8560e830c --- /dev/null +++ b/0014-feat-delete-the-default-sqlite-deps.patch @@ -0,0 +1,26 @@ +From 62f7f666dba56a23d31d53a480f5957dc6e1f05d Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0014 + +--- + common/BUILD.gn | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/common/BUILD.gn b/common/BUILD.gn +index 4daf6bd..2a0cfe2 100755 +--- a/common/BUILD.gn ++++ b/common/BUILD.gn +@@ -23,7 +23,8 @@ group("common_packages") { + if (device_name == "hi3516dv300") { + assert(common_feature_verify) + } +- deps = [ "//third_party/sqlite:sqlite" ] ++ #deps = [ "//third_party/sqlite:sqlite" ] ++ deps = [] + + # deps += [ "musl:musl_install" ] + +-- +2.33.0 + diff --git a/0015-feat-and-hilog-gn-files.patch b/0015-feat-and-hilog-gn-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..702de9b2f7c1074460699a9a65972a5ff805d061 --- /dev/null +++ b/0015-feat-and-hilog-gn-files.patch @@ -0,0 +1,236 @@ +From 9c2b1b9b9d9170775358732a04ff65bb65ed6c55 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0015 + +--- + .../base/hiviewdfx/hilog/bundle.json | 37 ++++++++++ + .../hiviewdfx/hilog/interfaces/bundle.json | 74 +++++++++++++++++++ + .../hilog/interfaces/native/bundle.json | 37 ++++++++++ + .../interfaces/native/innerkits/BUILD.gn | 34 +++++++++ + .../hilog/interfaces/native/innerkits/include | 1 + + 5 files changed, 183 insertions(+) + create mode 100644 openeuler/compiler_gn/base/hiviewdfx/hilog/bundle.json + create mode 100644 openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/bundle.json + create mode 100644 openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/bundle.json + create mode 100644 openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/BUILD.gn + create mode 120000 openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/include + +diff --git a/openeuler/compiler_gn/base/hiviewdfx/hilog/bundle.json b/openeuler/compiler_gn/base/hiviewdfx/hilog/bundle.json +new file mode 100644 +index 0000000..8bfadc0 +--- /dev/null ++++ b/openeuler/compiler_gn/base/hiviewdfx/hilog/bundle.json +@@ -0,0 +1,37 @@ ++{ ++ "name": "@ohos/hilog", ++ "description": "Native log interface provided for system", ++ "version": "3.1", ++ "license": "Apache License 2.0", ++ "publishAs": "code-segment", ++ "segment": { ++ "destPath": "base/hiviewdfx/hilog" ++ }, ++ "dirs": {}, ++ "scripts": {}, ++ "component": { ++ "name": "hilog", ++ "subsystem": "hiviewdfx", ++ "syscap": [ ++ "SystemCapability.HiviewDFX.HiLog" ++ ], ++ "adapted_system_type": [ ++ "standard" ++ ], ++ "rom": "188KB", ++ "ram": "2000KB", ++ "deps": { ++ "components": [ ++ "init", ++ "utils_base" ++ ], ++ "third_party": [ ++ "bounds_checking_function", ++ "zlib" ++ ] ++ }, ++ "build": { ++ "sub_component": [] ++ } ++ } ++} +diff --git a/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/bundle.json b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/bundle.json +new file mode 100644 +index 0000000..11eee3f +--- /dev/null ++++ b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/bundle.json +@@ -0,0 +1,74 @@ ++{ ++ "name": "@ohos/hilog_native", ++ "description": "Native log interface provided for system", ++ "version": "3.1", ++ "license": "Apache License 2.0", ++ "publishAs": "code-segment", ++ "segment": { ++ "destPath": "base/hiviewdfx/hilog" ++ }, ++ "dirs": {}, ++ "scripts": {}, ++ "component": { ++ "name": "hilog_native", ++ "subsystem": "hiviewdfx", ++ "syscap": [ ++ "SystemCapability.HiviewDFX.HiLog" ++ ], ++ "adapted_system_type": [ ++ "standard" ++ ], ++ "rom": "188KB", ++ "ram": "2000KB", ++ "deps": { ++ "components": [ ++ "c_utils", ++ "init", ++ "napi" ++ ], ++ "third_party": [ ++ "bounds_checking_function", ++ "zlib" ++ ] ++ }, ++ "features": [ ++ "hilog_native_feature_ohcore" ++ ], ++ "build": { ++ "group_type": { ++ "base_group": [ ++ ++ ], ++ "fwk_group": [], ++ "service_group": [ ++ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_base", ++ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog" ++ ] ++ }, ++ "inner_kits": [ ++ { ++ "name": "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", ++ "header": { ++ "header_files": [ ++ "hilog/log.h", ++ "hilog/log_c.h", ++ "hilog/log_cpp.h", ++ "hilog_trace.h" ++ ], ++ "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" ++ } ++ }, ++ { ++ "name": "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_base", ++ "header": { ++ "header_files": [ ++ "hilog_base/log_base.h" ++ ], ++ "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" ++ } ++ } ++ ], ++ "test": [] ++ } ++ } ++} +diff --git a/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/bundle.json b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/bundle.json +new file mode 100644 +index 0000000..d9e1950 +--- /dev/null ++++ b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/bundle.json +@@ -0,0 +1,37 @@ ++{ ++ "name": "@ohos/hiviewdfx_hilog_native", ++ "description": "Native log interface provided for system", ++ "version": "3.1", ++ "license": "Apache License 2.0", ++ "publishAs": "code-segment", ++ "segment": { ++ "destPath": "base/hiviewdfx/hilog" ++ }, ++ "dirs": {}, ++ "scripts": {}, ++ "component": { ++ "name": "hiviewdfx_hilog_native", ++ "subsystem": "hiviewdfx", ++ "syscap": [ ++ "SystemCapability.HiviewDFX.HiLog" ++ ], ++ "adapted_system_type": [ ++ "standard" ++ ], ++ "rom": "188KB", ++ "ram": "2000KB", ++ "deps": { ++ "components": [ ++ "init", ++ "utils_base" ++ ], ++ "third_party": [ ++ "bounds_checking_function", ++ "zlib" ++ ] ++ }, ++ "build": { ++ "sub_component": [] ++ } ++ } ++} +\ No newline at end of file +diff --git a/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/BUILD.gn b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/BUILD.gn +new file mode 100644 +index 0000000..bd1f91b +--- /dev/null ++++ b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/BUILD.gn +@@ -0,0 +1,34 @@ ++# Copyright (c) 2021 Huawei Device Co., Ltd. ++# 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. ++import("//build/ohos.gni") ++ ++config("libhilog_pub_config") { ++ include_dirs = [ "include" ] ++ libs = ["hilog.z"] ++} ++ ++group("libhilog") { ++ public_configs = [ ":libhilog_pub_config" ] ++} ++ ++config("libhilog_base_pub_cfg") { ++ include_dirs = [ "include" ] ++} ++ ++ohos_prebuilt_static_library("libhilog_base") { ++ source = "/usr/lib64/libhilog_base.a" ++ public_configs = [ ":libhilog_base_pub_cfg" ] ++ ++ part_name = "hilog_native" ++ subsystem_name = "hiviewdfx" ++} +diff --git a/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/include b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/include +new file mode 120000 +index 0000000..50b90d9 +--- /dev/null ++++ b/openeuler/compiler_gn/base/hiviewdfx/hilog/interfaces/native/innerkits/include +@@ -0,0 +1 @@ ++/usr/include/hilog/ +\ No newline at end of file +-- +2.33.0 + diff --git a/0016-fix-use-llvm15-path-on-x86_64.patch b/0016-fix-use-llvm15-path-on-x86_64.patch new file mode 100644 index 0000000000000000000000000000000000000000..69cba52318cccdbe594e6e52a909149fb5c62294 --- /dev/null +++ b/0016-fix-use-llvm15-path-on-x86_64.patch @@ -0,0 +1,24 @@ +From bc15bf76bd51a0c017b8f1a289e84831ac7a6388 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0016 + +--- + toolchain/linux/BUILD.gn | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn +index 353b13d..a8c2f78 100755 +--- a/toolchain/linux/BUILD.gn ++++ b/toolchain/linux/BUILD.gn +@@ -121,7 +121,6 @@ clang_toolchain("linux_clang_x86_64") { + # Output linker map files for binary size analysis. + enable_linker_map = true + toolprefix = "/usr/bin/" +- strip = "/usr/bin/llvm-strip" + toolchain_args = { + current_cpu = "x64" + current_os = "linux" +-- +2.33.0 + diff --git a/0017-feat-add-script-to-create-soft-link.patch b/0017-feat-add-script-to-create-soft-link.patch new file mode 100644 index 0000000000000000000000000000000000000000..b8ccd3ddef012fcd736859d262bacb8b5aef3016 --- /dev/null +++ b/0017-feat-add-script-to-create-soft-link.patch @@ -0,0 +1,65 @@ +From 0d541aba54454543bcfc9f9047f87d1570413b1b Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Thu, 9 Nov 2023 11:10:53 +0800 +Subject: [PATCH] 0017 + +--- + openeuler/script/link.py | 46 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + create mode 100755 openeuler/script/link.py + +diff --git a/openeuler/script/link.py b/openeuler/script/link.py +new file mode 100755 +index 0000000..585123e +--- /dev/null ++++ b/openeuler/script/link.py +@@ -0,0 +1,46 @@ ++#!/usr/bin/env python ++# -*- coding: utf-8 -*- ++# Copyright (c) 2021 Hoperun Device Co., Ltd. ++# 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. ++ ++import os ++import sys ++import argparse ++ ++# create parent directory ++def create_dir(dir): ++ dir_items = dir.split("/") ++ full_name = "" ++ length = len(dir_items) - 1 ++ for i in range(length): ++ full_name += "/" + dir_items[i] ++ if not os.path.exists(full_name): ++ os.mkdir(full_name) ++ ++def main(): ++ parser = argparse.ArgumentParser() ++ parser.add_argument('--src_target', required=True) ++ parser.add_argument('--dest_target', required=True) ++ args = parser.parse_args() ++ ++ src_target = args.src_target ++ dest_target = args.dest_target ++ ++ if os.path.exists(dest_target): ++ os.unlink(dest_target) ++ create_dir(dest_target) ++ return os.symlink(src_target, dest_target) ++ ++if __name__ == '__main__': ++ sys.exit(main()) ++ +-- +2.33.0 + diff --git a/0018-feat-add-safwk-compile-gn-target.patch b/0018-feat-add-safwk-compile-gn-target.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0b8448f38cafaaab0e6bcf7bb8803ed7fc3c380 --- /dev/null +++ b/0018-feat-add-safwk-compile-gn-target.patch @@ -0,0 +1,158 @@ +From 9bef986150282fb772966baaf947f7a7cbd82301 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Wed, 8 Nov 2023 18:22:52 +0800 +Subject: [PATCH] 0018 + +--- + .../systemabilitymgr/safwk/bundle.json | 58 +++++++++++++++++++ + .../safwk/interfaces/innerkits/safwk/BUILD.gn | 41 +++++++++++++ + .../safwk/services/safwk/BUILD.gn | 22 +++++++ + 3 files changed, 121 insertions(+) + create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json + create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn + create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn + +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json +new file mode 100644 +index 0000000..1964532 +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json +@@ -0,0 +1,58 @@ ++{ ++ "name": "@ohos/systemabilitymgr_safwk", ++ "description": "system ability framework", ++ "homePage": "https://gitee.com/openharmony", ++ "version": "3.1", ++ "license": "Apache License 2.0", ++ "repository": "https://gitee.com/openharmony/systemabilitymgr_safwk", ++ "publishAs": "code-segment", ++ "segment": { ++ "destPath": "foundation/systemabilitymgr/safwk" ++ }, ++ "dirs": {}, ++ "scripts": {}, ++ "component": { ++ "name": "safwk", ++ "subsystem": "systemabilitymgr", ++ "features": [ "safwk_feature_coverage = false" ], ++ "adapted_system_type": [ ++ "standard" ++ ], ++ "rom": "200KB", ++ "ram": "7130KB", ++ "deps": { ++ "components": [ ++ "hitrace_native", ++ "hiviewdfx_hilog_native", ++ "ipc", ++ "samgr", ++ "c_utils" ++ ], ++ "third_party": [ "libxml2" ] ++ }, ++ "build": { ++ "group_type": { ++ "base_group": [ ++ "//foundation/systemabilitymgr/safwk/services/safwk:sa_main", ++ "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk" ++ ], ++ "fwk_group": [], ++ "service_group": [] ++ }, ++ "inner_kits": [ ++ { ++ "header": { ++ "header_base": "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", ++ "header_files": [ ++ "system_ability.h" ++ ] ++ }, ++ "name": "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk" ++ } ++ ], ++ "test": [ ++ "//foundation/systemabilitymgr/safwk/test:unittest" ++ ] ++ } ++ } ++} +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn +new file mode 100644 +index 0000000..57dcce2 +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn +@@ -0,0 +1,41 @@ ++# Copyright (c) 2021 Huawei Device Co., Ltd. ++# 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. ++ ++import("//build/ohos.gni") ++import("//build/ohos_var.gni") ++ ++# 建立所需头文件链接 ++exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk/system_ability.h", "--dest_target", ++ rebase_path("//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/system_ability.h") ], "string") ++ ++exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk", "--dest_target", ++ rebase_path("//foundation/systemabilitymgr/safwk/services/safwk/include") ], "string") ++ ++config("system_ability_config") { ++ visibility = [ ":*" ] ++ include_dirs = [ ++ "../../../services/safwk/include", ++ "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", ++ ] ++} ++ ++ohos_prebuilt_shared_library("system_ability_fwk") { ++ source = "/usr/lib64/libsystem_ability_fwk.z.so" ++ ++ public_configs = [ ":system_ability_config" ] ++ ++ install_images = [ system_base_dir ] ++ relative_install_dir = "platformsdk" ++ part_name = "safwk" ++ subsystem_name = "systemabilitymgr" ++} +\ No newline at end of file +diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn +new file mode 100644 +index 0000000..a258444 +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn +@@ -0,0 +1,22 @@ ++# Copyright (c) 2021 Huawei Device Co., Ltd. ++# 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. ++ ++import("//build/ohos.gni") ++ ++ohos_prebuilt_executable("sa_main") { ++ source = "/usr/bin/sa_main" ++ install_enable = true ++ ++ part_name = "safwk" ++ subsystem_name = "systemabilitymgr" ++} +\ No newline at end of file +-- +2.33.0 + diff --git a/0019-feat-add-devicemanager-gn-files.patch b/0019-feat-add-devicemanager-gn-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..375b3f40825bfbdd2068bdbe66fab21f96075f5d --- /dev/null +++ b/0019-feat-add-devicemanager-gn-files.patch @@ -0,0 +1,171 @@ +From c3dff0469668eb1589203ca1275aac86268f21ad Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Wed, 8 Nov 2023 18:22:52 +0800 +Subject: [PATCH] 0019 + +--- + .../device_manager/BUILD.gn | 17 ++++ + .../device_manager/bundle.json | 80 +++++++++++++++++++ + .../interfaces/inner_kits/native_cpp/BUILD.gn | 39 +++++++++ + 3 files changed, 136 insertions(+) + create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn + create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json + create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn + +diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn +new file mode 100644 +index 0000000..df46546 +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn +@@ -0,0 +1,17 @@ ++# Copyright (c) 2022 Huawei Device Co., Ltd. ++# 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. ++group("device_manager_fwk") { ++ deps = [ ++ "interfaces/inner_kits/native_cpp:devicemanagersdk", ++ ] ++} +diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json +new file mode 100644 +index 0000000..51c3d9a +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json +@@ -0,0 +1,80 @@ ++{ ++ "name": "@ohos/device_manager", ++ "description": "device manager service", ++ "version": "3.1", ++ "license": "Apache License 2.0", ++ "repository": "https://gitee.com/openharmony/device_manager", ++ "publishAs": "code-segment", ++ "segment": { ++ "destPath": "foundation/distributedhardware/device_manager" ++ }, ++ "dirs": {}, ++ "scripts": {}, ++ "component": { ++ "name": "device_manager", ++ "subsystem": "distributedhardware", ++ "syscap":[ "SystemCapability.DistributedHardware.DeviceManager" ], ++ "features":["device_manager_no_interaction_auth"], ++ "adapted_system_type": [ "standard", "small" ], ++ "rom": "2M", ++ "ram": "16M", ++ "hisysevent_config": [ ++ "//foundation/distributedhardware/device_manager/hisysevent.yaml" ++ ], ++ "deps": { ++ "components": [ ++ "ability_base", ++ "ability_runtime", ++ "access_token", ++ "appexecfwk_standard", ++ "bundle_framework", ++ "c_utils", ++ "common_event_service", ++ "device_auth", ++ "dsoftbus", ++ "hisysevent_native", ++ "hitrace_native", ++ "hiviewdfx_hilog_native", ++ "init", ++ "ipc", ++ "napi", ++ "os_account", ++ "safwk", ++ "samgr", ++ "startup_l2" ++ ], ++ "third_party": [ ++ "json", ++ "node", ++ "googletest", ++ "mbedtls" ++ ] ++ }, ++ "build": { ++ "group_type": { ++ "base_group": [], ++ "fwk_group": [ ++ "//foundation/distributedhardware/device_manager:device_manager_fwk" ++ ], ++ "service_group": [] ++ }, ++ "inner_kits": [ ++ { ++ "type": "so", ++ "name": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk", ++ "header": { ++ "header_files": [ ++ "device_manager.h", ++ "device_manager_callback.h", ++ "dm_device_info.h", ++ "dm_publish_info.h", ++ "dm_subscribe_info.h" ++ ], ++ "header_base": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include" ++ } ++ } ++ ], ++ "test": [] ++ } ++ } ++} +diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn +new file mode 100644 +index 0000000..78c60d7 +--- /dev/null ++++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn +@@ -0,0 +1,39 @@ ++# Copyright (c) 2022 Huawei Device Co., Ltd. ++# 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. ++import("//build/ohos.gni") ++ ++exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/device_manager", "--dest_target", ++ rebase_path("//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include") ], "string") ++ ++config("devicemanagersdk_config") { ++ include_dirs = [ ++ "include", ++ "include/ipc", ++ "include/ipc/standard", ++ "include/notify", ++ "include/common/include", ++ "include/common/include/ipc", ++ "include/common/include/ipc/model", ++ "include/common/include/ipc/standard", ++ "include/common/include/dfx", ++ "include/common/include/dfx/standard", ++ ] ++} ++ ++ohos_prebuilt_shared_library("devicemanagersdk") { ++ source = "/usr/lib64/libdevicemanagersdk.z.so" ++ public_configs = [ ":devicemanagersdk_config" ] ++ ++ subsystem_name = "distributedhardware" ++ part_name = "device_manager" ++} +-- +2.33.0 + diff --git a/0020-feat-add-openssl-gn-file-and-soft-link.patch b/0020-feat-add-openssl-gn-file-and-soft-link.patch new file mode 100644 index 0000000000000000000000000000000000000000..af3514b868d97f3f9767b0d50131cadf1271b93e --- /dev/null +++ b/0020-feat-add-openssl-gn-file-and-soft-link.patch @@ -0,0 +1,68 @@ +From 536f71e3670ad6c821b980f6336c614dcf693d3e Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Wed, 8 Nov 2023 18:36:59 +0800 +Subject: [PATCH] add openssl + +--- + .../compiler_gn/third_party/openssl/BUILD.gn | 39 +++++++++++++++++++ + .../third_party/openssl/include/openssl | 1 + + 2 files changed, 40 insertions(+) + create mode 100644 openeuler/compiler_gn/third_party/openssl/BUILD.gn + create mode 120000 openeuler/compiler_gn/third_party/openssl/include/openssl + +diff --git a/openeuler/compiler_gn/third_party/openssl/BUILD.gn b/openeuler/compiler_gn/third_party/openssl/BUILD.gn +new file mode 100644 +index 0000000..7b953eb +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/openssl/BUILD.gn +@@ -0,0 +1,39 @@ ++# Copyright (c) 2020-2022 Huawei Device Co., Ltd. ++# 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. ++ ++import("//build/ohos.gni") ++ ++# Only use this to set/unset some cflags, use "platform" variable in gn template to add ++# source code for Windows. ++ ++config("libcrypto_config") { ++ include_dirs = [ "/usr/include/openssl" ] ++ libs = [ "crypto" ] ++} ++ ++group("libcrypto_static") { ++ public_configs = [ ":libcrypto_config" ] ++} ++ ++group("libcrypto_shared") { ++ public_configs = [ ":libcrypto_config" ] ++} ++ ++config("libssl_config") { ++ include_dirs = [ "/usr/include/openssl" ] ++ libs = [ "ssl" ] ++} ++ ++group("libssl_shared") { ++ public_configs = [ ":libssl_config" ] ++} +diff --git a/openeuler/compiler_gn/third_party/openssl/include/openssl b/openeuler/compiler_gn/third_party/openssl/include/openssl +new file mode 120000 +index 0000000..6c29d44 +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/openssl/include/openssl +@@ -0,0 +1 @@ ++/usr/include/openssl +\ No newline at end of file +-- +2.33.0 + diff --git a/0021-feat-change-config-json.patch b/0021-feat-change-config-json.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6bfb8460a4f9e7c0ae26a195a50751c395f9263 --- /dev/null +++ b/0021-feat-change-config-json.patch @@ -0,0 +1,268 @@ +From fa9833b5a52e5a69945d7241652e1f0273dc8039 Mon Sep 17 00:00:00 2001 +From: zxstty +Date: Tue, 14 Nov 2023 10:50:17 +0800 +Subject: [PATCH] 1 + +--- + .../vendor/openeuler/openeuler/config.json | 232 ++++++++++-------- + 1 file changed, 135 insertions(+), 97 deletions(-) + +diff --git a/openeuler/vendor/openeuler/openeuler/config.json b/openeuler/vendor/openeuler/openeuler/config.json +index 2dfbb49..1896a16 100644 +--- a/openeuler/vendor/openeuler/openeuler/config.json ++++ b/openeuler/vendor/openeuler/openeuler/config.json +@@ -1,115 +1,153 @@ + { +- "product_name": "openeuler", +- "device_company": "openeuler", +- "target_os": "linux", +- "type": "standard", +- "version": "3.0", +- "board": "openeuler", +- "api_version": 8, +- "enable_ramdisk": false, +- "build_selinux": false, +- "build_seccomp": false, +- "support_jsapi": false, +- "inherit": [], +- "subsystems": [ +- { +- "subsystem": "common", +- "components": [ +- { +- "component": "common" +- } +- ] ++ "product_name": "openeuler", ++ "device_company": "openeuler", ++ "target_os": "linux", ++ "type": "standard", ++ "version": "3.0", ++ "board": "openeuler", ++ "api_version": 8, ++ "enable_ramdisk": false, ++ "build_selinux": false, ++ "build_seccomp": false, ++ "support_jsapi": false, ++ "inherit": [], ++ "subsystems": [ ++ { ++ "subsystem": "common", ++ "components": [ ++ { ++ "component": "common" ++ } ++ ] ++ }, ++ { ++ "subsystem": "commonlibrary", ++ "components": [ ++ { ++ "component": "c_utils", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "hiviewdfx", ++ "components": [ ++ { ++ "component": "hilog_native", ++ "features": [] + }, + { +- "subsystem": "commonlibrary", +- "components": [ +- { +- "component": "c_utils", +- "features": [] +- } +- ] ++ "component": "hiviewdfx_hilog_native", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "notification", ++ "components": [ ++ { ++ "component": "eventhandler", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "startup", ++ "components": [ ++ { ++ "component": "init", ++ "features": [ ++ "enable_ohos_startup_init_feature_ab_partition = false", ++ "enable_ohos_startup_init_feature_loader = false" ++ ] ++ } ++ ] ++ }, ++ { ++ "subsystem": "security", ++ "components": [ ++ { ++ "component": "huks", ++ "features": [] + }, + { +- "subsystem": "hiviewdfx", +- "components": [ +- { +- "component": "hilog_native", +- "features": [] +- }, +- { +- "component": "hiviewdfx_hilog_native", +- "features": [] +- } +- ] ++ "component": "device_auth", ++ "features": [] + }, + { +- "subsystem": "notification", +- "components": [ +- { +- "component": "eventhandler", +- "features": [] +- } +- ] ++ "component": "dataclassification", ++ "features": [] + }, + { +- "subsystem": "startup", +- "components": [ +- { +- "component": "init", +- "features": [ +- "enable_ohos_startup_init_feature_ab_partition = false", +- "enable_ohos_startup_init_feature_loader = false" +- ] +- } +- ] ++ "component": "device_security_level", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "communication", ++ "components": [ ++ { ++ "component": "ipc", ++ "features": [] + }, + { +- "subsystem": "security", +- "components": [ +- { +- "component": "huks", +- "features": [] +- }, +- { +- "component": "device_auth", +- "features": [] +- } +- ] ++ "component": "dsoftbus", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "systemabilitymgr", ++ "components": [ ++ { ++ "component": "safwk", ++ "features": [] + }, + { +- "subsystem": "communication", +- "components": [ +- { +- "component": "ipc", +- "features": [] +- }, +- { +- "component": "dsoftbus", +- "features": [] +- } +- ] ++ "component": "samgr", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "distributedhardware", ++ "components": [ ++ { ++ "component": "device_manager", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "distributeddatamgr", ++ "components": [ ++ { ++ "component": "kv_store", ++ "features": [] ++ }, ++ { ++ "component": "relational_store", ++ "features": [] + }, + { +- "subsystem": "systemabilitymgr", +- "components": [ +- { +- "component": "safwk", +- "features": [] +- }, +- { +- "component": "samgr", +- "features": [] +- } +- ] ++ "component": "datamgr_service", ++ "features": [] + }, + { +- "subsystem": "distributedhardware", +- "components": [ +- { +- "component": "device_manager", +- "features": [] +- } +- ] ++ "component": "data_object", ++ "features": [] ++ } ++ ] ++ }, ++ { ++ "subsystem": "filemanagement", ++ "components": [ ++ { ++ "component": "dfs_service", ++ "features": [] + } +- ] +-} ++ ] ++ } ++ ] ++} +\ No newline at end of file +-- +2.33.0 + diff --git a/0022-add-build-gn-file-of-icu-jsoncpp-zlib.patch b/0022-add-build-gn-file-of-icu-jsoncpp-zlib.patch new file mode 100644 index 0000000000000000000000000000000000000000..991f692642278ed996d52ca3737dd7e62658c08f --- /dev/null +++ b/0022-add-build-gn-file-of-icu-jsoncpp-zlib.patch @@ -0,0 +1,75 @@ +From 05a1c372db8ad7303c67254b975a614bdaa37e0d Mon Sep 17 00:00:00 2001 +From: heppen +Date: Fri, 17 Nov 2023 16:08:48 +0800 +Subject: [PATCH] add build gn file of icu/jsoncpp/zlib + +--- + .../third_party/icu/icu4c/BUILD.gn | 19 +++++++++++++++++++ + .../compiler_gn/third_party/jsoncpp/BUILD.gn | 11 +++++++++++ + .../compiler_gn/third_party/zlib/BUILD.gn | 10 ++++++++++ + 3 files changed, 40 insertions(+) + create mode 100644 openeuler/compiler_gn/third_party/icu/icu4c/BUILD.gn + create mode 100644 openeuler/compiler_gn/third_party/jsoncpp/BUILD.gn + create mode 100644 openeuler/compiler_gn/third_party/zlib/BUILD.gn + +diff --git a/openeuler/compiler_gn/third_party/icu/icu4c/BUILD.gn b/openeuler/compiler_gn/third_party/icu/icu4c/BUILD.gn +new file mode 100644 +index 0000000..ac57abf +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/icu/icu4c/BUILD.gn +@@ -0,0 +1,19 @@ ++import("//build/ohos.gni") ++ ++config("icuuc_config"){ ++ include_dirs = [ "/usr/include/unicode" ] ++ libs = [ "icuuc" ] ++} ++ ++group("shared_icuuc") { ++ public_configs = [ ":icuuc_config" ] ++} ++ ++config("icui18n_config"){ ++ include_dirs = [ "/usr/include/unicode" ] ++ libs = [ "icui18n" ] ++} ++ ++ohos_shared_library("shared_icui18n") { ++ public_configs = [ ":icui18n_config" ] ++} +diff --git a/openeuler/compiler_gn/third_party/jsoncpp/BUILD.gn b/openeuler/compiler_gn/third_party/jsoncpp/BUILD.gn +new file mode 100644 +index 0000000..2264d70 +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/jsoncpp/BUILD.gn +@@ -0,0 +1,11 @@ ++import("//build/ohos.gni") ++ ++ ++config("jsoncpp_config") { ++ include_dirs = [ "/usr/include/json" ] ++ libs = ["jsoncpp"] ++} ++ ++group("jsoncpp") { ++ public_configs = [":jsoncpp_config"] ++} +diff --git a/openeuler/compiler_gn/third_party/zlib/BUILD.gn b/openeuler/compiler_gn/third_party/zlib/BUILD.gn +new file mode 100644 +index 0000000..1837ef8 +--- /dev/null ++++ b/openeuler/compiler_gn/third_party/zlib/BUILD.gn +@@ -0,0 +1,10 @@ ++import("//build/ohos.gni") ++ ++config("zlib_config") { ++ include_dirs = [ "/usr/include" ] ++ libs = [ "z" ] ++} ++ ++group("shared_libz") { ++ public_configs = [":zlib_config" ] ++} +-- +2.33.0 + diff --git a/build-OpenHarmony-v3.2-Release.tar.gz b/build-OpenHarmony-v3.2-Release.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..394cda51ff292884398b0afcb7bfedba21ed8f5d Binary files /dev/null and b/build-OpenHarmony-v3.2-Release.tar.gz differ diff --git a/distributed-build.spec b/distributed-build.spec new file mode 100644 index 0000000000000000000000000000000000000000..c8deae974b768e6052c4b82c80b15d0479299f28 --- /dev/null +++ b/distributed-build.spec @@ -0,0 +1,65 @@ +%define debug_package %{nil} +%global openHarmony_source_release OpenHarmony-v3.2-Release +Name: distributed-build +Version: 1.0.0 +Release: 5 +Summary: openEuler embedded softbus build tools +License: Apache-2.0 +URL: https://gitee.com/openharmony/build +Requires: ninja-build, gn, clang15, llvm15, lld15, python, python-pyyaml, python-jinja2, distributed-build_lite +Source0: https://gitee.com/openharmony/build/repository/archive/%{openHarmony_source_release}.tar.gz #/build-%{openHarmony_source_release}.tar.gz +Patch0001: 0001-feat-Adapt-to-Openeuler-python-export-lld.patch +Patch0002: 0002-feat-Adapt-to-Openeuler-for-compilation.patch +Patch0003: 0003-feat-Adapt-to-Openeuler-add-clang.patch +Patch0004: 0004-feat-Adapt-to-Openeuler-add-include-file.patch +Patch0005: 0005-feat-use-pyyaml-on-openeuler.patch +Patch0006: 0006-feat-add-base-config.json-for-openeuler.patch +Patch0007: 0007-feat-add-gn-files-to-use-packages-on-openeuler.patch +Patch0008: 0008-feat-Adapt-to-openeuler.patch +Patch0009: 0009-feat-add-common-subsystem-and-delete-useless-config.patch +#Patch0010: 0010-feat-use-include-samgr-for-samgr-include-files-confi.patch +#Patch0011: 0011-feat-use-.z-for-libs-name.patch +Patch0012: 0012-fix-rpm-build-fail-caused-by-wrong-useless-code.patch +Patch0013: 0013-feature-use-llvm-tools-version-15-for-build.patch +Patch0014: 0014-feat-delete-the-default-sqlite-deps.patch +Patch0015: 0015-feat-and-hilog-gn-files.patch +Patch0016: 0016-fix-use-llvm15-path-on-x86_64.patch +Patch0017: 0017-feat-add-script-to-create-soft-link.patch +#Patch0018: 0018-feat-add-safwk-compile-gn-target.patch +#Patch0019: 0019-feat-add-devicemanager-gn-files.patch +Patch0020: 0020-feat-add-openssl-gn-file-and-soft-link.patch +Patch0021: 0021-feat-change-config-json.patch +Patch0022: 0022-add-build-gn-file-of-icu-jsoncpp-zlib.patch +BuildArch: noarch + +%description +openEuler embedded softbus build tools + +%prep +%autosetup -p1 -n build-%{openHarmony_source_release} + +#%build +#nothing to do + +%install +install -d %{buildroot}/opt/distributed-middleware-build +cp -rp %{_builddir}/build-%{openHarmony_source_release}/* %{buildroot}/opt/distributed-middleware-build + +%files +/opt/distributed-middleware-build + +%changelog +* Tue Jun 20 2023 Peng He - 1.0.0-5 +- add some components to build. + +* Fri Jun 16 2023 tianhang - 1.0.0-4 +- add gn files and add tools for soft link files + +* Thu Jun 15 2023 tianhang - 1.0.0-3 +- use llvm15 path for strip on x86_64 + +* Thu Jun 15 2023 tianhang - 1.0.0-2 +- add hilog compile gn files and remove default sqlite deps + +* Tue May 30 2023 tianhang - 1.0.0-1 +- Init and Adapt to Openeuler diff --git a/third_party_sqlite-OpenHarmony-v3.2-Release.tar.gz b/third_party_sqlite-OpenHarmony-v3.2-Release.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cc99bcc3d961e08014c5b17400c0c64a7becac27 Binary files /dev/null and b/third_party_sqlite-OpenHarmony-v3.2-Release.tar.gz differ