fixes linux build(gcc16) with linux build make command - #50
Open
flipchan wants to merge 1 commit into
Open
Conversation
Author
|
ping @olomix this fixes linux builds, looks green :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes building on linux and the latest fedora kernels with gcc16
Problem
Rapidsnark failed to compile on systems with GCC 16 due to two issues:
GMP 6.3.0
configurefails — The "long long reliability test 1" in GMP'sconfigureuses-pedantic, which GCC 16 rejects because of stricter enforcement of forward declaration argument matching.Missing
#include <cstdint>— GCC 16 no longer transitively includes<cstdint>from standard library headers like<string>,<memory>, etc. Files usinguint32_t,uint64_t, etc. without a direct or transitive path to<cstdint>fail to compile.Changes
1. Conditional
#include <cstdint>behindBUILD_LINUXCMake flagThe
cstdintincludes are only added when building with-DBUILD_LINUX=ON, which definesRAPIDSNARK_LINUX. This keeps the fix scoped to Linux builds and avoids touching other platforms.CMakeLists.txt (
src/CMakeLists.txt):Source files — each guarded with
#ifdef RAPIDSNARK_LINUX:src/binfile_utils.hpp—#include <cstdint>after<memory>includesrc/binfile_utils.cpp—#include <cstdint>before project includessrc/zkey_utils.cpp—#include <cstdint>before<stdexcept>includesrc/random_generator.hpp—#include <cstdint>after<random>includeUsage:
2. Workaround for GMP build (not a code change)
The
build_gmp.sh hosttarget fails because GMP's configure adds-pedanticwhich triggers an error in GCC 16's long long reliability test. Workaround:The
-std=gnu11flag allows the test code (which uses implicit function declarations) to compile without error.Notes
cstdintfixes. All other source files either already included it directly (7 files) or received it transitively throughfr_element.hpp/fq_element.hpp/misc.hpp(8 files).u_int32_t/u_int64_ttypes (BSD extensions from<sys/types.h>) used inbinfile_utils,zkey_utils,groth16, etc. remain unchanged — they compile on Linux via system header transitive includes but are a separate portability concern.