Re: [PATCH v2] cpupower: avoid multiple definition with gcc -fno-common
flat view
From: Mike Gilbert <hidden>
Date: 2020-02-25 17:48:45
On Mon, Feb 24, 2020 at 5:26 PM shuah [off-list ref] wrote:
Hi Mike, On 2/24/20 1:20 PM, Mike Gilbert wrote:quoted
The -fno-common option will be enabled by default in GCC 10.Great. It landed in my inbox now. Please include the message you are seeing in the change log.
Sure, I will roll a v3 shortly.
quoted
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..20f46348271b 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; +static struct timespec start_time; static unsigned long long timediff;Does it make sense to move start_time and timediff defines to cpupower-monitor.c and adding externs for them in cpupower-monitor.h?
I don't think that makes a lot of sense. start_time is really an internal value and does not need to be shared between the two object files.