Skip to content

Weak syscalls fix #282

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Weak syscalls fix #282

wants to merge 2 commits into from

Conversation

bigspider
Copy link
Contributor

Many syscalls are defined in syscalls.c as weak, because a second implementation in the SDK can replace them. This is needed for many features, as the code compiled by the feature provides a different implementation under the control of the app.

This PR separates the compilation of syscalls.c in a separate object file that is compiled last, which allows the linker to choose the strong definition if it exists. Some refactoring was needed because includes need to be present in both cases, unlike C files that must not be duplicated.

After doing so, I was having linker errors related to the functions in u2f_transport.c, which indeed was not compiled. So I added the configuration for that in the second commit.

This makes sure that the symbols with __attribute((weak)) defined
in syscalls.c don't override the strong definitions elsewhere.
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.

1 participant