JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
773 stars 545 forks source link

Build fails on GCC 10 #264

Closed 0x9fff00 closed 4 years ago

0x9fff00 commented 4 years ago

GCC 10 has changed the default from -fcommon to -fno-common, which causes errors like this:

/usr/bin/ld: cpuminer-util.o:(.rodata+0xc0): multiple definition of `exp160'; cpuminer-cpu-miner.o:(.rodata+0x220): first defined here

The full log is available here: https://gist.github.com/0x9fff00/d82cb1c5487688806bee9a4d86dae4bf This can be worked around by adding -fcommon to CFLAGS, however the recommended fix is to change the source code to explicitly mark declarations of variables from other files with extern. For more information see https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common

JayDDee commented 4 years ago

Ooops. I had this fixed in v3.11.8 but I must have defined some new variables and forgot to add external to the decl. Unfortunately I don't have a GCC 10 build environment ot test with so these things can slip through.

Code churn has decreased significantly so hopefully it won't happen again.

I found all the exp* decls in miner.h, but I don't know if there are any other violations. I'd like to enusre the're all fixed. Could you do a test for me? Please run ./build-allarch.sh to make sure there aren't any missing external declarations in targetted code.

Edit: you don't need to do the test, i'll just add -fno-common to my testing.

JayDDee commented 4 years ago

cpuminer-opt-3.13.1.1 is released with a fix, please retest.

0x9fff00 commented 4 years ago

Version 3.13.1.1 works, thanks!