gridcoin-community / Gridcoin-Research

Gridcoin-Research
MIT License
585 stars 173 forks source link

[cmake] bdb53: disable error for implicit-int with gcc #2767

Closed lrusak closed 4 weeks ago

lrusak commented 1 month ago

Hello!

I noticed that on fedora 40 (using gcc 14), gridcoinresearchd fails to compile to an implicit-int conversion.

This happens in the bdb53 dependency build. I didn't want to change the source code there so I just disabled the error so it would only be a warning. I also only made this change for GNU compiler, I'm not sure if it effects others.

The actual error is in the config.log of bdb53:

configure:20682: cc -o conftest -O3   -D_GNU_SOURCE -D_REENTRANT  conftest.c  -lpthread >&5
conftest.c:46:1: error: return type defaults to 'int' [-Wimplicit-int]
   46 | main() {
      | ^~~~
configure:20682: 0 = 1
configure: program exited with status 1

This cause the mutex detection to fail and ultimately fail the build. In the actual build log this looks like:

[   72s] checking for mutexes... UNIX/fcntl
[   72s] 
[   72s] -- stderr output is:
[   72s] configure: error: Support for FCNTL mutexes was removed in BDB 4.8.

This can be seen in the aarch64 build here -> https://build.opensuse.org/package/live_build_log/home:theMarix/gridcoin/Fedora_40/aarch64

This comes down to the fact that implicit-int was promoted to an error by default in gcc 14 see: https://gcc.gnu.org/gcc-14/porting_to.html

lrusak commented 1 month ago

utACK - Would you mind adding this to automake side as well?

I pushed a fixup to add this. I can remove "cmake" from the commit message if you are happy with the change.

div72 commented 4 weeks ago

I pushed a fixup to add this. I can remove "cmake" from the commit message if you are happy with the change.

Sure, you can also keep it as two separate commits.

jamescowens commented 4 weeks ago

Can we fix the CI errors please? @div72 this does not look specific to this PR.

div72 commented 4 weeks ago

@jamescowens Can you cherry-pick 35eccfd6ce5785a532f131e72471f8d02d548453?

jamescowens commented 4 weeks ago

Ok.