hishamhm / htop

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.
GNU General Public License v2.0
5.83k stars 581 forks source link

htop: fix build failure against gcc-10 #982

Closed trofi closed 4 years ago

trofi commented 4 years ago

On gcc-10 (and gcc-9 -fno-common) build fails as:

gcc -pedantic ... -o htop ...
ld: ClockMeter.o:/home/slyfox/dev/git/htop/CRT.h:159:
  multiple definition of `backtraceArray'; CheckItem.o:htop/CRT.h:159: first defined here
ld: ClockMeter.o:/home/slyfox/dev/git/htop/CRT.h:153:
  multiple definition of `CRT_termType'; CheckItem.o:htop/CRT.h:153: first defined here

gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678.

The error also happens if CFLAGS=-fno-common passed explicitly.

Reported-by: Toralf Förster Bug: https://bugs.gentoo.org/706358

SuperSandro2000 commented 4 years ago

Dupe of #981