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

possible fix for the ULongArray issue and for mode_t portability #143

Merged
merged 6 commits into from
Aug 31, 2022

Conversation

danwallach
Copy link
Contributor

This won't compile on my computer, possibly due to some kind of version mismatch issue:

> Task :linkDebugTestNative FAILED
e: Compilation failed: The /Library/Developer/CommandLineTools/usr/bin/clang++ command returned non-zero exit code: 1.
output:
error: Invalid record
1 error generated.

 * Source files: 
 * Compiler version info: Konan: 1.7.10 / Kotlin: 1.7.20
 * Output kind: STATIC_CACHE

e: org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /Library/Developer/CommandLineTools/usr/bin/clang++ command returned non-zero exit code: 1.
output:
error: Invalid record

But there's at least a chance this might work for you. Please check it out. Of note, I think I've got a portable solution to the mode_t issue, and I moved everything from ULongArray to LongArray and the compiler at least seems to be happy with that. It shouldn't make a difference (fingers crossed) because all of the real compute on those happens inside HACL, which doesn't care.

That said, all the useNative stuff now quietly converts LongArray to CPointer<ULongVar>. This feels bad somehow, even though it keeps the code as clean as possible.

Note: to get this to work at all on my M1 Mac, I had to comment out the OptimizeForArchitecture.cmake file. (Related issue: #66). That's probably going to slow things down significantly if we don't find an alternative.

@danwallach danwallach requested a review from JohnLCaron August 30, 2022 15:40
better use of type aliases

better use of contentEquals (as infix)

improved hashCode (using contentHashCode for arrays)
- had to switch to Kotlin 1.7.20 beta (couldn't find an RC; final release should be very soon)

- had to tweak cmake script to do universal library

- had to tweak gradle properties to add more memory, change weird ARM cache option
@danwallach danwallach merged commit 604ea59 into main Aug 31, 2022
@danwallach danwallach deleted the ulongarrayfix branch August 31, 2022 02:53
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