Add -fcommon to CFLAGS for GCC 10+ compatibility#7
Open
Luyoung0001 wants to merge 1 commit intoNJU-ProjectN:masterfrom
Open
Add -fcommon to CFLAGS for GCC 10+ compatibility#7Luyoung0001 wants to merge 1 commit intoNJU-ProjectN:masterfrom
Luyoung0001 wants to merge 1 commit intoNJU-ProjectN:masterfrom
Conversation
…rting from GCC 10, the default behavior is -fno-common, which can cause multiple definition errors in some projects. Signed-off-by: luyoung0001 <luyoung0001@gmail.com>
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.
Summary
This change adds the
-fcommonflag to our build configuration to maintain compatibility with GCC version 10 and above. The newer versions of GCC default to-fno-common, which leads to multiple definition errors for projects that relied on the older-fcommonbehavior.Details
-fcommonto-fno-common. This affects the handling of multiple definitions of the same global variable across different files, which previously were silently merged but now cause build errors.-fcommonin our build scripts, we ensure that our code will continue to compile without errors across all supported versions of GCC.Impact
Please review the changes and merge if everything is in order. Feedback is welcome!