Generate Linux executable from rustc on mac

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Generate Linux executable from rustc on mac

C K Kashyap
Hi,
I'd like to build executables that can run on Linux using rust on mac. What configuration do I need to build rustc (on mac) with?

./configure --target=x86_64-unknown-linux-gnu

does not seem to work.

Regards,
Kashyap

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: Generate Linux executable from rustc on mac

C K Kashyap
+rust-dev

On Sun, Jan 18, 2015 at 1:53 PM, C K Kashyap <[hidden email]> wrote:
Luckily a workaround seems to work for me - I've updated the bug with the same - 
----update in the bug---

For what it's worth I have a workaorund that works for me -

On my mac machine, do the following
1. Compile the rust file (that's supposed to emit the static library) using --target=x86_64-unknown-linux-gnu -L library_path (library_path is the location where I've copied libcompiler-rt.a and libmorestack.a from the linux rust build)
2. Unarchive the generated .a file (ar x ) and then use the .o files (only the necessary .o files) in the final linking


On Sun, Jan 18, 2015 at 8:48 AM, C K Kashyap <[hidden email]> wrote:
Thanks for pointing out Brian ... I had also opened an issue for this - 

#21308 - closed it for now.

Regards,

Kashyap



On Sun, Jan 18, 2015 at 1:00 AM, Brian Anderson <[hidden email]> wrote:
While this would be awesome, the build system generally needs explicit support for every cross-compile scenario, and I don't believe anybody has ever done this one yet.

Here's some previous discussion, https://github.com/rust-lang/rust/issues/16259

On Fri, Jan 16, 2015 at 8:05 PM, C K Kashyap <[hidden email]> wrote:
Hi,
I'd like to build executables that can run on Linux using rust on mac. What configuration do I need to build rustc (on mac) with?

./configure --target=x86_64-unknown-linux-gnu

does not seem to work.

Regards,
Kashyap

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev






_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev