I have a series of machines which are all at least sandybridge, but also some haswell NUCs - since these are slower and can do with some help, I set CFLAGS: CFLAGS="-O2 -pipe -march=sandybridge -mtune=haswell" ...but this results in a crash on the 'sandybridge' machines using mpv in libavcodec.so, which I can reproduce on several versions & configurations (USE=-cpudetection, CPU_FLAGS). It appears the ebuild selects the wrong value out of march/mtune above, as the 'configure' step output shows: <snip> --disable-amd3dnow --disable-amd3dnowext --cpu=haswell If I reverse the get-flag order of the for loop in the ebuild, this fixes the problem. Obviously easy to work-around (using different CFLAGS for this package), but still... Reproducible: Always Steps to Reproduce: 1. CFLAGS="... -march=sandybridge -mtune=haswell" 2. rebuild ffmpeg 3. play media => crash Actual Results: Configure/build as '--cpu=haswell'. Crash with illegal instruction. Expected Results: Configure/build as '--cpu=sandybridge'. No crash. Portage 2.2.20 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.2, glibc-2.20-r2, 4.0.1 x86_64) ================================================================= System uname: Linux-4.0.1-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2 KiB Mem: 16416904 total, 10523440 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Mon, 29 Jun 2015 17:45:01 +0000 sh bash 4.3_p39 ld GNU ld (Gentoo 2.25 p1.2) 2.25 app-shells/bash: 4.3_p39::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.20.2-r1::gentoo dev-lang/python: 2.7.10::gentoo, 3.4.3::gentoo dev-util/cmake: 2.8.12.2-r2::gentoo dev-util/pkgconfig: 0.28-r3::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.17::gentoo sys-apps/sandbox: 2.6-r1::gentoo sys-devel/autoconf: 2.69-r1::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25-r1::gentoo sys-devel/gcc: 4.9.2::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6-r1::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers) sys-libs/glibc: 2.20-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://mithril/gentoo-portage priority: -1000 x-portage location: /usr/local/portage masters: gentoo priority: 1 steam-overlay location: /var/lib/layman/steam-overlay masters: gentoo priority: 50 Installed sets: @common, @esaas_ops ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=sandybridge -mtune=haswell" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/init.d /usr/share/config /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=sandybridge -mtune=haswell -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--nospinner --jobs=6 --keep-going --with-bdeps=y --binpkg-respect-use=y --binpkg-changed-deps=y --rebuilt-binaries --autounmask-keep-masks --buildpkg-exclude 'virtual/* sys-kernel/*-sources app-emulation/virtualbox-modules' -b -k" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg compressdebug config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirror.internode.on.net/pub/gentoo" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j6" PKGDIR="/usr/portage/distfiles/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" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi aio airplay alsa amd64 avahi avx bash-completion bcmath berkdb bluray branding bzip2 cairo cdda cdr cec cgi cjk cli consolekit cracklib crypt css cups curl cxx dbus device-mapper dri dts dv dvb dvd dvdr egl emboss encode evdev exif fam ffmpeg fftw firefox flac flash fontconfig fortran fpm frei0r fuse gbm gd gdbm gif glamor gmp gnome-keyring graphite gstreamer gtk gtk3 hipe iconv icu intl ipv6 ithreads java jemalloc jit joystick jpeg kpoll lame lcms libass libevent libkms libnotify libsamplerate lm_sensors lto lvm2 lzma lzo mad mdnsresponder-compat memcache messages mhash mikmod minizip mmap mmx mmxext mng mod modules mp3 mp4 mpeg msn multilib mysql mythtv ncurses nfs nls nptl nsplugin nss offensive ogg opengl openmp opus pam pango pcntl pcre pcre-jit pcre16 pdf pdo perl php png policykit postgres postproc ppds pulseaudio pvr python qt3support qt4 readline rtc rtmp s3tc samba sdl session sftp smp soap sockets speex spell sqlite sse sse2 sse3 sse4 sse41 sse42 sse4_1 sse4_2 ssh ssl ssse3 startup-notification steamfonts steamgames_portal steamgames_source_engine steamgames_tf2 subversion svg sysvipc tcpd theora threads tidy tiff tk toolame trayicon tremor truetype twolame udev udisks unicode unwind upcall upower usb v4l v4l2 vaapi vdpau vorbis vpx webp webserver webstart winbind wxwidgets x264 x265 xa xcb xcomposite xinerama xlib-xcb xml xmlreader xmlrpc xmlwriter xnest xorg xv xvid zeroconf zip zlib" ABI_X86="64 32" ALSA_CARDS="hda_intel" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog cpu cpufreq aggregation disk exec hddtemp iptables network nfs nginx ntpd postgresql processes protocols sensors thermal uptime users statsd write_graphite" CPU_FLAGS_X86="mmx mmxext sse sse2 avx sse3 sse4_1 sse4_2 ssse3" DVB_CARDS="usb-af9015" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc efi-64 efi-32" INPUT_DEVICES="evdev mouse keyboard synaptics joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_AU en_GB en_US en" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip gunzip sticky metrics stub_status lua echo limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi upstream_check headers_more" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="radeon r600 radeonsi intel i915 i965 none" 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" USE_PYTHON="2.7 3.4" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
should be fixed in d18d89cdd674b7eb62619f8cc4b583e358ee7a43 now -march will take precedence over -mtune, as it indeed makes more sense like that thanks