Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 760405

Summary: dev-lang/rust-bin-1.47.0-r1: claims to support x32 ABI but that's not the case
Product: Gentoo Linux Reporter: Jan Ziak (atomsymbol) <0xe2.0x9a.0x9b>
Component: Current packagesAssignee: Gentoo Rust Project <rust>
Status: UNCONFIRMED ---    
Severity: normal CC: bugs, jstein, navi, oleg, randy, steve
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 393673    
Attachments: build.log
rust-bin ebuild patch adding x32 target rustlib
rust eclass patch to add x32 triple mapping
WIP patch to build native x32 rust toolchain
rust-bin ebuild patch adding x32 target rustlib
rust-bin ebuild patch adding x32 target rustlib
rust-bin ebuild patch adding x32 target rustlib
rust-bin ebuild patch adding x32 target rustlib

Description Jan Ziak (atomsymbol) 2020-12-17 00:54:59 UTC
Created attachment 678538 [details]
build.log

Hi. This package claims to support x32 ABI but there is no rust-1.47.0-x32-unknown-linux-gnu.tar.xz in /usr/portage/disfiles.
Comment 1 Henrik 2021-06-07 20:39:04 UTC
I can confirm it is still broken with 1.52.1 as well as dev-lang/rust for x32
Comment 2 Oleh Kravchenko 2021-08-24 16:03:59 UTC
Reproducible with dev-lang/rust-1.53.0:stable:

>  * Package:    dev-lang/rust-1.53.0
>  * Repository: gentoo
>  * Maintainer: gyakovlev@gentoo.org rust@gentoo.org
>  * USE:        abi_x86_64 abi_x86_x32 amd64 cpu_flags_x86_sse2 elibc_glibc kernel_linux llvm_targets_X86 userland_GNU
>  * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>  * Checking for at least 11520 MiB disk space at "/var/tmp/portage/dev-lang/rust-1.53.0/temp" ...
>  [ ok ]
>  * Using python3.9 to build
> /var/tmp/portage/dev-lang/rust-1.53.0/temp/environment: line 3985: /var/tmp/portage/dev-lang/rust-1.53.0/work/rust-1.52.0-x86_64-pc-linux-gnux32/install.sh: No such file or directory
>  * ERROR: dev-lang/rust-1.53.0::gentoo failed (prepare phase):
>  *   (no error message)
>  * 
>  * Call stack:
>  *     ebuild.sh, line 127:  Called src_prepare
>  *   environment, line 3985:  Called die
>  * The specific snippet of code:
>  *           "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die;
>  * 
>  * If you need support, post the output of `emerge --info '=dev-lang/rust-1.53.0::gentoo'`,
>  * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.53.0::gentoo'`.
>  * The complete build log is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/build.log'.
>  * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/environment'.
>  * Working directory: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
>  * S: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
Comment 3 Steven Newbury 2022-05-04 12:30:08 UTC
The upstream rust binary distribution *does* support x32 (x86_64-unknown-linux-gnux32) but as a target only, and requires the x32 rust-std (rustlib) component to be installed. The toolchain itself is amd64 only.

For the purpose of bootstrapping a native x32 Rust toolchain, this enough.  Patches follow...
Comment 4 Steven Newbury 2022-05-04 12:31:06 UTC
Created attachment 776612 [details, diff]
rust-bin ebuild patch adding x32 target rustlib
Comment 5 Steven Newbury 2022-05-04 12:32:50 UTC
Created attachment 776615 [details, diff]
rust eclass patch to add x32 triple mapping
Comment 6 Steven Newbury 2022-05-04 12:37:36 UTC
Created attachment 776618 [details, diff]
WIP patch to build native x32 rust toolchain

This is WIP because -system-bootstrap isn't complete.  It currently only works with system-bootstrap, although both dev-lang/rust-bin (amd64) and dev-lang/rust (x32) both work to bootstrap.
Comment 7 Steven Newbury 2022-05-04 12:38:14 UTC
(In reply to Steven Newbury from comment #6)
> Created attachment 776618 [details, diff] [details, diff]
> WIP patch to build native x32 rust toolchain
> 
> This is WIP because -system-bootstrap isn't complete.  It currently only
> works with system-bootstrap, although both dev-lang/rust-bin (amd64) and
> dev-lang/rust (x32) both work to bootstrap.

Also, only tested with system-llvm.
Comment 8 Steven Newbury 2022-05-04 12:42:26 UTC
(In reply to Steven Newbury from comment #6)
> Created attachment 776618 [details, diff] [details, diff]
> WIP patch to build native x32 rust toolchain
> 
> This is WIP because -system-bootstrap isn't complete.  It currently only
> works with system-bootstrap, although both dev-lang/rust-bin (amd64) and
> dev-lang/rust (x32) both work to bootstrap.

To get !system-boostrap working requires adding the x32 rustlib matching the rust release used for internal bootstrapping  as I did for rust-bin.
Comment 9 Steven Newbury 2022-05-04 17:40:34 UTC
Created attachment 776630 [details, diff]
rust-bin ebuild patch adding x32 target rustlib

Accidentally attached the wrong version.
Comment 10 Steven Newbury 2022-05-06 14:37:21 UTC
Created attachment 777059 [details, diff]
rust-bin ebuild patch adding x32 target rustlib

Fixed bug
Comment 11 Steven Newbury 2022-05-06 14:40:14 UTC
Created attachment 777062 [details, diff]
rust-bin ebuild patch adding x32 target rustlib

Forgot to mark obsolete
Comment 12 Steven Newbury 2022-05-06 15:53:35 UTC
Created attachment 777068 [details, diff]
rust-bin ebuild patch adding x32 target rustlib

Apologies, this version works for both when x32 is multilib_is_native and when it isn't.  Suffering from apparent brain failure.