Bug 1160244 - [META] -fno-common package failures
Summary: [META] -fno-common package failures
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Martin Liška
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on: 1160254 1160256 1160257 1160259 1160260 1160261 1160262 1160263 1160264 1160265 1160266 1160267 1160268 1160269 1160270 1160271 1160272 1160273 1160274 1160275 1160276 1160277 1160278 1160279 1160280 1160281 1160282 1160283 1160284 1160286 1160287 1160288 1160289 1160290 1160291 1160292 1160293 1160294 1160295 1160296 1160297 1160298 1160299 1160300 1160380 1160381 1160382 1160383 1160384 1160385 1160386 1160387 1160388 1160389 1160390 1160391 1160392 1160393 1160394 1160395 1160396 1160397 1160398 1160399 1160400 1160401 1160402 1160403 1160404 1160405 1160407 1160408 1160409 1160410 1160411 1160412 1160413 1160414 1160415 1160416 1160417 1160418 1160419 1160420 1160421 1160422 1160423 1160870 1160871 1160872 1160873 1160874 1160875 1160876 1164444 1164492 1164493 1164548 1166503 1168420 1169744 1169748 1171549
Blocks: 1157217
  Show dependency treegraph
 
Reported: 2020-01-07 12:48 UTC by Martin Liška
Modified: 2020-06-27 22:14 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2020-01-07 12:48:54 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.
Comment 1 Alynx Zhou 2020-01-20 06:15:07 UTC
Assigned to you since you are handling those problems. If not OK please reassign, thanks!
Comment 2 Martin Liška 2020-05-19 11:36:10 UTC
Uppf! We're done, thanks to all who helped me.
Comment 3 OBSbugzilla Bot 2020-06-19 19:10:06 UTC
This is an autogenerated message for OBS integration:
This bug (1160244) was mentioned in
https://build.opensuse.org/request/show/816068 15.2 / profanity
Comment 4 OBSbugzilla Bot 2020-06-24 15:00:07 UTC
This is an autogenerated message for OBS integration:
This bug (1160244) was mentioned in
https://build.opensuse.org/request/show/816850 15.2 / profanity
Comment 5 Swamp Workflow Management 2020-06-27 22:14:36 UTC
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