Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 734018 - dev-lang/rust: compile error when CFLAGS_x86 is set to multiple arguments
Summary: dev-lang/rust: compile error when CFLAGS_x86 is set to multiple arguments
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
Keywords: PullRequest
Depends on:
Reported: 2020-07-27 03:19 UTC by Matthew Dawson
Modified: 2020-10-18 23:48 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Dawson 2020-07-27 03:19:00 UTC
I've set CFLAGS_x86 to contain -mstackrealign to avoid crashes in various proprietary applications due to stack alignment issues with recent GCCs.  When compiling any version of rust, the command to load in config.env fails with the following error message:

env: ‘-pipe’: No such file or directory

I've got a local patch I apply to rust ebuilds to avoid this which sets IFS to \n (I'm posting a PR to github as well).

Reproducible: Always

Steps to Reproduce:
1. Set CFLAGS_x86 to "${CFLAGS_x86} -pipe -mstackrealign"
2. Compile any rust ebuild
Actual Results:  
The following error appears:

>>> Compiling source in /var/tmp/portage/dev-lang/rust-1.44.1/work/rustc-1.44.1-src ...
env: ‘-pipe’: No such file or directory
 * ERROR: dev-lang/rust-1.44.1::gentoo failed (compile phase):
 *   (no error message)
 * Call stack:
 *, line 125:  Called src_compile
 *   environment, line 3603:  Called die
 * The specific snippet of code:
 *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./ build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
 * If you need support, post the output of `emerge --info '=dev-lang/rust-1.44.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.44.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/rust-1.44.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.44.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/rust-1.44.1/work/rustc-1.44.1-src'
 * S: '/var/tmp/portage/dev-lang/rust-1.44.1/work/rustc-1.44.1-src'

Expected Results:  
Compiled successfully.

Portage 2.3.103 (python 3.6.10-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-9.3.0, glibc-2.30-r8, 5.6.13-gentoo x86_64)
System uname: Linux-5.6.13-gentoo-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-gentoo-2.6
KiB Mem:    32833672 total,  19933044 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Mon, 27 Jul 2020 02:35:21 +0000
Head commit of repository gentoo: e583c7e4e62de00ce51d1dbb9493daf41f7f9204

sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
distcc 3.3.3 x86_64-pc-linux-gnu [enabled]
ccache version 3.7.7 [disabled]
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/ccache:          3.7.7-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo

    location: /usr/portage
    sync-type: git
    priority: -1000

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

    location: /var/lib/layman/flatpak-overlay
    sync-type: laymansync
    masters: gentoo
    priority: 50

    location: /var/lib/layman/hasufell
    sync-type: laymansync
    masters: gentoo
    priority: 50

    location: /var/lib/layman/kde
    sync-type: laymansync
    masters: gentoo
    priority: 50

    location: /var/lib/layman/qt
    sync-type: laymansync
    masters: gentoo
    priority: 50

    location: /var/lib/layman/sabayon
    sync-type: laymansync
    sync-uri: git://
    masters: gentoo
    priority: 50

Installed sets: @kde-plasma
ACCEPT_LICENSE="@FREE google-chrome Google-TOS GIMPS creduce"
CFLAGS="-O3 -march=skylake -mcx16 -mfxsr -mlzcnt -mmovbe -madx -mxsaveopt -mxsave --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -ggdb3 -fno-omit-frame-pointer"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf /usr/share/themes/oxygen-gtk/gtk-2.0"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -march=skylake -mcx16 -mfxsr -mlzcnt -mmovbe -madx -mxsaveopt -mxsave --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -ggdb3 -fno-omit-frame-pointer"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs compressdebug config-protect-if-modified distcc distlocks ebuild-locks fixlafiles installsources ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j100 -l24"
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"
USE="7zip X a52 aac acl acpi activities aio alsa amd64 ap apng arping aspell attica autoipd avahi bash-completion bcrypt berkdb bittorrent bluetooth branding brightness-control btrfs bzip2 cairo canberra caps cdda cdr cgi chromecast cilk clang cli client clippy clucene codec2 color-management colorio conch connection-sharing conntrack crypt cryptsetup cups curl dav1d dbus declarative designer device-mapper dhcp dictionary dnssec dolphin dot dpi dri dri3 drm dts dvd dvdr ebook editorconfig egl elf emboss emoji encode epoll epub equalizer eselect-ldso evdev exif expat extra faac fam farstream faudio ffmpeg fftw firmware flac fontconfig fontforge fortran fpm g3dvl gbm gd gdbm geckodriver gentoo-vm gif git gles gles1 gles2 glew gmp gold gpg gpm grub gstreamer gtk gtk3 gtkstyle gudev haptic http http2 hwaccel hwdb iconv icu imagemagick infinality inotify int-quality iproute2 ipv6 jack jingle jit jpeg jpeg2k json junction kde kde4 kde4_compat kdepim kdrive keymap kipi kms kolab kwallet lame latex layers lcms legacy-systray libav-aac libdrm libffi libinput libkms libnotify libproxy libsamplerate libtar libtirpc libv4l llvm lm-sensors lm_sensors localstorage lto lv2 lvm lyx lzma lzo mad markdown matroska mdnsresponder-compat minizip mmx mmxext mng modemmanager modern-top mp3 mp4 mpeg mplayer mpris msn mtp multilib multimedia musicbrainz mysql mysqli mysqlnd natspec ncurses netlink network network-cron networkmanager nfs nfsidmap nls nptl nss numpy oauth ocl-icd ocl20 ofa ogg okteta openal opencl opengl opengtl openmax openmp openssl optimized-qmake otr p2p pam pango parted pcntl pcre pcre16 pdf pdo pgo phonon php pic pim pkcs11 plasma plasma5 plotutils plymouth png policykit postgres postproc ppds printsupport prison privsep projectm pulseaudio pyqt4 python qalculate qemu qml qt3support qt4 qt5 quad rdesktop readline realtime resolvconf reviewboard right_timezone samba sasl scanner screencast script scripttools sctp sdk sdl sdl-image sdl2 seccomp secure-delete semantic-desktop skins slang smartcard smp snappy sndfile sound speech spell split-usr sql sqlite sqlite3 sse sse2 sse3 ssh ssl startup-notification subversion svc svg svg2 symlink sync-plugin-portage syslog system-bootstrap system-cairo system-harfbuzz system-icu system-jpeg system-jsoncpp system-libevent system-libvpx system-llvm system-snappy system-sqlite systemd sysv-utils taglib tbb tcpd telepathy theora threads thumbnail thunderbolt tiff touchpad truetype twolame udev udisks unicode unwind upnp upower usb usbredir user-session utils v4l vaapi valgrind vdpau vhost-user-fs video vidstab virt-network vkd3d vlc vnc vorbis vpx vulkan wasm wayland wayland-compositor webinterface webkit webp widgets wifi winbind woff2 wps wxwidgets x264 x265 xa xattr xcb xcomposite xephyr xetex xine xinerama xkb xml xmlreader xmlwriter xorg xv xvfb xvid xvmc xwayland xxhash yubikey zeroconf zip zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="author braindump flow karbon kexi krita sheets stage words plan" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="evdev synaptics libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 BPF WebAssembly" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="intel i965" 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"
Comment 1 Matthew Dawson 2020-07-27 03:20:59 UTC
Pull request:
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-07-27 16:35:11 UTC
thanks for reporting.

I think we should get rid of env/cat thing completely. Not sure why it was done the way it is now.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2020-07-31 09:21:47 UTC
ok, the env trick was done because variables contain dashes.. to it's impossible to just export them.

I will fix it a bit later. I don't like IFS solution and env solution.
Comment 4 Larry the Git Cow gentoo-dev 2020-07-31 09:22:11 UTC
The bug has been referenced in the following commit(s):

commit 0c6ec743ace5257046552f4d1745bbf46f2ed73c
Author:     Georgy Yakovlev <>
AuthorDate: 2020-07-31 08:01:57 +0000
Commit:     Georgy Yakovlev <>
CommitDate: 2020-07-31 09:20:33 +0000

    dev-lang/rust: bump to 1.45.1
    Package-Manager: Portage-3.0.1, Repoman-2.3.23
    Signed-off-by: Georgy Yakovlev <>

 dev-lang/rust/Manifest           |   1 +
 dev-lang/rust/rust-1.45.1.ebuild | 504 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 505 insertions(+)
Comment 5 tt_1 2020-07-31 09:27:07 UTC
this bug has nothing to do with the ebuilds filtering out -mcpu -march and -mtune, doesn't it?
Comment 6 Georgy Yakovlev archtester gentoo-dev 2020-07-31 09:30:12 UTC
(In reply to tt_1 from comment #5)
> this bug has nothing to do with the ebuilds filtering out -mcpu -march and
> -mtune, doesn't it?

no, not at all.

cross support filters out cpu specific flags. it needs to be smarter.
Comment 7 Larry the Git Cow gentoo-dev 2020-10-09 06:24:04 UTC
The bug has been referenced in the following commit(s):

commit 51563211f1ddc9662e89cad5c1a2495fcdf9f117
Author:     Georgy Yakovlev <>
AuthorDate: 2020-10-08 19:32:12 +0000
Commit:     Georgy Yakovlev <>
CommitDate: 2020-10-09 06:23:05 +0000

    dev-lang/rust: bump to 1.47.0
    we now install to /usr/lib/rust/<ver>
    this is more robust and mirrors how
    rustup installs rust, also most slotted
    toolchain projects already to it, so we follow
    Package-Manager: Portage-3.0.8, Repoman-3.0.1
    Signed-off-by: Georgy Yakovlev <>

 dev-lang/rust/Manifest                             |  15 +
 ...46.0-don-t-create-prefix-at-time-of-check.patch |  31 ++
 ....0-ignore-broken-and-non-applicable-tests.patch |  75 +++
 dev-lang/rust/files/gentoo-musl-target-specs.patch | 168 ++++++
 dev-lang/rust/rust-1.47.0.ebuild                   | 582 +++++++++++++++++++++
 5 files changed, 871 insertions(+)
Comment 8 Georgy Yakovlev archtester gentoo-dev 2020-10-09 06:59:02 UTC
I've added IFS in a subshell, can you test rust-1.47.0 ?
Comment 9 Matthew Dawson 2020-10-18 23:05:51 UTC
(In reply to Georgy Yakovlev from comment #8)
> I've added IFS in a subshell, can you test rust-1.47.0 ?

I've test compiled rust-1.47, and it worked.  I didn't merge it as I needed to keep 1.46 to compile firefox.
Comment 10 Georgy Yakovlev archtester gentoo-dev 2020-10-18 23:34:51 UTC
thanks for testing!
firefox (at least latest) should compile fine now with 1.47.0, we have patches.

but anyway, I do not recommend using 1.47.0 yet, revbumps with more fixes coming soon.
so hold on to 1.46 for now.

I will backport env fixes to stable versions.
Comment 11 Georgy Yakovlev archtester gentoo-dev 2020-10-18 23:35:32 UTC
and sorry for taking so long, I lost track of the bug.
Comment 12 Matthew Dawson 2020-10-18 23:48:56 UTC
(In reply to Georgy Yakovlev from comment #11)
> and sorry for taking so long, I lost track of the bug.

np, thanks for fixing it!