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
Fix static data to link with -fno-common. #9943
Conversation
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for cleaning this up. The kernel.org build failure appears unrelated and is probably due to a recently mainline kernel change which will need to be investigated.
Codecov Report
@@ Coverage Diff @@
## master #9943 +/- ##
========================================
- Coverage 80% 79% -<1%
========================================
Files 384 384
Lines 121788 121788
========================================
- Hits 96900 96744 -156
- Misses 24888 25044 +156
Continue to review full report at Codecov.
|
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes #9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943 (cherry picked from commit af09c05) Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes openzfs#9943 (cherry picked from commit af09c05) Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
-fno-common is the new default in GCC 10, replacing -fcommon in GCC <= 9, so static data must only be allocated once.
Signed-off-by: Romain Dolbeau romain.dolbeau@european-processor-initiative.eu
Motivation and Context
GCC 10 will change the default from -fcommon to -fno-common (https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html), preventing the linking of any variables with multiple definitions.
This remove multiple definitions of variables, allowing compilation with GCC 10 (or older GCC using -fno-common).
Description
Remove multiple definitions: variables are defined in a single .c file, and .h only contains 'extern' declarations.
How Has This Been Tested?
It compiles and allow using a pool on RISC-V a x86-64.
Types of changes
Checklist:
Signed-off-by.