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

Bug:"Unknown target CPU" & "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" #1878

Closed
gcp-development opened this issue Jan 3, 2024 · 3 comments

Comments

@gcp-development
Copy link

gcp-development commented Jan 3, 2024

Hello,

My target is "riscv32imac-esp-espidf" and I am using the riscv64-unknown-elf-gcc to compile the ring library.

But I am getting the error below :

warning: ring@0.17.5: In file included from include/ring-core/base.h:74,
warning: ring@0.17.5:                  from include/ring-core/mem.h:60,
warning: ring@0.17.5:                  from crypto/curve25519/curve25519.c:22:
warning: ring@0.17.5: include/ring-core/target.h:63:2: error: #error "Unknown target CPU"
warning: ring@0.17.5:    63 | #error "Unknown target CPU"
warning: ring@0.17.5:       |  ^~~~~
warning: ring@0.17.5: In file included from crypto/curve25519/internal.h:20,
warning: ring@0.17.5:                  from crypto/curve25519/curve25519.c:24:
warning: ring@0.17.5: crypto/curve25519/../internal.h:210:2: error: #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
warning: ring@0.17.5:   210 | #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"

I am assuming that the current ring crate does not have the target "riscv32imac-esp-espidf".

There is any plan in the future to add this target or any riscv32 target ?

Thanks

@briansmith
Copy link
Owner

I am happy to accept a PR that adds riscv32 support. I suggest we start with riscv32gc-unknown-linux-gnu since we can just copy-paste-edit the changes from PR #1627, at least for for target.h, mk/cargo.sh, mk/install-build-tools.sh.

As for espidf, that probably needs a couple of additional tweaks for getrandom. If there's a way to use qemu-user to target espidf then that would help.

@briansmith
Copy link
Owner

Closing as a duplicate of #1765.

@gcp-development
Copy link
Author

Fair enough.

Nevertheless, the "riscv32imac-esp-espidf" is more similar the way the "armv7-unknown-linux-musleabihf" (With the emu setup for riscv32) was setup in your code than the current "riscv64gc-unknown-linux-gnu".

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants