• Mike Gilbert's avatar
    cpupower: avoid multiple definition with gcc -fno-common · 2de7fb60
    Mike Gilbert authored
    Building cpupower with -fno-common in CFLAGS results in errors due to
    multiple definitions of the 'cpu_count' and 'start_time' variables.
    
    ./utils/idle_monitor/snb_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
    multiple definition of `cpu_count';
    ./utils/idle_monitor/nhm_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
    first defined here
    ...
    ./utils/idle_monitor/cpuidle_sysfs.o:./utils/idle_monitor/cpuidle_sysfs.c:22:
    multiple definition of `start_time';
    ./utils/idle_monitor/amd_fam14h_idle.o:./utils/idle_monitor/amd_fam14h_idle.c:85:
    first defined here
    
    The -fno-common option will be enabled by default in GCC 10.
    
    Bug: https://bugs.gentoo.org/707462Signed-off-by: default avatarMike Gilbert <floppym@gentoo.org>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    2de7fb60
cpupower-monitor.c 10.2 KB