wasm target for rust don't have profiling support. Reproducible: Always Actual Results: Compiling std v0.0.0 (/var/tmp/portage/dev-lang/rust-1.61.0-r1/work/rustc-1.61.0-src/library/std) Running `/var/tmp/portage/dev-lang/rust-1.61.0-r1/work/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage2-std/release/build/std-97b99a5b273e2bc8/build-script-build` [std 0.0.0] cargo:rerun-if-changed=build.rs [std 0.0.0] cargo:rustc-env=STD_ENV_ARCH=wasm32 [std 0.0.0] cargo:rustc-cfg=backtrace_in_libstd [profiler_builtins 0.0.0] cargo:warning=../../src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c:24:10: fatal error: 'errno.h' file not found [profiler_builtins 0.0.0] cargo:warning=#include <errno.h> [profiler_builtins 0.0.0] cargo:warning= ^~~~~~~~~ [profiler_builtins 0.0.0] cargo:warning=1 error generated. [profiler_builtins 0.0.0] [profiler_builtins 0.0.0] [profiler_builtins 0.0.0] error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-march=native" "-pipe" "-fpic" "-fdebug-prefix-map=/var/tmp/portage/dev-lang/rust-1.61.0-r1/work/rustc-1.61.0-src=/rustc/1.61.0" "-I" "../../src/llvm-project/compiler-rt/include" "-fno-builtin" "-fomit-frame-pointer" "-fvisibility=hidden" "-DVISIBILITY_HIDDEN" "-DCOMPILER_RT_HAS_UNAME=1" "-DCOMPILER_RT_HAS_ATOMICS=1" "-o" "/var/tmp/portage/dev-lang/rust-1.61.0-r1/work/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/build/profiler_builtins-85269b7a47de25ac/out/../../src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.o" "-c" "../../src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c" with args "clang" did not execute successfully (status code exit status: 1). [profiler_builtins 0.0.0] [profiler_builtins 0.0.0] The following warnings were emitted during compilation: warning: ../../src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c:24:10: fatal error: 'errno.h' file not found [profiler_builtins 0.0.0] exit status: 1 warning: #include <errno.h> warning: ^~~~~~~~~ warning: 1 error generated. error: failed to run custom build command for `profiler_builtins v0.0.0 (/var/tmp/portage/dev-lang/rust-1.61.0-r1/work/rustc-1.61.0-src/library/profiler_builtins)` $ emerge --info rust Portage 3.0.30 (python 3.9.12-final-0, default/linux/amd64/17.1/systemd, gcc-11.2.1, glibc-2.34-r13, 5.17.11-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.17.11-gentoo-x86_64-Intel-R-_Core-TM-_i7-7500U_CPU_@_2.70GHz-with-glibc2.34 KiB Mem: 16117544 total, 293004 free KiB Swap: 23068664 total, 22106104 free Timestamp of repository gentoo: Sun, 29 May 2022 20:33:20 +0000 Head commit of repository gentoo: a908100f6da98c02233746973809fe175a4c83fd sh bash 5.1_p16 ld GNU ld (Gentoo 2.37_p1 p2) 2.37 app-misc/pax-utils: 1.3.3::gentoo app-shells/bash: 5.1_p16::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.34.0-r9::gentoo dev-lang/python: 3.9.12::gentoo, 3.10.4_p1::gentoo dev-lang/rust: 1.61.0-r1::gentoo dev-util/cmake: 3.22.4::gentoo dev-util/meson: 0.61.4-r2::gentoo sys-apps/baselayout: 2.8::gentoo sys-apps/sandbox: 2.29::gentoo sys-apps/systemd: 250.4-r2::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.71-r1::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.37_p1-r2::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 14.0.4::gentoo sys-devel/gcc: 11.2.1_p20220115::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/lld: 14.0.4::gentoo sys-devel/llvm: 14.0.4::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.16::gentoo (virtual/os-headers) sys-libs/glibc: 2.34-r13::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo priority: -1000 sync-git-verify-commit-signature: yes ml-local-overlay location: /usr/local/portage masters: gentoo Installed sets: @steam ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fpic" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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="-march=native -O2 -pipe -fpic" DISTDIR="/var/distfiles" 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="-march=native -O2 -pipe -fpic" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict suidctl unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe -fpic" GENTOO_MIRRORS="https://mirror.yandex.ru/gentoo-distfiles/" LANG="ru_RU.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="ru en" 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="10bit 256-color X a52 aac accessibility acl acpi ads aio alsa alt-svc amd64 amr amrenc ap apng avif base bash-completion berkdb blink bluetooth bluray bpf brotli bzip2 bzlib cairo caps cdb celt cgroups clang cleartype cli conntrack corefonts crt crypt cryptsetup css cue cups curl daemon dav1d dbus dcc_video declarative default-lld devil dga dirac distinct-l djvu dns-over-tls dri drm dtmf dv dvb dvd dvdr dvdread eap-tls egl elfutils enca encode epoll epub evdev exceptions exif faac faad farstream fbcon ffmpeg fftw fido2 firebird flac fontconfig frei0r ftp fts3 g3dvl gbm gdbm gles gles1 gles2 gmp gnome googledrive gost graphite gsm gui h224 h281 h323 haptic hardened harfbuzz hdri heif http http2 hwaccel icccm icecast iceweasel iconv icu idn ilbc importd inotify inspector introspection iproute2 ipv6 jabber java jpeg jpeg2k json jumbo-build kbd kde kdenlive kdexdeltas kdrive lame large-stack lcms leaps-timezone libcxx libdrm libglvnd libkms libtirpc lm-sensors localstorage lspclient lto lvm lyrics lz4 lzma lzo mad mdnsresponder-compat melt minizip mmap mmx mng mod modemmanager modern-top modplug mount mozdevelop mp3 mtp multilib multitarget musepack nat natspec ncurses netlink network networkmanager newnet nftables nightly nls nptl nptlonly nsplugin nss nvidia ogg openal opencl openconnect openexr opengl openmp openssl opus otf otr pam parallel-compiler pcre pcre16 pcre32 pic pipewire pipewire-alsa pkcs11 png policykit postgres postproc printsupport private-headers proprietary-codecs pulseaudio python qml qos qrcode qt5 quiche rav1e raw readline realtime redland rfc3779 rls rtmp ru-dv ru-i ru-k rust-src sbc schroedinger screencast scripttools sctp sdl sdl2 seccomp secure-delete security-key semantic-desktop sensors sieve sip sipim smp soap speex split-usr sql sqlite srtp sse sse2 sse3 ssl ssse3 staging static-pie svc svg svt-av1 system-bootstrap system-cairo system-cxx-headers system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-llvm system-png system-sqlite systemd taglib tdls telemetry text tftp theora threads threadsafe thunderbolt tiff tray truetype twolame type1 udev uncommon-eap-types unicode unicode3 unlock-notify urandom usb user-session uvm v4l v4l2 vaapi video vorbis vpx vtv vulcan vulkan wasm wav wayland webchannel webkit webp webui widgets win32codecs wma x264 x265 xattr xcb xephyr xfs xft xinerama xkb xml xmlrpc xmp xscreensaver xtables xulrunner xv xvfb xvid xxhash z3 zeroconf zic-slim zink zlib zram zrtp zstd" ABI_X86="64" 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" CPU_FLAGS_X86="mmx mmxext sse sse2 sse4_1 sse4_2 sse3 ssse3 aes avx avx2 f16c" 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" INPUT_DEVICES="libinput evdev" KERNEL="linux" L10N="ru en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="scripting-javascript wiki-publisher" LLVM_TARGETS="AMDGPU BPF NVPTX X86 AArch64 ARM Hexagon Lanai MSP430 Mips PowerPC Sparc SystemZ XCore RISCV WebAssembly ARC AVR" 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_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby30" USERLAND="GNU" VIDEO_CARDS="i965 intel iris nvidia v4l" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, 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 ================================================================= Package Settings ================================================================= dev-lang/rust-1.61.0-r1::gentoo was built with the following: USE="clippy miri nightly rls rust-src rustfmt system-bootstrap system-llvm wasm -debug -dist -doc (-parallel-compiler) -profiler -test -verify-sig" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="AArch64 AMDGPU ARM AVR BPF Hexagon Lanai MSP430 Mips NVPTX PowerPC RISCV Sparc SystemZ WebAssembly (X86) XCore" FEATURES="binpkg-docompress usersync unmerge-orphans ipc-sandbox merge-sync fixlafiles userfetch multilib-strict xattr userpriv unknown-features-warn pid-sandbox sfperms unmerge-logs sandbox assume-digests binpkg-dostrip ebuild-locks suidctl usersandbox parallel-fetch preserve-libs binpkg-logs buildpkg-live news protect-owned qa-unresolved-soname-deps network-sandbox strict distlocks config-protect-if-modified"
https://github.com/rust-lang/rust/issues/81684
I can try moving profiler to host-specific target and not general build section. Will check it, thanks for reporting.
or I can just always disable profiler in wasm one. trying that one.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbb59a8a651ae791d652f3ccb47168713b9f3b72 commit fbb59a8a651ae791d652f3ccb47168713b9f3b72 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-05-31 22:03:38 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-06-01 03:11:10 +0000 dev-lang/rust: don't enable profiler for wasm targets Issue: https://github.com/rust-lang/rust/issues/81684 Closes: https://bugs.gentoo.org/848483 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-lang/rust/rust-1.60.0.ebuild | 2 ++ dev-lang/rust/rust-1.61.0-r1.ebuild | 2 ++ 2 files changed, 4 insertions(+)