Skip to content

Conversation

SimonIT
Copy link

@SimonIT SimonIT commented Sep 19, 2025

I used riscv64-unknown-elf-gcc 10.2.0 for building. With these changes ring builds, but haven't been able to verify if it works, yet.

Please feel free to leave some feedback. Some changes are probably needed in the build.rs, but I'm not sure what they are.

The change in target.h is from #1627

}

if target.os == NONE {
let _ = c.flag("-ffreestanding");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is correct for all "none" targets, e.g. wasm32v1.

I found when targeting some -none targets in the past that I didn't need to build with -ffreestanding. What happens if we omit it for this target?

Copy link
Author

@SimonIT SimonIT Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  cargo:warning=In file included from /mnt/data/Software/Entwicklung/ring/include/ring-core/base.h:26,
  cargo:warning=                 from /mnt/data/Software/Entwicklung/ring/crypto/curve25519/internal.h:18,
  cargo:warning=                 from /mnt/data/Software/Entwicklung/ring/crypto/curve25519/curve25519.c:22:
  cargo:warning=/usr/lib/gcc/riscv64-unknown-elf/10.2.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
  cargo:warning=    9 | # include_next <stdint.h>
  cargo:warning=      |                ^~~~~~~~~~
  cargo:warning=compilation terminated.

The compiler can't find stdint.h.

I'm also not sure what the best filter for that target is

let _ = c.flag(f);
}

if target.os == NONE {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please combine this with the if (target.arch == WASM32) || (target.os == "linux" && target.env == "musl" && target.arch != X86_64) below.

If you need to support GCC then you could change the test in that block to also include is_like_gcc or whatever.

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.

2 participants