Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 872725 - dev-lang/rust-1.64.0: build failure on sparc (error[E0425]: cannot find value `SIGSTKFLT` in crate `c`)
Summary: dev-lang/rust-1.64.0: build failure on sparc (error[E0425]: cannot find value...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: Normal normal
Assignee: Georgy Yakovlev
URL: https://github.com/bytecodealliance/r...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-09-25 03:49 UTC by Sam James
Modified: 2022-09-30 01:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (file_872725.txt,428.13 KB, text/plain)
2022-09-25 03:49 UTC, Sam James
Details
patch for rustix crate (0001-rustix-sparc-has-no-SIGSTKFLT.patch,61.93 KB, text/plain)
2022-09-25 05:19 UTC, Georgy Yakovlev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-25 03:49:20 UTC
Created attachment 814030 [details]
build.log

warning: `xz2` (lib) generated 2 warnings
error[E0425]: cannot find value `SIGSTKFLT` in crate `c`
   --> /var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/vendor/rustix/src/imp/libc/process/types.rs:205:17
    |
205 |     Stkflt = c::SIGSTKFLT,
    |                 ^^^^^^^^^ help: a constant with a similar name exists: `SIGSTKSZ`
    |
   ::: /var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs:446:1
    |
446 | pub const SIGSTKSZ: ::size_t = 16384;
    | ------------------------------------- similarly named constant `SIGSTKSZ` defined here

error[E0531]: cannot find unit struct, unit variant or constant `SIGSTKFLT` in crate `c`
[...]
error: could not compile `rustix` due to 3 previous errors; 10 warnings emitted

Caused by:
  process didn't exit successfully: `CARGO=/usr/lib/rust/1.63.0/bin/cargo CARGO_CRATE_NAME=rustix CARGO_MANIFEST_DIR=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/vendor/rustix CARGO_PKG_AUTHORS='Dan Gohman <dev@sunfishcode.online>:Jakub Konka <kubkon@jakubkonka.com>' CARGO_PKG_DESCRIPTION='Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=rustix CARGO_PKG_REPOSITORY='https://github.com/bytecodealliance/rustix' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.35.6 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=35 CARGO_PKG_VERSION_PATCH=6 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps:/usr/lib/rust/1.63.0/lib:' OUT_DIR=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/build/rustix-c545a2ac80fd0af8/out /usr/lib/rust/1.63.0/bin/rustc --crate-name rustix --edition=2018 /var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/vendor/rustix/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=0 --cfg 'feature="default"' --cfg 'feature="fs"' --cfg 'feature="io-lifetimes"' --cfg 'feature="std"' -C metadata=45510bcf649eb595 -C extra-filename=-45510bcf649eb595 --out-dir /var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps -L dependency=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps --extern bitflags=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps/libbitflags-239db34e64ae628d.rmeta --extern libc_errno=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps/liberrno-5a163241a2553a6f.rmeta --extern io_lifetimes=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps/libio_lifetimes-38c82b3d4423d885.rmeta --extern libc=/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/build/bootstrap/debug/deps/liblibc-f41fd3c181356920.rmeta --cap-lints warn -C linker=sparc64-unknown-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings --cfg libc` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
warning: `syn` (lib) generated 247 warnings
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/./x.py", line 48, in <module>
    bootstrap.main()
  File "/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/src/bootstrap/bootstrap.py", line 928, in main
    bootstrap(help_triggered)
  File "/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/src/bootstrap/bootstrap.py", line 905, in bootstrap
    build.build_bootstrap(args.color)
  File "/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/src/bootstrap/bootstrap.py", line 774, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/src/bootstrap/bootstrap.py", line 166, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/lib/rust/1.63.0/bin/cargo build --manifest-path /var/tmp/portage/dev-lang/rust-1.64.0/work/rustc-1.64.0-src/src/bootstrap/Cargo.toml --verbose --verbose --locked --frozen

----

# emerge --info
Portage 3.0.36 (python 3.10.6-final-0, default/linux/sparc/17.0/64ul/desktop, gcc-12.2.1, glibc-2.35-r8, 5.15.69-gentoo sparc64)
=================================================================
System uname: Linux-5.15.69-gentoo-sparc64-sun4v-with-glibc2.35
KiB Mem:   531346544 total, 524645720 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 25 Sep 2022 02:04:00 +0000
sh dash 0.5.11.5
ld GNU ld (Gentoo 2.38 p4) 2.38
ccache version 4.5.1 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.8.13_p8::gentoo, 3.9.13_p6::gentoo, 3.10.6_p4::gentoo
dev-lang/rust:             1.63.0-r1::gentoo
dev-lang/rust-bin:         1.63.0::gentoo
dev-util/ccache:           4.5.1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             10.4.0::gentoo, 11.3.1_p20220916::gentoo, 12.2.1_p20220917::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /bound/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="sparc"
ACCEPT_LICENSE="*"
CBUILD="sparc64-unknown-linux-gnu"
CFLAGS="-O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches"
CHOST="sparc64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/bound/distfiles"
EMERGE_DEFAULT_OPTS="--complete-graph --with-bdeps=y --keep-going --deep"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl alsa big-endian branding bzip2 cairo caps cdda cdr cli crypt cups dbus dri dts dvd dvdr encode exif filecaps flac fortran gdbm gif gmp gpm gtk gui iconv icu introspection ipv6 jit jpeg lcms libglvnd libnotify libtirpc llvm-libunwind mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds readline sdl sparc spell split-usr ssl startup-notification svg tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10 python3_7 python3_8 python3_9" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="dummy fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-25 03:53:06 UTC
Doubt it's the same problem but https://github.com/google/evcxr/issues/126 has the same error from a while ago.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2022-09-25 05:19:33 UTC
Created attachment 814039 [details]
patch for rustix crate

proposed patch attached.

sparc does not have it
https://github.com/torvalds/linux/search?p=2&q=SIGSTKFLT&type=code
but it's defined in uapi, so idk what's going on.
    /// `SIGSTKFLT`
    #[cfg(not(any(
        target_os = "freebsd",
        target_os = "illumos",
        target_os = "ios",
        target_os = "macos",
        target_os = "netbsd",
        target_os = "openbsd",
        target_os = "solaris",
        all(
            any(target_os = "android", target_os = "linux"),
            any(target_arch = "mips", target_arch = "mips64"),
        )
    )))]
    Stkflt = c::SIGSTKFLT,
https://github.com/bytecodealliance/rustix/blob/d96706a9b3d7126161af595c9c3fa40afbd1dce3/src/backend/libc/process/types.rs#L217
they recently added solaris there
probably needs target_arch sparc


rustix crate in 1.63.0 is not present, it's a new addition in 1.64.0
Comment 3 Larry the Git Cow gentoo-dev 2022-09-25 06:37:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46a3260c72f0a4d918daa3f313f8e586f12475f4

commit 46a3260c72f0a4d918daa3f313f8e586f12475f4
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-09-25 06:11:45 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-09-25 06:37:04 +0000

    dev-lang/rust: fix 1.64.0 build on sparc
    
    Issue: https://github.com/bytecodealliance/rustix/issues/408
    Bug: https://bugs.gentoo.org/872725
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 ...64.0-vendor-rustix-sparc-has-no-SIGSTKFLT.patch | 60 ++++++++++++++++++++++
 dev-lang/rust/rust-1.64.0.ebuild                   | 11 ++++
 2 files changed, 71 insertions(+)
Comment 4 Larry the Git Cow gentoo-dev 2022-09-30 01:19:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ed2c47c6788fa72ab0c4187000337105e021f97

commit 2ed2c47c6788fa72ab0c4187000337105e021f97
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-09-30 01:18:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-30 01:18:58 +0000

    dev-lang/rust-bin: add sparc binary for 1.64.0
    
    Closes: https://bugs.gentoo.org/872725
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/rust-bin/Manifest               | 1 +
 dev-lang/rust-bin/rust-bin-1.64.0.ebuild | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)