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

Fix compatibility with GCC 10. #943

Merged
merged 2 commits into from
Nov 29, 2020
Merged

Conversation

DDoSolitary
Copy link
Contributor

By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:

Please submit all pull requests against the development branch. Failure to do so will delay or deny your request

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?: 1


GCC 10 defaults to -fno-common, which requires "extern" when defining global variables in headers.

This template was created based on the work of udemy-dl.

GCC 10 defaults to -fno-common, which requires "extern" when defining
global variables in headers.

Signed-off-by: DDoSolitary <DDoSolitary@gmail.com>
@DDoSolitary
Copy link
Contributor Author

Tests failed unfortunately... I'll take a look later.

@DL6ER
Copy link
Member

DL6ER commented Nov 29, 2020

Tests are all green after restarting the failed ones. There exists a race-collision in the tests leading to false-negative results. I haven't had the time to look at this so far, also because it doesn't happen very often.

Copy link
Member

@DL6ER DL6ER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your submission. I'm slightly surprised I forgot this in only one spot :-)

Can I ask you to add

-fno-common

also to this line:

set(HARDENING_FLAGS "-fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now -fexceptions -funwind-tables -fasynchronous-unwind-tables -Wl,-z,defs -Wl,-z,now -Wl,-z,relro")

and add a descriptive comment above like

# -fno-common: Emit globals without explicit initializer from `.bss` to `.data`. This causes GCC to reject multiple definitions of global variables. This is the new default from GCC-10 on.

to enforce this also in the future?

Signed-off-by: DDoSolitary <DDoSolitary@gmail.com>
@DDoSolitary
Copy link
Contributor Author

@DL6ER Done.

@DL6ER
Copy link
Member

DL6ER commented Nov 29, 2020

Thanks, the failing tests should get fixed by #945

@DL6ER DL6ER merged commit 5ea57e5 into pi-hole:development Nov 29, 2020
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.

3 participants