summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2020-02-01 13:00:02 -0500
committerMike Gilbert <floppym@gentoo.org>2020-02-01 13:00:02 -0500
commit8a72d2fc6f757b617683dd0a993b542549b8e839 (patch)
tree5202bff2923e70d136159f63580fc017efb90c24
parentRevert "package.mask: unmask chrome-remote-desktop" (diff)
downloadgentoo-8a72d2fc6f757b617683dd0a993b542549b8e839.tar.gz
gentoo-8a72d2fc6f757b617683dd0a993b542549b8e839.tar.bz2
gentoo-8a72d2fc6f757b617683dd0a993b542549b8e839.zip
sys-power/cpupower: fix build with gcc 10
Closes: https://bugs.gentoo.org/707462 Package-Manager: Portage-2.3.86_p1, Repoman-2.3.20_p43 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--sys-power/cpupower/cpupower-5.4.ebuild3
-rw-r--r--sys-power/cpupower/files/cpupower-5.4-gcc-10.patch57
2 files changed, 59 insertions, 1 deletions
diff --git a/sys-power/cpupower/cpupower-5.4.ebuild b/sys-power/cpupower/cpupower-5.4.ebuild
index d45b53b560a1..331b5b96131e 100644
--- a/sys-power/cpupower/cpupower-5.4.ebuild
+++ b/sys-power/cpupower/cpupower-5.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -24,6 +24,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/cpupower-5.4-cflags.patch"
+ "${FILESDIR}/cpupower-5.4-gcc-10.patch"
)
S="${WORKDIR}/linux-${PV}"
diff --git a/sys-power/cpupower/files/cpupower-5.4-gcc-10.patch b/sys-power/cpupower/files/cpupower-5.4-gcc-10.patch
new file mode 100644
index 000000000000..56540d2bc562
--- /dev/null
+++ b/sys-power/cpupower/files/cpupower-5.4-gcc-10.patch
@@ -0,0 +1,57 @@
+From 8db4ea3227554fb80ad766936a4c21cc901beb29 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sat, 1 Feb 2020 12:44:30 -0500
+Subject: [PATCH] cpupower: avoid multiple definition with gcc -fno-common
+
+The -fno-common option will be enabled by default in GCC 10.
+
+Bug: https://bugs.gentoo.org/707462
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c | 2 +-
+ tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 2 ++
+ tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h | 2 +-
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
+index 33dc34db4f3c..1b69f25a1281 100644
+--- a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
++++ b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
+@@ -82,7 +82,7 @@ static struct pci_access *pci_acc;
+ static struct pci_dev *amd_fam14h_pci_dev;
+ static int nbp1_entered;
+
+-struct timespec start_time;
++extern struct timespec start_time;
+ static unsigned long long timediff;
+
+ #ifdef DEBUG
+diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+index 6d44fec55ad5..7c77045fef52 100644
+--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
++++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+@@ -27,6 +27,8 @@ struct cpuidle_monitor *all_monitors[] = {
+ 0
+ };
+
++int cpu_count;
++
+ static struct cpuidle_monitor *monitors[MONITORS_MAX];
+ static unsigned int avail_monitors;
+
+diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
+index 5b5eb1da0cce..c559d3115330 100644
+--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
++++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
+@@ -25,7 +25,7 @@
+ #endif
+ #define CSTATE_DESC_LEN 60
+
+-int cpu_count;
++extern int cpu_count;
+
+ /* Hard to define the right names ...: */
+ enum power_range_e {
+--
+2.25.0
+