cross-toolchains icon indicating copy to clipboard operation
cross-toolchains copied to clipboard

add powerpc-musl images

Open Emilgardis opened this issue 2 years ago • 11 comments

requires cross-rs/cross#1346

Emilgardis avatar Oct 27 '23 16:10 Emilgardis

Out of curiosity, what's held this back from being merged? Was it incomplete?

dfego avatar Nov 27 '24 17:11 dfego

There's nothing hindering this, missing from this pr would be a readme change

Emilgardis avatar Nov 27 '24 17:11 Emilgardis

I grabbed it to see if it would work for me out of the box, and when going to compile a program I get errors like the ones in this issue: https://github.com/cross-rs/cross/issues/1416

Interestingly, I also get:

[cross] warning: rust-std is not available for powerpc-unknown-linux-musl
[cross] note: you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.powerpc-unknown-linux-musl.build-std`
              the available components are core, std, alloc, and proc_macro

Even though I've already got that. I don't know a ton about the inner workings here, but could potentially try some specific things out if it would help get this merged!

dfego avatar Nov 27 '24 21:11 dfego

ah yes, need to add it to the list of targets that need build-std by default

Emilgardis avatar Nov 27 '24 21:11 Emilgardis

oh wait, this is cross-toolchains, never mind then, not applicable. You need to add

[target.powerpc-unknown-linux-musl]
build-std = true

Emilgardis avatar Nov 27 '24 21:11 Emilgardis

So I've been using docker-in-docker and was having issues with the build-std parameter getting picked up consistently, so I've been passing it via the cross command line, a la:

-Z build-std=core,std,alloc,proc_macro,panic_abort -Z build-std-features=optimize_for_size,panic_immediate_abort

That's been working for all my other builds consistently. I've tried this with both the latest release and the main branch of cross-rs.

If it would help, I can try and do a hello minimal example of it not working. That might help me make sure I'm not doing anything weird or wrong either.

dfego avatar Nov 27 '24 21:11 dfego

Interesting! An example would be helpful

Emilgardis avatar Nov 28 '24 06:11 Emilgardis

I'm currently setting up a small repository with a complete example, but as I am, I wanted to note that after I call:

cargo build-docker-image powerpc-unknown-linux-musl-cross --tag local

I get the following warning, which may or may not be important?

 1 warning found (use docker --debug to expand):
 - UndefinedVar: Usage of undefined variable '$PKG_CONFIG_PATH' (line 25)

dfego avatar Nov 29 '24 16:11 dfego

Alright, I've got a pretty minimal example. I thought about just pasting the README here, but since perhaps there might lie an issue in another part of my setup, I figured I'd link to the whole thing: https://github.com/dfego/cross-issue

dfego avatar Nov 29 '24 16:11 dfego

Yes, that's cross-rs/cross#1416 still don't know how to solve it fully :/

Emilgardis avatar Nov 29 '24 18:11 Emilgardis

So I did see that issue, but I've also successfully gotten mips-unknown-linux-musl to work for me, using the git version of cross and in Cross.toml:

[target.mips-unknown-linux-musl]
image = "ghcr.io/cross-rs/mips-unknown-linux-musl:main"

[target.mipsel-unknown-linux-musl]
image = "ghcr.io/cross-rs/mipsel-unknown-linux-musl:main"

Notably, I can't do that with powerpc-unknown-linux-musl because there is no image for me to pull.

dfego avatar Nov 29 '24 18:11 dfego