-
Notifications
You must be signed in to change notification settings - Fork 240
Failed to cross-compile the example program from x86_64 Linux #82
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
Comments
The problem here is that you're using the right cross compiler, but you're not using the right linker. The system # .cargo/config
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
# ... same for arm |
@alexcrichton I did use the correct linker. Here's my
And you can see lines like |
Oh right, of course, I was looking at the last line where it said It could be that the code wasn't actually compiled with the right compiler, which is probably the more relevant point as I believe the build script doesn't frob |
@alexcrichton It seems that By the way, I cross-compiled some other simple programs, e.g. the dining philosophers, and successfully ran them on Windows/ARM, so I think the |
Yeah Cargo won't pick up the environment variables, but curl's configure script should |
@alexcrichton Oh, I think you've absolutely hit the point. After setting
We can see |
It may just be modifying this repo's build script perhaps? |
@alexcrichton You were right. The following simple piece of code will make it work.
I successfully built and tested it this time for both However, there were another minor problem during the final linking stage for ARM. I googled it and found the solution of reversing the linking sequence of I'm new to Rust and could you please tell me how can this be controlled? (Here's the log)
|
Ah swapping the order looks like it'd just be useful in general, so I submitted a PR to rust-openssl |
@alexcrichton Thanks a lot. And please include my patch in the next release of |
@Frederick888 ah sorry I think I may have lost precisely what the patch was in the log here, would you be ok submitting a PR? |
@alexcrichton Of course. #83 |
anyone able to help with a similar curl issue I'm having? I obtain undefined reference errors as well when compiling code that should have already statically linked curl. |
I built a Rust 1.2.0 compiler under Fedora (x86_64) which supported multiple targets including
x86_64-pc-windows-gnu
andarm-unknown-linux-gnueabihf
and successfully compiled some simple programs.However, I failed to cross-compile the example program from curl-rust. (I can compile the example directly under Windows, haven't tried under ARM.)
When building for
x86_64-pc-windows-gnu
, I got:When building for
arm-unknown-linux-gnueabihf
, I got:But I did successfully cross-compile
curl-rust
itself for bothx86_64-pc-windows-gnu
andarm-unknown-linux-gnueabihf
which made it weirder.How to fix these problems? Did I miss any configurations?
The text was updated successfully, but these errors were encountered: