0001-fix-build-with-gcc-10.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 6e4e407a374512b5bcb5a7c184258653e472ef9f Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Tue, 19 Jan 2021 07:47:58 +0100
  4. Subject: [PATCH] fix build with gcc 10
  5. Fix the following build failure with gcc 10 (which defaults to
  6. -fno-common):
  7. /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
  8. /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
  9. Fixes:
  10. - http://autobuild.buildroot.org/results/1a433611ba8676cf1ca276fccaf3633971bd562e
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. [Upstream status: https://github.com/ajaiantilal/i7z/pull/27]
  13. ---
  14. i7z.c | 1 +
  15. i7z_Dual_Socket.c | 2 +-
  16. i7z_Single_Socket.c | 2 +-
  17. 3 files changed, 3 insertions(+), 2 deletions(-)
  18. diff --git a/i7z.c b/i7z.c
  19. index 61e2757..910a608 100644
  20. --- a/i7z.c
  21. +++ b/i7z.c
  22. @@ -34,6 +34,7 @@ int Dual_Socket();
  23. int socket_0_num=0, socket_1_num=1;
  24. bool use_ncurses = true;
  25. +struct timespec global_ts;
  26. /////////////////////LOGGING TO FILE////////////////////////////////////////
  27. FILE *fp_log_file_freq;
  28. diff --git a/i7z_Dual_Socket.c b/i7z_Dual_Socket.c
  29. index 1388339..ceafdce 100644
  30. --- a/i7z_Dual_Socket.c
  31. +++ b/i7z_Dual_Socket.c
  32. @@ -37,7 +37,7 @@ float Read_Voltage_CPU(int cpu_num);
  33. extern struct program_options prog_options;
  34. FILE *fp_log_file;
  35. -struct timespec global_ts;
  36. +extern struct timespec global_ts;
  37. extern FILE *fp_log_file_freq_1, *fp_log_file_freq_2;
  38. extern char* CPU_FREQUENCY_LOGGING_FILE_single;
  39. diff --git a/i7z_Single_Socket.c b/i7z_Single_Socket.c
  40. index 16e98c1..b7266e6 100644
  41. --- a/i7z_Single_Socket.c
  42. +++ b/i7z_Single_Socket.c
  43. @@ -35,7 +35,7 @@ int Read_Thermal_Status_CPU(int cpu_num);
  44. extern struct program_options prog_options;
  45. extern FILE *fp_log_file_freq;
  46. -struct timespec global_ts;
  47. +extern struct timespec global_ts;
  48. extern char* CPU_FREQUENCY_LOGGING_FILE_single;
  49. extern char* CPU_FREQUENCY_LOGGING_FILE_dual;
  50. --
  51. 2.29.2