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

Bug 935702

Summary: dev-dotnet/dotnet-sdk-8.0.105: fails to build: error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false.
Product: Gentoo Linux Reporter: Edgar Chalico <edgar1569>
Component: Current packagesAssignee: dotnet project <dotnet>
Status: IN_PROGRESS ---    
Severity: normal CC: edgar1569, leohdz172, xgqt
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log
build log

Description Edgar Chalico 2024-07-07 06:47:56 UTC
I had this error since dev-dotnet/dotnet-sdk-8.0.102 and I can't compile it. The last version that I can compile successfully is dev-dotnet/dotnet-sdk-8.0.101.

Reproducible: Always

Steps to Reproduce:
1. Try to install dotnet-sdk with emerge dev-dotnet/dotnet-sdk
Actual Results:  
Build failed due to error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false.

Expected Results:  
Compiled and installed dotnet-sdk.

Emerge info:
Portage 3.0.63 (python 3.12.3-final-0, default/linux/amd64/23.0/desktop/systemd, gcc-13, glibc-2.39-r6, 6.8.9-zen1-x86_64 x86_64)
=================================================================
System uname: Linux-6.8.9-zen1-x86_64-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-glibc2.39
KiB Mem:    32777728 total,    605760 free
KiB Swap:   16777212 total,  16421884 free
Timestamp of repository gentoo: Sat, 06 Jul 2024 04:00:00 +0000
Head commit of repository gentoo: 0114511477c2c09faa967081345798482f041eea
Timestamp of repository 4nykey: Fri, 05 Jul 2024 21:07:00 +0000
Head commit of repository 4nykey: b2474591730d38a803e335c8adc319fe64a23da8

Timestamp of repository HomeAssistantRepository: Fri, 05 Jul 2024 21:07:28 +0000
Head commit of repository HomeAssistantRepository: 451c9d848355878274da1fd49493bf5408327682

Timestamp of repository edgets: Fri, 05 Jul 2024 21:07:08 +0000
Head commit of repository edgets: 90500ae5820ab10014efc2b82d293d6375584736

Timestamp of repository gentoo-zh: Fri, 05 Jul 2024 21:06:47 +0000
Head commit of repository gentoo-zh: 5c6d2d0961bacfd848186e8be17422dd8c9c0d25

Timestamp of repository guru: Fri, 05 Jul 2024 21:07:06 +0000
Head commit of repository guru: d13b66aff1354e1273deec0c874dc8ac8e0c0562

Timestamp of repository konsolebox: Fri, 05 Jul 2024 21:07:00 +0000
Head commit of repository konsolebox: 26eed7bfd4a72f1377101566d4e4da72b616fe01

Timestamp of repository supertux88: Fri, 05 Jul 2024 21:07:23 +0000
Head commit of repository supertux88: 5745b74f3dea4c51627db82c12e2387ecfda7f13

sh bash 5.2_p26-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r6::gentoo
dev-build/autoconf:        2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.5::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r3::gentoo
dev-lang/python:           3.11.9-r1::gentoo, 3.12.3-r1::gentoo
dev-lang/rust-bin:         1.77.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.7-r1::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20240210::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1

4nykey
    location: /var/db/repos/4nykey
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/4nykey.git
    masters: gentoo
    volatile: False

HomeAssistantRepository
    location: /var/db/repos/HomeAssistantRepository
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/HomeAssistantRepository.git
    masters: gentoo
    volatile: False

edgets
    location: /var/db/repos/edgets
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/edgets.git
    masters: gentoo
    volatile: False

gentoo-zh
    location: /var/db/repos/gentoo-zh
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo-zh.git
    masters: gentoo
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

konsolebox
    location: /var/db/repos/konsolebox
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/konsolebox.git
    masters: gentoo
    volatile: False

overlay
    location: /usr/local/portage/overlay
    masters: gentoo
    priority: 0
    volatile: True

supertux88
    location: /var/db/repos/supertux88
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/supertux88.git
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE @EULA"
AR="llvm-ar"
CBUILD="x86_64-pc-linux-gnu"
CC="/usr/lib/llvm/17/bin/clang"
CFLAGS="-O2 -pipe -march=znver2 -O2 -pipe -flto=thin -Werror=odr -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CPP="clang-cpp"
CXX="/usr/lib/llvm/17/bin/clang++"
CXXFLAGS="-O2 -pipe -march=znver2 -O2 -pipe -flto=thin -Werror=odr -Werror=strict-aliasing -stdlib=libstdc++"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-march=znver2 -O2 -pipe -flto=thin -Werror=odr -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver2 -O2 -pipe -flto=thin -Werror=odr -Werror=strict-aliasing"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/     ftp://tux.rainside.sk/gentoo/"
LANG="en_US.utf8"
LD="ld.lld"
LDFLAGS="-stdlib=libstdc++ -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-O2 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j16 -l16"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
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"
RANLIB="llvm-ranlib"
SHELL="/bin/zsh"
STRIP="llvm-strip"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet clang crypt cuda cups dbus default-compiler-rt default-lld dri dts dvd dvdr encode exif flac gdbm gif glib gpm gtk gui iconv icu ipv6 jack jpeg kf6compat lcms libnotify libtirpc llvm llvm-libunwind lm-sensors lto mad mng mp3 mp4 mpeg mtp multilib ncurses nls nvenc nvidia ogg opengl openmp pam pango pcre pdf pipewire png policykit ppds qt5 readline sdl seccomp sound spell ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb v4l vdpau vorbis vulkan wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_12 python3_11" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, READELF, RUSTFLAGS, SIZE, STRINGS, YACC, YFLAGS
Comment 1 Edgar Chalico 2024-07-07 06:52:57 UTC
Created attachment 897252 [details]
build log

I needed to compress the build.log file because it is too long.
Comment 2 Maciej Barć gentoo-dev 2024-07-08 20:59:46 UTC
> /var/tmp/portage/dev-dotnet/dotnet-sdk-8.0.105/work/dotnet-sdk-8.0.5/.dotnet/sdk/8.0.104/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(470,5): error MSB6006: "/var/tmp/portage/dev-dotnet/dotnet-sdk-8.0.105/work/dotnet-sdk-8.0.5/src/runtime/artifacts/source-build/self/package-cache/microsoft.netcore.app.crossgen2.linux-x64/8.0.4/tools/crossgen2" exited with code 139. [/var/tmp/portage/dev-dotnet/dotnet-sdk-8.0.105/work/dotnet-sdk-8.0.5/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]
> /var/tmp/portage/dev-dotnet/dotnet-sdk-8.0.105/work/dotnet-sdk-8.0.5/.dotnet/sdk/8.0.104/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(358,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [/var/tmp/portage/dev-dotnet/dotnet-sdk-8.0.105/work/dotnet-sdk-8.0.5/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]

Looks like crossgen2 sefaults. Please rebuild with CFLAGS="-O2 -pipe -march=znver2".

Your CFLAGS are, as you wrote:

> CXXFLAGS="-O2 -pipe -march=znver2 -O2 -pipe -flto=thin -Werror=odr -Werror=strict-aliasing -stdlib=libstdc++"
Comment 3 Edgar Chalico 2024-07-08 22:22:39 UTC
Created attachment 897348 [details]
build log

Still having the same issue using
CXXFLAGS="-march=znver2 -O2 -pipe"


Also, on the last version that I could compile successfully (8.0.101) I used this flags:

> cat /var/db/pkg/dev-dotnet/dotnet-sdk-8.0.101/LDFLAGS
-stdlib=libstdc++ -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-O2 -Wl,--as-needed
> cat /var/db/pkg/dev-dotnet/dotnet-sdk-8.0.101/CXXFLAGS
-O2 -pipe -march=znver2 -O2 -pipe -stdlib=libstdc++
> cat /var/db/pkg/dev-dotnet/dotnet-sdk-8.0.101/CFLAGS
-O2 -pipe -march=znver2 -O2 -pipe
Comment 4 Maciej Barć gentoo-dev 2024-07-08 22:34:04 UTC
Its definitely a issue related to what CC+LD and what FLAGS you use for compiling this package. I'd recommend going back to the profile defaults and working your way up from there trying to replace GCC toolchain with CLANG+LLD.