I have sys-kernel/gentoo-sources-4.4.0 installed with USE=experimental. I did "cd /usr/src/linux-4.4.0-gentoo; make menuconfig" and chose Intel Broadwell as the processor family. "make" (with gcc-4.9.3) then fails with the following log. The bug has already been solved upstream at https://github.com/graysky2/kernel_gcc_patch (specifically, https://github.com/graysky2/kernel_gcc_patch/commit/8a380832867cb7a9d9c703a73f39d64d0caceb6f), so perhaps you could give a version bump to 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch? As a bonus, it would enable the optimizations for Skylake processors. HOSTCC scripts/kconfig/conf.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --silentoldconfig Kconfig .config:406:warning: symbol value '' invalid for X86_INTERNODE_CACHE_SHIFT # # configuration written to .config # SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_32_ia32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_64_x32.h SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_64.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h HOSTCC scripts/basic/bin2c HOSTCC arch/x86/tools/relocs_32.o HOSTCC arch/x86/tools/relocs_64.o HOSTCC arch/x86/tools/relocs_common.o HOSTLD arch/x86/tools/relocs CHK include/config/kernel.release UPD include/config/kernel.release WRAP arch/x86/include/generated/asm/clkdev.h WRAP arch/x86/include/generated/asm/cputime.h WRAP arch/x86/include/generated/asm/dma-contiguous.h WRAP arch/x86/include/generated/asm/early_ioremap.h WRAP arch/x86/include/generated/asm/mcs_spinlock.h WRAP arch/x86/include/generated/asm/mm-arch-hooks.h CHK include/generated/uapi/linux/version.h UPD include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h CC kernel/bounds.s In file included from ./arch/x86/include/asm/segment.h:155:0, from ./arch/x86/include/asm/ptrace.h:4, from ./arch/x86/include/asm/alternative.h:8, from ./arch/x86/include/asm/bitops.h:16, from include/linux/bitops.h:36, from include/linux/kernel.h:10, from include/asm-generic/bug.h:13, from ./arch/x86/include/asm/bug.h:35, from include/linux/bug.h:4, from include/linux/page-flags.h:9, from kernel/bounds.c:9: ./arch/x86/include/asm/cache.h:7:25: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function) #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) ^ ./arch/x86/include/asm/cache.h:8:30: note: in expansion of macro ‘L1_CACHE_SHIFT’ #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) ^ include/linux/cache.h:12:25: note: in expansion of macro ‘L1_CACHE_BYTES’ #define SMP_CACHE_BYTES L1_CACHE_BYTES ^ include/linux/cache.h:20:58: note: in expansion of macro ‘SMP_CACHE_BYTES’ #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) ^ ./arch/x86/include/asm/processor.h:275:27: note: in expansion of macro ‘____cacheline_aligned’ } __attribute__((packed)) ____cacheline_aligned; ^ In file included from ./arch/x86/include/asm/atomic.h:6:0, from include/linux/atomic.h:4, from include/asm-generic/qspinlock_types.h:28, from ./arch/x86/include/asm/spinlock_types.h:27, from include/linux/spinlock_types.h:13, from kernel/bounds.c:13: ./arch/x86/include/asm/processor.h:275:1: error: requested alignment is not an integer constant } __attribute__((packed)) ____cacheline_aligned; ^ ./arch/x86/include/asm/processor.h:306:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from include/asm-generic/percpu.h:6:0, from ./arch/x86/include/asm/percpu.h:551, from ./arch/x86/include/asm/current.h:5, from ./arch/x86/include/asm/processor.h:15, from ./arch/x86/include/asm/atomic.h:6, from include/linux/atomic.h:4, from include/asm-generic/qspinlock_types.h:28, from ./arch/x86/include/asm/spinlock_types.h:27, from include/linux/spinlock_types.h:13, from kernel/bounds.c:13: ./arch/x86/include/asm/processor.h:308:39: error: requested alignment is not an integer constant DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss); ^ include/linux/percpu-defs.h:101:38: note: in definition of macro ‘DECLARE_PER_CPU_SECTION’ extern __PCPU_ATTRS(sec) __typeof__(type) name ^ ./arch/x86/include/asm/processor.h:308:1: note: in expansion of macro ‘DECLARE_PER_CPU_SHARED_ALIGNED’ DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss); ^ Kbuild:44: recipe for target 'kernel/bounds.s' failed make[1]: *** [kernel/bounds.s] Error 1 Makefile:986: recipe for target 'prepare0' failed make: *** [prepare0] Error 2
As a workaround, I have edited my arch/x86/Kconfig.cpu and just replaced the mistaken "BROADWELL" by "MBROADWELL". --- arch/x86/Kconfig.cpu~ 2016-01-16 05:50:19.098290641 +0200 +++ arch/x86/Kconfig.cpu 2016-01-16 05:59:43.312835842 +0200 @@ -420,7 +420,7 @@ config X86_L1_CACHE_SHIFT int default "7" if MPENTIUM4 || MPSC - default "6" if MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MPENTIUMM || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || BROADWELL || MNATIVE || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU + default "6" if MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MJAGUAR || MPENTIUMM || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MNATIVE || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU default "4" if MELAN || M486 || MGEODEGX1 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
# emerge --info sys-kernel/gentoo-sources Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.21-r1, 4.3.3-tuxonice x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.3.3-tuxonice-x86_64-Intel-R-_Core-TM-_i7-6700HQ_CPU_@_2.60GHz-with-gentoo-2.2 KiB Mem: 16382740 total, 12026276 free KiB Swap: 16782332 total, 16782332 free Timestamp of repository gentoo: Sat, 16 Jan 2016 02:42:08 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.10-r1::gentoo, 3.4.3-r1::gentoo dev-util/cmake: 3.3.1-r1::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.19.1::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::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.1-r1::gentoo sys-devel/gcc: 4.9.3::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers) sys-libs/glibc: 2.21-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo priority: -1000 kohalik location: /usr/local/portage masters: gentoo priority: 0 esteid location: /var/lib/layman/esteid masters: gentoo priority: 1 hering-overlay location: /var/lib/layman/hering-overlay masters: gentoo priority: 2 sabayon location: /var/lib/layman/sabayon masters: gentoo priority: 3 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=broadwell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe" 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 /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=broadwell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y --autounmask-write n" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs cgroup collision-protect compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ http://trumpetti.atm.tut.fi/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--timeout=900" 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="64bit X a52 aac aalib ace acpi aften alac alsa amd64 amr animgif apng archive artworkextra asf aspell asyncns atlas audacious autotrace bash-completion berkdb bidi binary-drivers blas bluetooth boost bs2b bzip2 c++0x cairo caja caps cblas-external cdda cddb cdparanoia cdr cdrom cg chardet chm cjk cli colord colordiff compress corefonts cpio cracklib crypt cscope css cue cups cxx dbus dga dirac djbfft djvu double-precision dri dts dv dvd dvdnav dvdr dvi dvipdfm ebook ee emboss emf enca encode exceptions exif fasttrack fat fbcon ffmpeg fftw firefox fits flac fontconfig fortran ftp g3dvl gd gdbm geoip geolocation gif gimp gkrellm glamor glib glut gmail gmp gnome gnuplot gnutella gpg gpm gpu grammar graphicsmagick graphviz gsl gtalk gtk gtkstyle gucharmap handbook hardcoded-tables highlight history hpijs hpn hunspell i18n iconv icu id3 id3tag idn image-cache imagemagick inkjar int64 ipv6 iso14755 jabber jbig jemalloc jit jpeg jpeg2k kate kde keyscrub kipi ladspa lame lapack laptop lasi latex lcms lensfun libcaca libnotify libsamplerate libvisual live lm_sensors lzma lzo mac mad magic man manpages matroska mbox mbrola memlimit metric midi mime mjpeg mkl mmx mmxext mng modules monolithic-build mp3 mp4 mpeg mplayer msn mtp multilib multiprocess multiuser musepack music musicbrainz natspec ncurses netpbm network-cron nls nocd nptl ntfs ntp nvidia office offlinehelp ogg ogg123 ogm okteta okular opencl opencv opengl openmp openssl openstreetmap openvg optimization optimize-cflags opus pam pango pch pcre pdf pdf-writer pdftk pgf phonon pkcs11 pm-utils png pnm postproc postscript povray ppds prediction pulseaudio qt3support qt4 quesoglc quicktime rar readline realtime regex replaygain rle rtc rtmp rtsp sbcl sbsms scanner schroedinger screen seccomp session sftp sha512 shadow sift skype smp sndfile sound sounds sox spell srt sse sse2 sse3 sse4_1 ssh ssl ssse3 startup-notification subtitles svg syslog szip t1lib taglib tcpd templates tex themes theora thesaurus thin-splines threads threadsafe thumbnail tiff timezone timidity tls truetype type3 udev umfpack unicode usb userlocales uudeview uuencode v4l vaapi valgrind vamp video videos vim vim-pager vim-syntax vimeo visualizer vorbis vpx wav webcam webp wifi wma wmf wxwidgets x264 xattr xcb xcf xcomposite xext xinerama xml xmp xosd xpm xps xrandr xrender xscreensaver xv xvid xvmc xz youtube zip zlib" ABI_X86="64" ALSA_CARDS="intel8x0 usb-audio" 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_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer pdfimport" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386 arm" QEMU_USER_TARGETS="x86_64 i386 arm" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="nvidia intel i915 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" Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON ================================================================= Package Settings ================================================================= sys-kernel/gentoo-sources-4.4.0::gentoo was built with the following: USE="experimental symlink -build -kdbus" ABI_X86="64"
Same for 4.1.15-gentoo-r1
Released