From 5e31c5708393b4e086052c0e7b8cbc57d7ebede3 Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Tue, 7 Nov 2023 20:58:34 -0600 Subject: [PATCH 1/2] Only define __builtin_cpu_is and __builtin_cpu_supports if not present. --- driver/others/dynamic_power.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/driver/others/dynamic_power.c b/driver/others/dynamic_power.c index 10a5d64b38..570a875682 100644 --- a/driver/others/dynamic_power.c +++ b/driver/others/dynamic_power.c @@ -202,6 +202,7 @@ static int cpuid(void) #ifndef __BUILTIN_CPU_SUPPORTS__ #include +#if defined(__has_builtin) && !__has_builtin(__builtin_cpu_is) static int __builtin_cpu_is(const char *arg) { static int ipinfo = -1; @@ -224,12 +225,15 @@ static int __builtin_cpu_is(const char *arg) } return 0; } +#endif +#if defined(__has_builtin) && !__has_builtin(__builtin_cpu_supports) static int __builtin_cpu_supports(const char *arg) { return 0; } #endif +#endif static gotoblas_t *get_coretype(void) { From 4eecccd49b251be2cb303b67093c4602afb39aec Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Wed, 8 Nov 2023 07:12:21 -0600 Subject: [PATCH 2/2] Fix __builtin_cpu_is for AIX. --- driver/others/dynamic_power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/others/dynamic_power.c b/driver/others/dynamic_power.c index 570a875682..f0faf2bafc 100644 --- a/driver/others/dynamic_power.c +++ b/driver/others/dynamic_power.c @@ -202,7 +202,7 @@ static int cpuid(void) #ifndef __BUILTIN_CPU_SUPPORTS__ #include -#if defined(__has_builtin) && !__has_builtin(__builtin_cpu_is) +#if defined(_AIX) || (defined(__has_builtin) && !__has_builtin(__builtin_cpu_is)) static int __builtin_cpu_is(const char *arg) { static int ipinfo = -1; @@ -227,7 +227,7 @@ static int __builtin_cpu_is(const char *arg) } #endif -#if defined(__has_builtin) && !__has_builtin(__builtin_cpu_supports) +#if defined(_AIX) || (defined(__has_builtin) && !__has_builtin(__builtin_cpu_supports)) static int __builtin_cpu_supports(const char *arg) { return 0;