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

Can we tailor the version of the compiler-builtins package that is compiled and linked together with the core crate? #61

Closed
parraman opened this issue Nov 20, 2020 · 4 comments

Comments

@parraman
Copy link

We would like to know if it is currently possible to change the version of the compiler-builtins package that is compiled together with the core crate.

We are having problems with the current version of compiler-builtins on the sparc-unknown-linux-gnu target. A new version has been produced to fix the issue. However, we are not able to test it because we cannot prevent the original one from being included. We would like to be able to link the new version, which is stored on a separate branch, instead of the current version.

We cannot add a dependency to the other version of the package into our Cargo.toml file because then cargo will include both versions and generate a linking error telling us that there are currently two versions of the same functions.

@SimonSapin
Copy link

Not knowing much about all this, it sounds like something that should be tested within the rust-lang/rust repository instead of using Cargo’s build-std.

@ehuss
Copy link
Contributor

ehuss commented Nov 23, 2020

It is currently not possible to change the version with build-std. As @SimonSapin mentioned, typically testing should be done by updating it in a clone of the rust-lang/rust repository and building rustc from there. Assuming things work, anyone is welcome to post a PR to bump the version (see rust-lang/rust#78209 for an example).

Supporting custom code with build-std is tracked in #7, though there isn't much of a plan or strategy on how that will work, yet.

@Hecatron
Copy link

Hecatron commented Feb 7, 2021

I also ran into this exact same problem while trying to use a custom version of compiler_builtins on disk
while using xtensa-esp32-none-elf with build-std (uses a separate rustc llvm fork)

There's currently a conflict with memcpy functions from esp32hal and compiler_builtins which hasn't been fixed yet so I was trying to use a custom version of compiler_builtins on disk to get around it.
For now I'll have to stick with cargo xbuild from the looks of things.

I did try patching via

[patch.crates-io]
compiler_builtins = { path = './patched/compiler-builtins' }

But it looks as if the build-std is pulling in packages in such a way that they're not shown via "cargo tree"

@ehuss
Copy link
Contributor

ehuss commented May 3, 2023

Closing per the comment in #61 (comment).

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
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

No branches or pull requests

4 participants