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 'extern' to all declarations to allow -fno-common option #220

Closed
wants to merge 1 commit into from

Conversation

keith-packard
Copy link
Contributor

-fno-common requires there to be only one definition of each global
symbol, with other usages being 'extern' declarations. This provides
compatibility with GCC 10 where -fno-common is now the default.

Signed-off-by: Keith Packard [email protected]

@keith-packard
Copy link
Contributor Author

This is required to resolve sifive/freedom-metal#229

@bsousi5
Copy link
Collaborator

bsousi5 commented May 7, 2020

We are planning to cut a branch today/tomorrow. This should go after the branch is pulled, and if needed we can cherry-pick it into the release branch.

@keith-packard
Copy link
Contributor Author

We are planning to cut a branch today/tomorrow. This should go after the branch is pulled, and if needed we can cherry-pick it into the release branch.

Agreed. This is not required when using gcc 8.3 as that uses -fcommon by default. Just getting ready for this to be merged after the release.

-fno-common requires there to be only one definition of each global
symbol, with other usages being 'extern' declarations. This provides
compatibility with GCC 10 where -fno-common is now the default.

Signed-off-by: Keith Packard <[email protected]>

---

v2:
	Fix code formatting
@@ -247,15 +247,15 @@ std::string Device::platform_define_offset(node n, std::string suffix) {
* "__metal_" namespace */
void Device::emit_struct_decl(std::string type, const node &n) {
emit_comment(n);
os << "struct __metal_driver_" << type << " __metal_dt_" << n.handle()
<< ";\n\n";
os << "extern /* hello */ struct __metal_driver_" << type << " __metal_dt_"
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the /* hello */ for?

@keith-packard
Copy link
Contributor Author

keith-packard commented May 12, 2020 via email

@bsousi5 bsousi5 mentioned this pull request May 18, 2020
@bsousi5 bsousi5 closed this May 27, 2020
@bsousi5
Copy link
Collaborator

bsousi5 commented May 27, 2020

Duplicate of PR#222, that has been validated on freedom-e-sdk and PCS

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