-
Notifications
You must be signed in to change notification settings - Fork 25
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 some linking errors caused by collisions with openssl #35
Conversation
As reported in #35, some of the C files in this library (e.g. src/poly1305-donna.c) are also present in other libraries, causing name collisions for the functions they export. This commit applies a `static` modifier to all C functions exported by these files, and includes directly the C files in the stub-*.c files. In the end, the only functions exported are now the OCaml/C stub functions, prefixed by `caml_`. The `static` modifier is hidden behind a `EXPORT` macro, so that the original visibility can be restored by compiling with `-DEXPORT=`, if that's ever needed.
As reported in #35, some of the C files in this library (e.g. src/poly1305-donna.c) are also present in other libraries, causing name collisions for the functions they export. This commit applies a `static` modifier to all C functions exported by these files, and includes directly the C files in the stub-*.c files. In the end, the only functions exported are now the OCaml/C stub functions, prefixed by `caml_`. The `static` modifier is hidden behind a `EXPORT` macro, so that the original visibility can be restored by compiling with `-DEXPORT=`, if that's ever needed. While we're at it: removed the remaining `$Id` comments.
Thanks for reporting this naming problem. Given that crypto code is often reused as is (with the same function names) between several projects, it could make sense to address the issue more generally. Prefixing all non-static identifiers with |
As reported in #35, some of the C files in this library (e.g. src/poly1305-donna.c) are also present in other libraries, causing name collisions for the functions they export. This commit applies a `static` modifier to all C functions exported by these files, and includes directly the C files in the stub-*.c files. In the end, the only functions exported are now the OCaml/C stub functions, prefixed by `caml_`. The `static` modifier is hidden behind a `EXPORT` macro, so that the original visibility can be restored by compiling with `-DEXPORT=`, if that's ever needed. While we're at it: removed the remaining `$Id` comments.
Let's go with #36 ! Thanks for your feedback. |
Thank you!! :)
…On June 7, 2024 4:58:56 AM EDT, Xavier Leroy ***@***.***> wrote:
Let's go with #36 ! Thanks for your feedback.
--
Reply to this email directly or view it on GitHub:
#35 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
on alpine, trying to do a static build with cryptokit and openssl (pulled in by another library), I met some symbol collisions that could only be fixed by prefixing C functions. For uniformity I renamed all the public C functions for sha3 and poly1305-donna so they start with
cryptokit_
.