-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
This is required to resolve sifive/freedom-metal#229 |
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_" |
There was a problem hiding this comment.
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?
Just for debugging! Good catch
…On Tue, May 12, 2020, 14:50 Nathaniel Graff ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In metal_header/device.c++
<#220 (comment)>
:
> @@ -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_"
What's the /* hello */ for?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#220 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG3ASERCYQCHLX3OBLN6S3RRHADJANCNFSM4M3QBVNA>
.
|
Duplicate of PR#222, that has been validated on freedom-e-sdk and PCS |
-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]