1*4882a593SmuzhiyunFrom 6e4e407a374512b5bcb5a7c184258653e472ef9f Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3*4882a593SmuzhiyunDate: Tue, 19 Jan 2021 07:47:58 +0100 4*4882a593SmuzhiyunSubject: [PATCH] fix build with gcc 10 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunFix the following build failure with gcc 10 (which defaults to 7*4882a593Smuzhiyun-fno-common): 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun/home/buildroot/autobuild/instance-2/output-1/host/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -o i7z i7z.o helper_functions.o i7z_Single_Socket.o i7z_Dual_Socket.o -lncurses -lpthread -lrt -lm 10*4882a593Smuzhiyun/home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-gnu/10.2.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: i7z_Dual_Socket.o:(.bss+0x0): multiple definition of `global_ts'; i7z_Single_Socket.o:(.bss+0x0): first defined here 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunFixes: 13*4882a593Smuzhiyun - http://autobuild.buildroot.org/results/1a433611ba8676cf1ca276fccaf3633971bd562e 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 16*4882a593Smuzhiyun[Upstream status: https://github.com/ajaiantilal/i7z/pull/27] 17*4882a593Smuzhiyun--- 18*4882a593Smuzhiyun i7z.c | 1 + 19*4882a593Smuzhiyun i7z_Dual_Socket.c | 2 +- 20*4882a593Smuzhiyun i7z_Single_Socket.c | 2 +- 21*4882a593Smuzhiyun 3 files changed, 3 insertions(+), 2 deletions(-) 22*4882a593Smuzhiyun 23*4882a593Smuzhiyundiff --git a/i7z.c b/i7z.c 24*4882a593Smuzhiyunindex 61e2757..910a608 100644 25*4882a593Smuzhiyun--- a/i7z.c 26*4882a593Smuzhiyun+++ b/i7z.c 27*4882a593Smuzhiyun@@ -34,6 +34,7 @@ int Dual_Socket(); 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun int socket_0_num=0, socket_1_num=1; 30*4882a593Smuzhiyun bool use_ncurses = true; 31*4882a593Smuzhiyun+struct timespec global_ts; 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun /////////////////////LOGGING TO FILE//////////////////////////////////////// 34*4882a593Smuzhiyun FILE *fp_log_file_freq; 35*4882a593Smuzhiyundiff --git a/i7z_Dual_Socket.c b/i7z_Dual_Socket.c 36*4882a593Smuzhiyunindex 1388339..ceafdce 100644 37*4882a593Smuzhiyun--- a/i7z_Dual_Socket.c 38*4882a593Smuzhiyun+++ b/i7z_Dual_Socket.c 39*4882a593Smuzhiyun@@ -37,7 +37,7 @@ float Read_Voltage_CPU(int cpu_num); 40*4882a593Smuzhiyun extern struct program_options prog_options; 41*4882a593Smuzhiyun FILE *fp_log_file; 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun-struct timespec global_ts; 44*4882a593Smuzhiyun+extern struct timespec global_ts; 45*4882a593Smuzhiyun extern FILE *fp_log_file_freq_1, *fp_log_file_freq_2; 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun extern char* CPU_FREQUENCY_LOGGING_FILE_single; 48*4882a593Smuzhiyundiff --git a/i7z_Single_Socket.c b/i7z_Single_Socket.c 49*4882a593Smuzhiyunindex 16e98c1..b7266e6 100644 50*4882a593Smuzhiyun--- a/i7z_Single_Socket.c 51*4882a593Smuzhiyun+++ b/i7z_Single_Socket.c 52*4882a593Smuzhiyun@@ -35,7 +35,7 @@ int Read_Thermal_Status_CPU(int cpu_num); 53*4882a593Smuzhiyun extern struct program_options prog_options; 54*4882a593Smuzhiyun extern FILE *fp_log_file_freq; 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun-struct timespec global_ts; 57*4882a593Smuzhiyun+extern struct timespec global_ts; 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun extern char* CPU_FREQUENCY_LOGGING_FILE_single; 60*4882a593Smuzhiyun extern char* CPU_FREQUENCY_LOGGING_FILE_dual; 61*4882a593Smuzhiyun-- 62*4882a593Smuzhiyun2.29.2 63*4882a593Smuzhiyun 64