[Bugfix] fix some type errors.

This commit is contained in:
Zhenyu Zhao 2024-10-10 01:19:50 +08:00
parent 4e353c4338
commit 4eac3ffc5f
2 changed files with 90 additions and 1 deletions

View File

@ -0,0 +1,80 @@
From 7e0ef2632ef78c068c664fdfb86da1a6716fde44 Mon Sep 17 00:00:00 2001
From: zhenyu--zhao_admin <zhaozhenyu17@huawei.com>
Date: Wed, 9 Oct 2024 19:19:50 +0800
Subject: [PATCH] [Bugfix]fix some typo errors.
---
gcc/collect2.c | 10 +++++-----
gcc/config/aarch64/aarch64.c | 7 +++----
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/gcc/collect2.c b/gcc/collect2.c
index d4b6a1849..cd29a9e97 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -795,7 +795,7 @@ ai_preprocess (int argc, char **argv)
ai_input[0] = '\0';
- for (int index = 0; index > argc; index++)
+ for (int index = 0; index < argc; index++)
{
strcat (ai_input, argv[index]);
strcat (ai_input, " ");
@@ -825,7 +825,7 @@ ai_preprocess (int argc, char **argv)
run_ai_model_func run_ai_model;
PTR_UNION_TYPE (run_ai_model_func) run_ai_model_func_union;
PTR_UNION_AS_VOID_PTR (run_ai_model_func_union)
- = dlsym (ai4c_lib_handle, "runONNXModelLTo");
+ = dlsym (ai4c_lib_handle, "runONNXModelLTO");
run_ai_model = PTR_UNION_AS_CAST_PTR (run_ai_model_func_union);
if (!run_ai_model)
@@ -850,7 +850,7 @@ ai_preprocess (int argc, char **argv)
return model_pred;
}
-static char*
+static void**
get_ai_info ()
{
/* Load dependent AI-framework libraries. */
@@ -861,7 +861,7 @@ get_ai_info ()
if (!onnxruntime_lib_handle)
return NULL;
- char *ai_info = (char*) dlsym (onnxruntime_lib_handle, "ai_info");
+ void **ai_info = (void **) dlsym (onnxruntime_lib_handle, "ai_info");
if (!ai_info)
{
dlclose (onnxruntime_lib_handle);
@@ -908,7 +908,7 @@ do_link (char **ld_argv)
}
else if (ai_optimization_level && auto_lto)
{
- char *lto_ai_output = get_ai_info ();
+ char *lto_ai_output = *(char **) get_ai_info ();
const size_t extra_link_file_name_length = strlen(lto_ai_output) / 2;
char *ai_output_buffer = XCNEWVEC (char, extra_link_file_name_length);
if (!ai_output_buffer)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 83b8ebe8d..be72a5572 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -14530,10 +14530,9 @@ reset_machine_option (struct gcc_options *opts)
{
/* Parsing mcpu=native will have extra info after, then length
would greater than 6. */
- if (!(opts->x_optimize_machine)
- || !(strstr (opts->x_aarch64_cpu_string, "hip09") != NULL
- || strstr (opts->x_aarch64_cpu_string, "tsv110") != NULL)
- && (strlen (opts->x_aarch64_cpu_string) > 6))
+ if (!(strstr (opts->x_aarch64_cpu_string, "hip09") != NULL
+ || strstr (opts->x_aarch64_cpu_string, "tsv110") != NULL)
+ && (strlen (opts->x_aarch64_cpu_string) > 6))
{
return;
}
--
2.43.0

View File

@ -61,7 +61,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: 65
Release: 66
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
URL: https://gcc.gnu.org
@ -315,6 +315,8 @@ Patch204: 0204-Try-to-use-AI-model-to-guide-optimization.patch
Patch205: 0205-bolt-plugin-supports-optimization-for-dyn-and-pie.patch
Patch206: 0206-Strcut-Reorg-fix-spec2017-505-build-issue-with-fipa-.patch
Patch207: 0207-Use-AI-ability-to-enable-Link-Time-Optimization.patch
patch208: 0208-Bugfix-fix-some-typo-errors.patch
%global gcc_target_platform %{_arch}-linux-gnu
%if %{build_go}
@ -974,6 +976,7 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch208 -p1
%build
@ -3008,6 +3011,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Thu Oct 10 2024 zhenyu zhao <zhaozhenyu17@huawei.com> - 10.3.1-66
- Type:Bugfix
- ID:NA
- SUG:NA
- DESC: Sync patch from openeuler/gcc
* Wed Sep 25 2024 zhenyu zhao <zhaozhenyu17@huawei.com> - 10.3.1-65
- Type:Sync
- ID:NA