Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 16, 2024

Conversation

lrusak
Copy link
Contributor

@lrusak lrusak commented Jun 13, 2024

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

using -Werror=implicit-int is now default in gcc 14

see: https://gcc.gnu.org/gcc-14/porting_to.html

This fixes the following issue:

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

Signed-off-by: Lukas Rusak <[email protected]>
Copy link
Member

@div72 div72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

AX_SUBDIRS_CONFIGURE([src/bdb53], [[CFLAGS="-Wno-error=implicit-function-declaration"], [CXXFLAGS="-Wno-error=implicit-function-declaration"], [--disable-java], [--disable-jdbc], [--disable-replication], [--enable-cxx], [$ADDITIONAL_BDB_FLAGS]], [], [], [])

->

-  AX_SUBDIRS_CONFIGURE([src/bdb53], [[CFLAGS="-Wno-error=implicit-function-declaration"], [CXXFLAGS="-Wno-error=implicit-function-declaration"], [--disable-java], [--disable-jdbc], [--disable-replication], [--enable-cxx], [$ADDITIONAL_BDB_FLAGS]], [], [], [])
+  AX_SUBDIRS_CONFIGURE([src/bdb53], [[CFLAGS=-Wno-error=implicit-function-declaration -Wno-error=implicit-int], [CXXFLAGS=-Wno-error=implicit-function-declaration -Wno-error=implicit-int], [--disable-java], [--disable-jdbc], [--disable-replication], [--enable-cxx], [$ADDITIONAL_BDB_FLAGS]], [], [], [])

@lrusak
Copy link
Contributor Author

lrusak commented Jun 14, 2024

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
Copy link
Member

div72 commented Jun 16, 2024

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 jamescowens added this to the Natasha milestone Jun 16, 2024
@jamescowens
Copy link
Member

jamescowens commented Jun 16, 2024

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

@div72
Copy link
Member

div72 commented Jun 16, 2024

@jamescowens Can you cherry-pick 35eccfd?

@jamescowens
Copy link
Member

Ok.

@jamescowens jamescowens merged commit a3dafe6 into gridcoin-community:development Jun 16, 2024
18 of 21 checks passed
wilkart pushed a commit to wilkart/Gridcoin-Research that referenced this pull request Jun 29, 2024
[cmake] bdb53: disable error for implicit-int with gcc
jamescowens added a commit that referenced this pull request Feb 16, 2025
Added
 - depends: add cross arm64-darwin support #2775 (@div72)
 - build: add missing randomness checks #2772 (@div72)
 - init, registry: Support -clearallregistryhistory startup parameter #2773 (@jamescowens)

Changed
 - build: omit _FORTIFY_SOURCE on debug #2793 (@div72)
 - doc: cmake is required for Windows depends #2791 (@barton2526)
 - CMake: Set maximum supported Boost version #2788 (@CyberTailor)
 - ci: bump to MacOS 13 #2784 (@div72)
 - build/cmake: disable LevelDB tests #2776 (@div72)
 - util: use XDG_STATE_HOME for datadir on Flatpak #2774 (@div72)
 - util, build: Support miniupnp API version 18+ #2771 (@jamescowens)
 - build: explicitly include FindPkgConfig for CMake #2769 (@jamescowens)
 - ci, cd: bump action versions #2763 (@div72)
 - Sync CMake CI #2762 (@CyberTailor)
 - cpid: Modify CPID local hasher to eliminate compiler warnings on 32 bit archs #2760 (@jamescowens)

Removed
 - refactor, misc: remove CBitcoin(Address|Secret) #2634 (@div72)

Fixed
 - poll, gui: Disable choice add button in poll wizard when choice limit is reached #2792 (@jamescowens)
 - diagnose, rpc: fix compilation with boost 1.87 #2786 (@div72)
 - node: fix build with GCC 15 #2783 (@CyberTailor)
 - ci: use overwrite with brew install on MacOS CMake #2782 (@div72)
 - scraper: Protect access to ConvergedStats.csv.gz with a lock #2779 (@jamescowens)
 - fix build on FreeBSD #2770 (@wilkart)
 - rpc/server: fix removing deprecated commands from command list #2768 (@lrusak)
 - cmake bdb53: disable error for implicit-int with gcc #2767 (@lrusak)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants