-
Notifications
You must be signed in to change notification settings - Fork 873
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
Error when building for armv6 #719
Comments
Ah, it looks like it cannot find the atomic functions? (the cmake should detect automatically if -latomic is needed but it seems to fail here? is it due to musl ?) |
I can try, where do I need to put the flag ? Somewhere in the cargo build command ? |
if you mean the libmimalloc-sys/build.rs then yes. |
Well, that is very strange, as trying to isolate the problem gives another error... both for armv6 and arm64 (arm64 used to work).
It works when building the Mimalloc Rust crate directly, but not when building the simplest example application with :
[package]
name = "mimalloc_test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
mimalloc = "0.1"
The error is then :
|
ah, that looks like a strange error; not sure if this comes from mimalloc? |
Well, with forcing mimalloc to latest dev-slice, that gives the following error :
|
I created an issue on the rust crate, since it is difficult to work out where the problem comes from : purpleprotocol/mimalloc_rust#94 . |
If I look at this post it seems to me that the C or C++ compiler is not consistent -- this is especially tricky with |
@daanx Rust uses the C abi and C++ is always invoked through a C layer so cmake is not used. The native gcc compiler is invoked through the build file. The only time a C++ compiler is used is on Windows with msvc. |
Does the latest release fix the build issue? |
Using
|
Ah strange. But given the error I believe this is not a mimalloc issue. If we see this post it seems a cross compilation issue to me in the build files. I see the build command invokes Maybe Try to run the build verbosely so we can see all exact build commands. |
I just made a gist with the code : . It is possible to git clone it with objdump gives the following result with /usr/local/rustup/toolchains/1.69.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-musleabihf/lib/self-contained/crt1.o: It seems that it is ARM !? |
The error message makes it pretty clear that it is attempting to link using To use a linker capable of handling ARMv6, you can e.g. just tell it to use your [target.arm-unknown-linux-musleabihf]
linker = "arm-linux-musleabihf-gcc" Which will make it compile further and fail with the same atomic errors. |
Thanks, my bad, I had actually that set up on my main code but I forgot to include it in the gist.
The output is still :
|
Forwarding this issue. Original is here: purpleprotocol/mimalloc_rust#91
This is the build error:
The text was updated successfully, but these errors were encountered: