Skip to content
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

Add C flag to allow tentative definitions #42

Merged
merged 2 commits into from
Jun 1, 2020
Merged

Conversation

dther
Copy link
Contributor

@dther dther commented Jun 1, 2020

GCC 10 changes default C compilation behaviour. In particular:

GCC now defaults to -fno-common. As a result, global variable accesses are more efficient on various targets. In C, global variables with multiple tentative definitions now result in linker errors. With -fcommon such definitions are silently merged during linking.

Adding -fcommon to CFLAGS in the Makefile fixes #40.
I wonder whether some minor refactoring would be a better solution, but I doubt any performance benefits would be worth the effort.

dther added 2 commits June 1, 2020 12:33
A gcc-10 changes the default behaviour from -fcommon to -fno-common,
which causes linking errors in some build processes.

Fixes mpereira#40.
@mpereira
Copy link
Owner

mpereira commented Jun 1, 2020

Thanks @dther. I tested it on macOS and it still works.

@mpereira mpereira merged commit 5bbaafd into mpereira:master Jun 1, 2020
@mpereira
Copy link
Owner

mpereira commented Jun 1, 2020

@dther v1.3.0 released with your change. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building fails in Fedora 32
2 participants