Bugzilla – Bug 1160244
[META] -fno-common package failures
Last modified: 2020-06-27 22:14:36 UTC
Starting from the upcoming GCC release 10, the default of -fcommon option will change to -fno-common: In C, global variables with multiple tentative definitions will result in linker errors. Global variable accesses are also more efficient on various targets. Porting advice: A common mistake in C is omitting <code>extern</code> when declaring a global variable in a header file. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions this error is ignored. GCC 10 defaults to <code>-fno-common</code>, which means a linker error will now be reported. To fix this, use <code>extern</code> in header files when declaring global variables, and ensure each global is defined in exactly one C file. As a workaround, legacy C code can be compiled with -fcommon. int x; // tentative definition - avoid in header files extern int y; // correct declaration in a header file Recommendations for package maintainers: - report the violation to upstream - cherry pick a fix from upsteam Alternatively one can append -fcommon to $optflags for a package that will not be fixed upstream.
Assigned to you since you are handling those problems. If not OK please reassign, thanks!
Uppf! We're done, thanks to all who helped me.
This is an autogenerated message for OBS integration: This bug (1160244) was mentioned in https://build.opensuse.org/request/show/816068 15.2 / profanity
This is an autogenerated message for OBS integration: This bug (1160244) was mentioned in https://build.opensuse.org/request/show/816850 15.2 / profanity
openSUSE-RU-2020:0885-1: An update that has one recommended fix can now be installed. Category: recommended (moderate) Bug References: 1160244 CVE References: Sources used: openSUSE Leap 15.2 (src): profanity-0.9.4-lp152.2.3.1