Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 756340 - dev-lang/rust-1.48.0: could not compile `rustc_middle`
Summary: dev-lang/rust-1.48.0: could not compile `rustc_middle`
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Rust Project
URL: https://github.com/rust-lang/rust/iss...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-24 15:00 UTC by Craig Andrews
Modified: 2024-10-17 15:41 UTC (History)
11 users (show)

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


Attachments
build.log.gz (dev-lang:rust-1.48.0:20201124-130120.log.gz,144.88 KB, application/gzip)
2020-11-24 15:01 UTC, Craig Andrews
Details
gdb stack dump (2 ways) - use xzless to read (gdb.log.xz,13.39 KB, application/x-xz)
2020-11-30 14:37 UTC, flippynelle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2020-11-24 15:00:44 UTC
---
Caused by:
  process didn't exit successfully: `/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/bootstrap/debug/rustc --crate-name rustc_middle --edition=2018 compiler/rustc_middle/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C metadata=b544f4a8b2dcc271 -C extra-filename=-b544f4a8b2dcc271 --out-dir /var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -C linker=x86_64-pc-linux-gnu-gcc -L dependency=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern bitflags=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-6493eafbfc07ab17.rmeta --extern chalk_ir=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libchalk_ir-c1b14a85ac412385.rmeta --extern measureme=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libmeasureme-f89ce04b124ea654.rmeta --extern polonius_engine=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-d1c4954680eabfe4.rmeta --extern rustc_rayon_core=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_rayon_core-bf5390250f28c01f.rmeta --extern rustc_apfloat=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-2adeb8d4b11d3373.rmeta --extern rustc_arena=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_arena-4d771a4c2b539e93.rmeta --extern rustc_ast=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_ast-f5c6d7e0c17cd063.rmeta --extern rustc_attr=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_attr-32c51f5b7abc8981.rmeta --extern rustc_data_structures=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-d05e079fb654d28c.rmeta --extern rustc_errors=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-f461ec14294ca0a5.rmeta --extern rustc_feature=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_feature-2dd9a41be27311a3.rmeta --extern rustc_hir=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir-112a5a817212a3e0.rmeta --extern rustc_index=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_index-1cb937cfea49f2ff.rmeta --extern rustc_macros=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_macros-7c29837fb397f753.so --extern rustc_query_system=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_query_system-8e7a84a6fb2ad1b5.rmeta --extern rustc_serialize=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_serialize-9a732492d64bd674.rmeta --extern rustc_session=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_session-5338d1874df1cd43.rmeta --extern rustc_span=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ea8e6039eee524f6.rmeta --extern rustc_target=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-5615b1484816d142.rmeta --extern smallvec=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-fcbd275355640b5e.rmeta --extern tracing=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-2e5660762ba9c27b.rmeta -Ctarget-cpu=native -Zmacro-backtrace -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Z binary-dep-depinfo -L native=/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/psm-e7cce750800ca4d0/out` (exit code: 254)
command did not execute successfully: "/usr/lib/rust/1.47.0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "5" "-v" "--release" "--locked" "--frozen" "--features" " llvm max_level_info" "--manifest-path" "/var/tmp/portage/dev-lang/rust-1.48.0/work/rustc-1.48.0-src/compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
---


Reproducible: Always




# emerge --info
Portage 3.0.10 (python 3.8.6-final-0, default/linux/amd64/17.1/systemd, gcc-10.2.0, glibc-2.32-r3, 5.9.6-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.9.6-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i5-6500_CPU_@_3.20GHz-with-glibc2.2.5
KiB Mem:    16077136 total,   2380032 free
KiB Swap:    8038396 total,   3738548 free
Timestamp of repository gentoo: Tue, 24 Nov 2020 12:30:01 +0000
Head commit of repository gentoo: bd641e790661a5247522704e095cad90f80c60b4
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
ccache version 4.1 [enabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.19.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo, 2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

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

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

flatpak-overlay
    location: /var/lib/layman/flatpak-overlay
    sync-type: laymansync
    sync-uri: https://github.com/fosero/flatpak-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

wayland-desktop
    location: /var/lib/layman/wayland-desktop
    sync-type: laymansync
    sync-uri: https://github.com/epsilon-0/wayland-desktop.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Intel-SDP Oracle-BCLA-JavaSE Oracle-EADLA AMD-GPU-PRO-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fuse-linker-plugin -flto -Wl,-flto -ftree-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-common"
CHOST="x86_64-pc-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/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -fuse-linker-plugin -flto -Wl,-flto -ftree-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-common"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.5"
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 candy ccache cgroup clean-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto -Wl,--hash-style=gnu"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/var/cache/portage/packages"
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"
USE="X a52 aac aacs acl acpi aiglx alac alsa amd64 amr amrnb amrwb animation apache2 apng argon2 artworkextra asf aspnet2 asyncns authdaemond avahi avi bash-completion bcmath berkdb bitmap-fonts bluetooth bluray bmp bonjour brotli btrfs bzip2 cairo caps cdda cddb cdparanoia cdr celt chm clang cli crypt cryptsetup css cups curl daap dbus device-mapper dga dhclient dirac divx4linux dlloader dns dnssec dovecot-sasl dpms dri dri3 dts dv dvb dvd dvdr dvdread egl enca encode exif ext4 faac fame fat fbcondecor fbsplash ffmpeg fftw firefox flac fontconfig foomaticdb fortran freetype ftp fuse gaim gd gdbm geoip gif gimpprint glamor gles gles1 gles2 glib glibc-omitfp glitz glut gost gphoto2 graphite gsm gstreamer gstreamer10 gtk gtk2 gudev hardenedphp hbci howl howl-compat http2 https hwdb iconv icu idn imagemagick imap imlib innodb ipv6 java java5 javafx jbig jce joystick jpeg jpeg2k junit kdbus kdehiddenvisibility kvm lapack lcms libfame libglvnd libkms libnotify librtmp libtirpc libusb live llvm lm_sensors lvm lz4 lzma lzo mad maildir mdadm mdnsresponder-compat metalink mjpeg mmap mms mng motif mozilla mozsvg mp3 mpeg mpeg2 mplayer mpx multilib musepack mysql mythtv natspec ncurses nemesi network networkmanager nls nptl nptlonly ntfs nvme ocl-icd offensive ofx ogg oggvorbis openal opencl openexr opengl openmp openvg opus pam pango pcre pcre16 pcre32 pcsc-lite pdf pdflib perl pgo phonon pic pie png pnp policykit ppd ppds pulseaudio python quicktime quvi rar readline rtc rtmp schroedinger screensaver sctp sdl seccomp session sftp sharedmem shout smp sna sni sox speex spell split-usr sqlite srt ssh ssl steamruntime suspend2 svg systemd theora threads tiff tls transcode truetype truetype-fonts type-fonts udev udisks unicode unzip upnp ups usb user-session uxa v4l2 vaapi vcd videos virgl vorbis vpx vulkan wayland webdav webp webservices wifi win32codecs wmf wv x264 x265 xanim xattr xcb xcomposite xdg xinerama xml xml2 xpm xprint xrandr xv xvfb xvid xvmc zeroconf zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_core authz_core authn_socache cache_disk authn_alias authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex brotli cache dav dav_fs dav_lock dconf deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation remoteip rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest proxy proxy_ajp proxy_connect proxy_http proxy_fcgi reqtimeout cgi cgid unixd socache_shmcb proxy_html xml2enc" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="userspace" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access auth_basic autoindex brotli browser charset empty_gif fastcgi geo grpc gunzip gzip limit_conn limit_req map memcached mirror proxy referer rewrite scgi split_clients ssi upstream_hash upstream_ip_hash upstream_keepalive upstream_least_conn upstream_zone userid uwsgi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris amdgpu radeon radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Craig Andrews gentoo-dev 2020-11-24 15:01:23 UTC
Created attachment 674725 [details]
build.log.gz
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-11-24 17:49:05 UTC
can you try building without -Ctarget-cpu=native ?
Comment 3 Ionen Wolkens gentoo-dev 2020-11-24 17:51:39 UTC
I've ran into the same thing as well earlier and, as upstream bug mentions, removing -Ctarget-cpu=native (which resolves to skylake in my case), did fix it.

On another note, would be handy if emerge --info started showing RUSTFLAGS.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-11-24 18:04:51 UTC
yeah I wanted to extend emerge --info output like 2 years ago it was rejected due to rust being not that widespread.

But I think it's time to re-visit, since we've got librsvg and spidermonkey deps on rust and it's installed on a lot of user systems.
Comment 5 flippynelle 2020-11-30 14:37:49 UTC
Created attachment 675832 [details]
gdb stack dump (2 ways) - use xzless to read

Been hitting this while emerging =gnome-base/librsvg-2.48.9  with rust 1.48.0 and that -Ctarget-cpu=skylake because it happens in librsvg's glib 0.9.3

In other words:
1. cd /tmp
2. git clone https://github.com/gtk-rs/glib.git
3. cd glib
4. cargo build --release
   Compiling glib v0.9.3 (/tmp/glib)
error: could not compile `glib`

Caused by:
  process didn't exit successfully: `rustc --crate-name glib src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=2352bc1dd9715572 -C extra-filename=-2352bc1dd9715572 --out-dir /tmp/glib/target/release/deps -L dependency=/tmp/glib/target/release/deps --extern bitflags=/tmp/glib/target/release/deps/libbitflags-3481844fb16a27e3.rmeta --extern futures_channel=/tmp/glib/target/release/deps/libfutures_channel-acf2f595b567337f.rmeta --extern futures_core=/tmp/glib/target/release/deps/libfutures_core-5724616e089f1a94.rmeta --extern futures_executor=/tmp/glib/target/release/deps/libfutures_executor-1b129915820c5715.rmeta --extern futures_task=/tmp/glib/target/release/deps/libfutures_task-78c8234e64a1f90a.rmeta --extern futures_util=/tmp/glib/target/release/deps/libfutures_util-43653a78ce31e82b.rmeta --extern glib_sys=/tmp/glib/target/release/deps/libglib_sys-f51e12252d7c06a1.rmeta --extern gobject_sys=/tmp/glib/target/release/deps/libgobject_sys-8334a4d73fff92c1.rmeta --extern lazy_static=/tmp/glib/target/release/deps/liblazy_static-53201e5af8cd3135.rmeta --extern libc=/tmp/glib/target/release/deps/liblibc-b4a06f67ef62b8d1.rmeta -C target-cpu=skylake -Z treat-err-as-bug=5 -Z macro-backtrace` (signal: 11, SIGSEGV: invalid memory reference)


If I don't use "--release" then it's ok.
If I don't use "-C target-cpu=skylake" then it's ok too.
If I use "-C opt-level=0" or "-C opt-level=1" then it's ok. Fails with =2 or =3(default)

RUSTFLAGS="-C target-cpu=skylake -Z treat-err-as-bug=5 -Z macro-backtrace"

Is this rust or llvm at fault? does anyone know?

$ llc --version
LLVM (http://llvm.org/):
  LLVM version 11.0.0
  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake

  Registered Targets:
    amdgcn  - AMD GCN GPUs
    bpf     - BPF (host endian)
    bpfeb   - BPF (big endian)
    bpfel   - BPF (little endian)
    nvptx   - NVIDIA PTX 32-bit
    nvptx64 - NVIDIA PTX 64-bit
    r600    - AMD GPUs HD2XXX-HD6XXX
    x86     - 32-bit X86: Pentium-Pro and above
    x86-64  - 64-bit X86: EM64T and AMD64

$ rustv
rustc 1.48.0-nightly
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0
cargo 1.48.0-nightly
release: 1.48.0

Came from https://github.com/rust-lang/rust/issues/76213#issuecomment-733146725
Comment 6 flippynelle 2020-11-30 14:41:15 UTC
forgot one step:
3_1') git checkout 0.9.3

because it's not an issue that happens in master (0.10.0)
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-11-30 17:40:01 UTC
(In reply to flippynelle from comment #5)
> 
> If I don't use "--release" then it's ok.
> If I don't use "-C target-cpu=skylake" then it's ok too.
> If I use "-C opt-level=0" or "-C opt-level=1" then it's ok. Fails with =2 or
> =3(default)
> 

release profile usually enables optimizations and/or lto, it can explain why you see it.
if you don't pass --release, debug profile is used, which disables optimizations.
Comment 8 flippynelle 2020-12-01 06:27:37 UTC
Looks like they found it as an llvm bug:
https://bugs.llvm.org/show_bug.cgi?id=48340
via https://github.com/rust-lang/rust/issues/79564#issuecomment-736102763
Comment 9 Georgy Yakovlev archtester gentoo-dev 2020-12-18 04:36:22 UTC
upstream merged a revert

https://github.com/rust-lang/rust/commit/1954756aa53d03e59e40669eaa47a15d8497c352

I'll add it to 1.48.0 after some basic testing.
Comment 10 Ostashevskyi Viktor 2021-01-17 17:24:29 UTC
(In reply to Georgy Yakovlev from comment #9)
> upstream merged a revert
> 
> https://github.com/rust-lang/rust/commit/
> 1954756aa53d03e59e40669eaa47a15d8497c352
> 
> I'll add it to 1.48.0 after some basic testing.

Any success?
Comment 11 Ionen Wolkens gentoo-dev 2021-02-03 08:58:52 UTC
Patch didn't seem to work (for me) when I tried, not that I really took the time to look at this to be sure.

Using rust-1.49.0 (and system-llvm-11.0.1), rust-1.49.0 still fails to build itself with -Ctarget-cpu=skylake, and so does building librsvg.

Both are fine without defining target-cpu
Comment 12 Ionen Wolkens gentoo-dev 2021-02-18 15:51:03 UTC
May need more testing but can't reproduce anymore with rust-1.50.0.

Tried rust-bin-1.50.0 and rust-1.50.0[system-llvm] (11.1.0)

Reverted to rust-bin-1.49.0 to verify and it still segfaults building librsvg with -Ctarget-cpu=skylake.
Comment 13 Georgy Yakovlev archtester gentoo-dev 2021-03-02 17:49:36 UTC
(In reply to Ostashevskyi Viktor from comment #10)
> (In reply to Georgy Yakovlev from comment #9)
> > upstream merged a revert
> > 
> > https://github.com/rust-lang/rust/commit/
> > 1954756aa53d03e59e40669eaa47a15d8497c352
> > 
> > I'll add it to 1.48.0 after some basic testing.
> 
> Any success?

nope, it was still segfaulting so maybe the solution is elsewhere, I could not find it.
Comment 14 Larry the Git Cow gentoo-dev 2021-04-04 22:08:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70a3fbd29c2a3cfc4a831444d77cc25f155cc268

commit 70a3fbd29c2a3cfc4a831444d77cc25f155cc268
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-03 21:00:48 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-04 22:08:01 +0000

    profiles/info_pkgs: print rust{,-bin} versions
    
    Bug: https://bugs.gentoo.org/756340
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 profiles/info_pkgs | 2 ++
 1 file changed, 2 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=925d9532b80e6984d848fef0734b15f463a75d1d

commit 925d9532b80e6984d848fef0734b15f463a75d1d
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-03 20:58:12 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-04 22:08:01 +0000

    profiles/info_vars: print RUSTFLAGS as well
    
    Bug:  https://bugs.gentoo.org/756340
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 profiles/info_vars | 1 +
 1 file changed, 1 insertion(+)
Comment 15 immolo 2022-11-17 17:09:17 UTC
It seems starting with 1.65.0 this is back while using it as bootstrap to build on a machine without SSE2 while using the default RUSTFLAGS.

When using the commands:

1. git clone https://github.com/rust-lang/rust
2. cd rust
3. git checkout 1.65.0
4. git submodule update --init --recursive

It seems to force to build itself in debug mode as setting:

[rust]
channel = "stable"

in config.toml no longer seems to work.


I'll test reducing the optimisations on the target machine to see if it has any success once set.