Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945377 - media-gfx/blender-4.2.1: build failure, SIGILL in makesdna
Summary: media-gfx/blender-4.2.1: build failure, SIGILL in makesdna
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Paul Zander
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-29 18:45 UTC by JohnLM
Modified: 2025-02-21 14:29 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,69.49 KB, text/x-log)
2024-11-30 10:06 UTC, JohnLM
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JohnLM 2024-11-29 18:45:17 UTC
Tried building Blender 4.2.1. With multiple tries the build invariably failed at

[23/5395] cd /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern && /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/bin/makesdna /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_type_offsets.h /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_verify.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/makesdna/
FAILED: source/blender/makesdna/intern/dna.c source/blender/makesdna/intern/dna_type_offsets.h source/blender/makesdna/intern/dna_verify.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_type_offsets.h /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_verify.c 
cd /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern && /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/bin/makesdna /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_type_offsets.h /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern/dna_verify.c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/makesdna/
ninja: build stopped: subcommand failed.

The build log completely fails to mention why, but eventually I found in syslog/journal that the makesdna executable has coredumped on SIGILL. Odd!

I disassembled the crashing piece from the coredump, and:

Dump of assembler code for function DNA_alias_maps:
   0x0000558ac10f9024 <+100>:	mov    $0x5,%esi
   0x0000558ac10f9029 <+105>:	sete   %r13b
=> 0x0000558ac10f902d <+109>:	pinsrq $0x1,%rax,%xmm0
   0x0000558ac10f9034 <+116>:	lea    0xdff6(%rip),%rax        # 0x558ac1107031

PINSRQ? Quick googling told me that it's a SSE4.1 instruction. Erm, my machine doesn't have SSE4.1 (which clearly explains the SIGILL). But why?

Just a little higher in the build log I see the makesdna being built:

[8/5395] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_EXECINFO_H -DHAVE_MALLOC_STATS_H -DNDEBUG -DWITH_ASSERT_ABORT -DWITH_DNA_GHASH -DWITH_FREESTYLE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__LITTLE_ENDIAN__ -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/makesdna -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/source/blender/makesdna/intern -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/blenlib -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/imbuf -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/intern/atomic/. -I/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/intern/guardedalloc  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe -march=x86-64-v2 -fopenmp -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/"="" -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/"="" -Wno-maybe-uninitialized  -std=c++17 -MD -MT source/blender/makesdna/intern/CMakeFiles/makesdna.dir/makesdna.cc.o -MF source/blender/makesdna/intern/CMakeFiles/makesdna.dir/makesdna.cc.o.d -o source/blender/makesdna/intern/CMakeFiles/makesdna.dir/makesdna.cc.o -c /var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/source/blender/makesdna/intern/makesdna.cc

It gets -march=barcelona _and_ -march=x86-64-v2 ??? I reckon the latter took effect and compiled the binary with instructions that AMD Phenom does not support. So, an alternative bug title could be "Blender build disrespects my CFLAGS".

Reproducible: Always

Steps to Reproduce:
1. emerge -v blender:4.2
* on this machine :)

Actual Results:  
Build fails with SIGILL running a tool (makesdna) built earlier in same build process.

Expected Results:  
Build succeeds.

# emerge --info
Portage 3.0.66.1 (python 3.12.7-final-0, default/linux/amd64/23.0/systemd, gcc-14, glibc-2.40-r5, 6.6.62-gentoo x86_64)
=================================================================
System uname: Linux-6.6.62-gentoo-x86_64-AMD_Phenom-tm-_9950_Quad-Core_Processor-with-glibc2.40
KiB Mem:     8147132 total,   3369216 free
KiB Swap:    4194300 total,   3961596 free
Timestamp of repository gentoo: Thu, 28 Nov 2024 18:15:00 +0000
Head commit of repository gentoo: 3daea3ee4c39c8111f36c8343307824e78fa2b9d
Head commit of repository esteid: 8d0d789bb69d9ff08fad5aa62a9423613f1d3f63

Head commit of repository java: 60411eb30ee9d8214b0720a8be05a9dddaa44f80

Head commit of repository mv: 3172c70c07792e8389f2d5e1798528907b933937

Head commit of repository johnlm-overlay: cecab00a112a35439fec6b72ac66699c63eda71e

sh bash 5.2_p37
ld GNU ld (Gentoo 2.42 p6) 2.42.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.5::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.5.2::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           2.7.18_p16-r2::gentoo, 3.12.7_p1::gentoo, 3.13.0::gentoo
dev-lang/rust:             1.81.0-r100::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          256.7::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           18.1.8::gentoo
sys-devel/gcc:             13.3.1_p20241115::gentoo, 14.2.1_p20241116::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.8::gentoo
sys-devel/llvm:            18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r5::gentoo
Repositories:

cross-portage
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10
    volatile: True

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: 25
    volatile: True
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1

esteid
    location: /var/lib/layman/esteid
    sync-type: git
    sync-uri: https://github.com/open-eid/gentoo.git
    masters: gentoo
    priority: 50
    volatile: True

java
    location: /var/lib/layman/java
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/java.git
    masters: gentoo
    priority: 50
    volatile: True

mv
    location: /var/lib/layman/mv
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50
    volatile: True

johnlm-overlay
    location: /var/lib/layman/johnlm-overlay
    sync-type: git
    sync-uri: file:///home/johnlm/src/johnlm-overlay.git
    masters: gentoo
    priority: 60
    volatile: True

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

Installed sets: @archivers, @major-bdeps
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /var/bind"
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/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe"
DISTDIR="/mnt/megadisk/system/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=n --verbose-conflicts"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news noinfo nostrip 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="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="en en_GB lv"
MAKEOPTS="-j4"
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="3dnow 3dnowext X a52 acl acpi amd64 bash-completion branding bzip2 cairo cet crypt css dbus dri dts evdev exif ffmpeg flac fontconfig g3dvl gallium gdbm gmp gnome gnome-keyring gstreamer gtk gtk3 gtkstyle gzip iconv jpeg kpathsea libnotify libtirpc mad matroska mmx mmxext mp3 multilib ncurses nls ogg openexr opengl openmp opus oss oss4 pam pcre png policykit qt3support readline seccomp smp sndfile sse sse2 sse3 sse4a ssl svg systemd test-rust threads tiff truetype udev unicode vdpau vorbis x264 xa xattr xcb xcomposite xinerama xml xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gcc_13" 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" CAMERAS="ptp2 kodak_ez200" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0 2-2" GUILE_TARGETS="3-0" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en-GB lv" 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="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="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, 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, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 JohnLM 2024-11-30 10:06:37 UTC
Created attachment 912849 [details]
build.log
Comment 2 Sebastian Parborg 2024-12-03 11:21:32 UTC
Upstream bumped the minimum CPU requirement to a cpu with at least sse4.2 at the start to this year:
https://www.blender.org/download/requirements/

Seems like they added the march compile flags here:
https://www.blender.org/download/requirements/

This is tied to the "WITH_CPU_SIMD" flag. However when looking into this, it also turns out that cycles now actually seem to require sse4.2. The older sse cycles kernels were removed here:
https://projects.blender.org/blender/blender/commit/2b095c97fad129683e60bb1ec0d3a6fdefdd38af

I don't have any CPUs to test this with but could you try to build "WITH_CPU_SIMD=OFF" and "WITH_CYCLES_NATIVE_ONLY=ON" ?

Try to render something with cycles and see if it crashes. From what I can tell it will always build the sse4.2 kernels if you are on a x86 CPU. But the question is if it still has a fallback kernel without those instructions.

Note thought that some of the cycles library dependencies (openpgl) not requires sse4.2 as well.

@Paul, I guess we should add a sse4.2 requirement to the build and then patch out the march=x86-64-v2 code.
Comment 3 Sebastian Parborg 2024-12-03 11:22:50 UTC
Wrong link to the march commit...
https://projects.blender.org/blender/blender/commit/8b9743eb407fb1a5c09041b9ca39cf59cc3ce6b3
Comment 4 JohnLM 2024-12-03 22:25:08 UTC
> This is tied to the "WITH_CPU_SIMD" flag. However when looking into this, it also turns out that cycles now actually seem to require sse4.2. [...]

Thanks! Yeah, Blender dropping SSE2 Cycles kernel upstream might be a showstopper for me. Sigh!

I modified the ebuild with

@@ -389,6 +389,9 @@
 		-DWITH_USD="no" # TODO: Package USD
 		-DWITH_VULKAN_BACKEND="$(usex vulkan)"
 		-DWITH_XR_OPENXR=no
+		## Testing bug #945377
+		-DWITH_CPU_SIMD=OFF
+		-DWITH_CYCLES_NATIVE_ONLY=ON
 	)
 
 	if has_version ">=dev-python/numpy-2"; then

and tried building Blender again. It did actually solve the issue with `makesdna` built with overriding -march flags. But the build still failed further on with

[2213/5395] /usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOCALE_DYN_LINK -DBOOST_LOCALE_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DCCL_NAMESPACE_BEGIN="namespace ccl {" -DCCL_NAMESPACE_END=} -DCYCLES_GFLAGS_NAMESPACE=gflags -DEMBREE_MAJOR_VERSION=3 -DGOOGLE_GLOG_DLL_DECL="" -DHAVE_EXECINFO_H -DNDEBUG -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DWITH_ASSERT_ABORT -DWITH_BLENDER_GUARDEDALLOC -DWITH_CUDA -DWITH_CUDA_DYNLOAD -DWITH_CYCLES_LOGGING -DWITH_EMBREE -DWITH_KERNEL_NATIVE -DWITH_NANOVDB -DWITH_OCIO -DWITH_OPENIMAGEDENOISE -DWITH_OPENSUBDIV -DWITH_OPENVDB -DWITH_OPENVDB_BLOSC -DWITH_OPTIX -DWITH_SYSTEM_PUGIXML -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__LITTLE_ENDIAN__ -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/../../extern/cuew/include -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/../atomic -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/.. -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../../sky/include -isystem /usr/include/OpenEXR -isystem /usr/include/Imath -isystem /opt/optix/include -isystem /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/extern/glog/include -isystem /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/extern/gflags/src  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe -fopenmp -pipe -fPIC -funsigned-char -fno-strict-aliasing  -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/"="" -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1_build/"="" -march=native -Wno-error=unused-macros -Wno-maybe-uninitialized  -std=c++17 -MD -MT intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o -MF intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o.d -o intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o -c /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/light_tree.cpp
FAILED: intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOCALE_DYN_LINK -DBOOST_LOCALE_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DCCL_NAMESPACE_BEGIN="namespace ccl {" -DCCL_NAMESPACE_END=} -DCYCLES_GFLAGS_NAMESPACE=gflags -DEMBREE_MAJOR_VERSION=3 -DGOOGLE_GLOG_DLL_DECL="" -DHAVE_EXECINFO_H -DNDEBUG -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DWITH_ASSERT_ABORT -DWITH_BLENDER_GUARDEDALLOC -DWITH_CUDA -DWITH_CUDA_DYNLOAD -DWITH_CYCLES_LOGGING -DWITH_EMBREE -DWITH_KERNEL_NATIVE -DWITH_NANOVDB -DWITH_OCIO -DWITH_OPENIMAGEDENOISE -DWITH_OPENSUBDIV -DWITH_OPENVDB -DWITH_OPENVDB_BLOSC -DWITH_OPTIX -DWITH_SYSTEM_PUGIXML -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__LITTLE_ENDIAN__ -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/../../extern/cuew/include -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/../atomic -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/.. -I/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../../sky/include -isystem /usr/include/OpenEXR -isystem /usr/include/Imath -isystem /opt/optix/include -isystem /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/extern/glog/include -isystem /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/extern/gflags/src  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe -fopenmp -pipe -fPIC -funsigned-char -fno-strict-aliasing  -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/"="" -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1_build/"="" -march=native -Wno-error=unused-macros -Wno-maybe-uninitialized  -std=c++17 -MD -MT intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o -MF intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o.d -o intern/cycles/scene/CMakeFiles/cycles_scene.dir/light_tree.cpp.o -c /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/light_tree.cpp
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/immintrin.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/x86intrin.h:32,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../util/simd.h:25,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../util/types.h:23,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../util/math.h:27,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../kernel/types.h:23,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../scene/light.h:8,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../scene/light_tree.h:8,
                 from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/light_tree.cpp:5:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/smmintrin.h: In function ‘int ccl::fast_rint(float)’:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/smmintrin.h:131:1: error: inlining failed in call to ‘always_inline’ ‘__m128 _mm_round_ss(__m128, __m128, int)’: target specific option mismatch
  131 | _mm_round_ss (__m128 __D, __m128 __V, const int __M)
      | ^~~~~~~~~~~~
In file included from /var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../kernel/types.h:24:
/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../util/math_fast.h:69:21: note: called from here
   69 |   vec = _mm_round_ss(vec, vec, (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC));
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/smmintrin.h:131:1: error: inlining failed in call to ‘always_inline’ ‘__m128 _mm_round_ss(__m128, __m128, int)’: target specific option mismatch
  131 | _mm_round_ss (__m128 __D, __m128 __V, const int __M)
      | ^~~~~~~~~~~~
/var/tmp/portage/media-gfx/blender-4.2.1-r1/work/blender-4.2.1/intern/cycles/scene/../util/math_fast.h:69:21: note: called from here
   69 |   vec = _mm_round_ss(vec, vec, (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC));
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

from which appears that the Cycles code calls SSE4.1 intristics unconditionally. (Not totally unexpected seeing the upstream changes.)

Well, I can confirm that USE="-cycles" blender is compilable, runs, functions, and does render with EEVEE so it _is_ somewhat usable... but where is fun in that? :D
Comment 5 Aliaksei Urbanski 2025-02-21 14:29:19 UTC
Hello everyone,

I've faced a similar issue when I was trying to build Blender for an old machine with an AMD Athlon(tm) II X3 440 Processor.

It turns out, Blender's CMake configuration overrides the -march from system CFLAGS/CXXFLAGS with -march=x86-64-v2 if SUPPORT_SSE42_BUILD is ON.
* https://projects.blender.org/blender/blender/src/branch/main/build_files/cmake/macros.cmake#L552
* https://projects.blender.org/blender/blender/src/branch/main/CMakeLists.txt#L1546-L1548

And SUPPORT_SSE42_BUILD is ON even for old machines due to an issue with the TEST_SSE_SUPPORT macro in build_files/cmake/macros.cmake.
* https://projects.blender.org/blender/blender/issues/134933


You may see this in the build log that JohnLM attached to this bug:
> -- Performing Test SUPPORT_SSE42_BUILD
> -- Performing Test SUPPORT_SSE42_BUILD - Success
It led to the following configurations:
> Compiler flags:
> C                -Wall -Werror=implicit-function-declaration -Wstrict-prototypes -Werror=return-type -Werror=vla -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wno-stringop-overread -Wno-stringop-overflow -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wimplicit-fallthrough=5 -Wno-error=unused-but-set-variable -march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe -DNDEBUG -march=x86-64-v2 -fopenmp -std=gnu11 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/"="" -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/"=""
> C++              -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=barcelona -mcx16 -fomit-frame-pointer -O2 -pipe -march=x86-64-v2 -fopenmp -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1/"="" -fmacro-prefix-map="/var/tmp/portage/media-gfx/blender-4.2.1/work/blender-4.2.1_build/"=""
Please notice
> -march=barcelona .* -march=x86-64-v2
I've managed to workaround overriding of the -march by adding "MYCMAKEARGS=-DSUPPORT_SSE42_BUILD=NO" to environment variables.
It allowed me to build Blender 4.2.4 with USE="-cycles" as suggested here, but not Blender 4.3.2 since it has an additional CPU feature usage issue.