GithubHelp home page GithubHelp logo

RISC-V compilation? about blst HOT 5 CLOSED

puma314 avatar puma314 commented on June 24, 2024
RISC-V compilation?

from blst.

Comments (5)

mratsim avatar mratsim commented on June 24, 2024

Note that the compiler path depends on the Linux (or MacOS or Windows) distribution method, and it's likely better to assume that it's in the path rather than in /opt.

image

from blst.

dot-asm avatar dot-asm commented on June 24, 2024

It should be noted that it's perfectly possible to compile blst without C headers with contemporary gcc or clang. This means that you don't have to bother with --sysroot or anything of the sort. All you need is to pass -ffreestanding to a compiler [recognized by cc-rs] that can generate RISC-V ELF object modules. And the best part is that blst's build.rs does it for you already (last adjusted in 2899b7f). So the only question left is if cc-rs can spot a suitable compiler, and if [it] doesn't on your system, you'd be expected to direct it to one. Easiest is to set the CC environment variable to clang. This is because the majority of clang installations are capable of generating RISC-V object modules, Linux, homebrew, Windows, including one provided by Microsoft as a Visual Studio option... With this in mind the question is rather what is it that doesn't work (past 2899b7f) for you. I mean do tell.

from blst.

dot-asm avatar dot-asm commented on June 24, 2024

Easiest is to set the CC environment variable to clang.

Just in case for reference. In the essence we're talking about "bare-metal" Rust targets here, right? At least that's primarily where -ffreestanding flag is passed. Since it's a known fact that Rust uses "own" linker on "bare-metal" platforms, rust-lld, one can make a case that it would be more appropriate than not to default to clang. On the grounds that both rust-lld and clang are llvm-based. But even in this case it would be hardly appropriate to force it. I mean one can advocate for "if the target is "bare-metal" and CC is not set, see if clang is available on the $PATH and choose it," but not for "choose clang on "bare-metal" platforms unconditionally."

from blst.

dot-asm avatar dot-asm commented on June 24, 2024

And the best part is that blst's build.rs does it for you already (last adjusted in 2899b7f).

To clarify, it's assumed that the commit in question should cover your target. At least it does cover riscv32im-risc0-zkvm-elf.

from blst.

dot-asm avatar dot-asm commented on June 24, 2024

For public reference, it was confirmed that the issue is resolved by the referred commit, and by extension in latest version, "out of band."

from blst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.