smaeul / portage-overlay

Extra ebuilds for Gentoo systems, mostly packages fixed to work with musl
18 stars 2 forks source link

rust 1.49.0 playground #33

Closed stefson closed 2 years ago

stefson commented 3 years ago

this is a draft for now, I will ask for review periodically and hope to get things going this way :-)

stefson commented 3 years ago

@smaeul I need a review of this commit please: https://github.com/smaeul/portage-overlay/pull/33/commits/17655a82265602d1ad12b6ac81179276b382ae10

this was the error with the original patch from the 1.48.0 patchset:

sysroot: "/var/tmp/portage/dev-lang/rust-1.49.0/work/rustc-1.49.0-src/build/x86_64-gentoo-linux-musl/stage0-sysroot"
libdir: "/var/tmp/portage/dev-lang/rust-1.49.0/work/rust-stage0/lib"
error[E0609]: no field `target` on type `rustc_target::spec::Target`
    --> compiler/rustc_codegen_ssa/src/back/link.rs:2036:41
     |
2036 |                         && !sess.target.target.options.crt_static_allows_dylibs
     |                                         ^^^^^^ unknown field
     |
     = note: available fields are: `llvm_target`, `pointer_width`, `arch`, `data_layout`, `options`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0609`.

Did not run successfully: exit code: 1
error: could not compile `rustc_codegen_ssa`

I simply replaced !sess.target.target.options.crt_static with !sess.target.options.crt_static, is it okay to solve the problem in this way?

smaeul commented 3 years ago

I simply replaced !sess.target.target.options.crt_static with !sess.target.options.crt_static, is it okay to solve the problem in this way?

Yes, that looks right.

stefson commented 2 years ago

@smaeul I made great progress with the patchset, but:

I had to remove this chunk of the libc patch https://github.com/smaeul/portage-overlay/blob/master/dev-lang/rust/files/1.48.0/0030-libc-linkage.patch#L7

and completly disable the 0008-Link-libssp_nonshared.a-on-all-musl-targets.patch

that makes things compile with gcc on amd64, but I don't know why though.

what do you think?

stefson commented 2 years ago

@smaeul its ready for review. I backported everything, compiled it for amd64 and tested the binary a bit with emerging cbindgen and librsvg.

Had to remove the first chunk of the 0030-libc patch, that is based on trial and error alone.

Please check it, thank you

smaeul commented 2 years ago

Thanks, this looks good! I squashed your patch updates and am building this now. The only issue I have seen so far is missing verify-sig in IUSE. I'll push this after the build succeeds.

stefson commented 2 years ago

the chunk I removed from 0030-libc patch will cause static_nobundle feature to be enabled twice, maybe its possible revert the commit that introduced this behavoir: https://github.com/rust-lang/libc/commit/c4b0d5efd3a3cb17ae830b83bc2abc7ce83be24d

smaeul commented 2 years ago

There's no need to revert anything. That hunk just isn't needed anymore (that's good!).