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

HACL native library compile on ubuntu fails on "undefined reference to '__explicit_bzero_chk'" #67

Open
JohnLCaron opened this issue Apr 15, 2022 · 1 comment
Labels
non-jvm Specific to non-jvm platform development

Comments

@JohnLCaron
Copy link
Collaborator

Lib_Memzero0.c:function Lib_Memzero0_memzero: error: undefined reference to '__explicit_bzero_chk'

It appears that Kotlin/Native must use glibc 2.19, which doesnt include explicit_bzero, see https://youtrack.jetbrains.com/issue/KT-43501.

in Lib_Memzero.c:

#elif (defined(linux) && !defined(LINUX_NO_EXPLICIT_BZERO)) || defined(FreeBSD)
explicit_bzero(dst, len_);

So we just can define LINUX_NO_EXPLICIT_BZERO, maybe in libhacl.def:

compilerOpts.linux = -Ilibhacl/include -DLINUX_NO_EXPLICIT_BZERO

but that didnt work.

For now I modified Lib_Memzero.c directly and it works now.

  1. define LINUX_NO_EXPLICIT_BZERO so we dont have to modify source.
  2. watch for Kotlin/Native upgrade to glib 2.25+
@JohnLCaron
Copy link
Collaborator Author

Hopefully this will be superceded by #200

@JohnLCaron JohnLCaron added the non-jvm Specific to non-jvm platform development label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-jvm Specific to non-jvm platform development
Projects
None yet
Development

No branches or pull requests

1 participant