Skip to content

exposing riscv and softfloat as libraries #1968

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mslijepc
Copy link
Collaborator

this PR will make riscv and softfloat exposed and easily linked in case we want to link riscv-isa-sim with some other simulation environment.

aswaterman
aswaterman previously approved these changes Apr 30, 2025
@jerryz123
Copy link
Collaborator

Hang on, softfloat should be installed through softfloat, right?

@aswaterman
Copy link
Collaborator

I think we will have to learn from other users whether this causes annoyance, namely as a result of overwriting libsoftfloat with the Spike verison. If so, we will need to rename this one. But we can cross that bridge when we come to it.

@aswaterman
Copy link
Collaborator

OK, since @jerryz123 and I had similar reactions, let's hold off on this one.

@aswaterman aswaterman dismissed their stale review April 30, 2025 02:37

installing libsoftfloat might be a bad idea

@jerryz123
Copy link
Collaborator

Also this change wasn't necessary for my flow to link with libriscv at the installed path. I'll need to check how this works

@aswaterman
Copy link
Collaborator

aswaterman commented Apr 30, 2025

Spike's softfloat has its own augmentations, so we should avoid naming it the same as public softfloat.

We might want to namespace both of these libraries (e.g. libspike-riscv and libspike-softfloat). But let's give Jerry time to opine before we take further action.

Furthermore, I'm not sure that libspike-softfloat should actually be distinct from libspike-riscv. It seems like Spike-as-library should lump everything into something called libspike (or libriscv in Jerry's flow, or whatever). This might require more Makefile hacking, but it's better to figure that out now, rather than creating an ABI that we'll soon break.

@jerryz123
Copy link
Collaborator

As it turns out, the Softfloat repo provides no flow for installing libsoftfloat and its headers... only this repo does. Given that, I don't think there's any risk from installing libsoftfloat.a. This repo already installs all the softfloat headers, and the .so as well. Installing libriscv.a in addition to libriscv.so is also acceptable.

If someone were to untangle this mess properly, I think they should:

  • Add a proper build flow to berkeley-softfloat-3. This build flow should install variants of Softfloat specialized for different architectures (libsoftfloat-x86, libsoftfloat-armvfp2, libsoftfloat-riscv, etc.)
  • Excise all softfloat sources here, and add -lsoftfloat-riscv when linking.

I don't expect ^ to get done anytime soon, so this PR should be good as it stands. @mslijepc , you have a use case which requires the static libraries to be installed instead of the dynamic libs?

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.

3 participants