Skip to content

Fix a linker error in ninja_test_hypre_parasails#3

Merged
dongahn merged 1 commit intoPRUNERS:masterfrom
hainest:thaines/fix_linker_error_in_test
May 4, 2022
Merged

Fix a linker error in ninja_test_hypre_parasails#3
dongahn merged 1 commit intoPRUNERS:masterfrom
hainest:thaines/fix_linker_error_in_test

Conversation

@hainest
Copy link
Copy Markdown
Contributor

@hainest hainest commented May 4, 2022

The symbol is defined as a global symbol in both object files. This error wasn't detect by gcc versions before 10.0.

@dongahn This was detected as part of my work on the ECP Software Development Tools SDK.

The symbol is defined as a global symbol in both object files. This error wasn't detect by gcc versions before 10.0.
@dongahn
Copy link
Copy Markdown

dongahn commented May 4, 2022

@hainest: this looks good to me. One question: while the change looks good as it will improve global symbol management, I am curious by the comment:

This error wasn't detect by gcc versions before 10.0.

What is the error? This conflicts with another global symbol in which case where does it come from?

@hainest
Copy link
Copy Markdown
Contributor Author

hainest commented May 4, 2022

What is the error? This conflicts with another global symbol in which case where does it come from?

One comes from ninja_test_hypre_parasails.o and the other from ninja_test_util.o. I'm guessing, but it's plausible the reason earlier gcc's didn't detect the error is because they didn't take into account that the arrays are different lengths.

@dongahn
Copy link
Copy Markdown

dongahn commented May 4, 2022

@hainest: make sense. Would that make sense to hide those other symbols into the file scope as well?

@hainest
Copy link
Copy Markdown
Contributor Author

hainest commented May 4, 2022

Because C doesn't have namespaces, I tend to be conservative and give globals internal linkage. Currently, I don't see any other linker issues, but that doesn't guarantee there aren't any.

@dongahn
Copy link
Copy Markdown

dongahn commented May 4, 2022

Cool. I will accept the patch then.

@dongahn dongahn merged commit a8cd539 into PRUNERS:master May 4, 2022
@hainest hainest deleted the thaines/fix_linker_error_in_test branch May 4, 2022 15:53
@hainest
Copy link
Copy Markdown
Contributor Author

hainest commented May 4, 2022

Thanks!

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.

2 participants