Skip to content

cannot run binary built for Solaris #150

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

Closed
apopiak opened this issue Nov 12, 2017 · 6 comments
Closed

cannot run binary built for Solaris #150

apopiak opened this issue Nov 12, 2017 · 6 comments
Labels
A-solaris Area: solaris targets question

Comments

@apopiak
Copy link

apopiak commented Nov 12, 2017

I'm trying to cross-compile a super small test project for Solaris, but cross fails with could not execute process '/target/x86_64-sun-solaris/release/crosstest' (never executed).
My command: cross run --release --target=x86_64-sun-solaris -v on a Ubuntu 17.04 system.
I went into the docker container and it's a Ubuntu container so I'm not surprised that the Solaris binary cannot execute.
I'm confused where I went wrong because I saw the PR that added Solaris support.

@japaric
Copy link
Contributor

japaric commented Nov 12, 2017

As the README states there's cross compilation support for Solaris targets but not run / test support.

I went into the docker container and it's a Ubuntu container so I'm not surprised that the Solaris binary cannot execute.

Other targets have run / test support via QEMU / Wine. Nobody has suggested a way to do the same for Solaris -- QEMU user emulation may not work but QEMU system emulation would probably work.

@apopiak
Copy link
Author

apopiak commented Nov 14, 2017

Thanks, for clarifying. Got tripped up by that detail I guess. Is it possible to cross-compile rustc and or cargo for Solaris?

@japaric
Copy link
Contributor

japaric commented Nov 14, 2017

Is it possible to cross-compile rustc and or cargo for Solaris?

Cross compiling Cargo works for me:

$ cross build --target sparcv9-sun-solaris
$ file target/sparcv9-sun-solaris/debug/cargo
target/sparcv9-sun-solaris/debug/cargo: ELF 64-bit MSB executable, SPARC V9, total store ordering, version 1 (SYSV), dynamically linked, interpreter /usr/lib/sparcv9/ld.so.1, with debug_info, not stripped

I don't know if you can use Cross to cross compile rustc. rust-lang/rust has its own build system called bootstrap that calls Cargo to build std, rustc, etc. Perhaps you could hack it to make it call Cross instead of Cargo? I haven't tried.

@apopiak
Copy link
Author

apopiak commented Nov 15, 2017

Just FYI, I'm trying to build for x86_64-sun-solaris. I've tried to follow your reddit post on cross-compiling rust, but that is based on the old makefile approach and doesn't seem to be working.
When following the commands from this github issue I get a compiled libstd, but not rustc. Is there any documentation on how to cross-compile rustc that you're aware of? I don't seem to be able to guess based on the build system options and random posts I find on the interwebs...

@japaric
Copy link
Contributor

japaric commented Nov 15, 2017

I haven't cross compiled rustc in a long time but it went like this, iirc:

$ # export CC, AR and CXX
$ export CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc

$ # I want to cross compile a toolchain (rustc) for this host
$ ./configure --host=arm-unknown-linux-gnueabihf

$ # bootstrap the compiler and cross compile rustc
$ # there are ways to do this faster by not bootstraping the compiler but I don't remember them anymore
$ ./x.py

x.py is documented here.

@apopiak
Copy link
Author

apopiak commented Nov 16, 2017 via email

@apopiak apopiak closed this as completed Nov 16, 2017
@Alexhuszagh Alexhuszagh added question A-solaris Area: solaris targets labels May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-solaris Area: solaris targets question
Projects
None yet
Development

No branches or pull requests

3 participants