# Genkernel all failing to compile the "modules" target

## c0vert

Can anyone help me figure out where to start debugging this?

I am doing a kernel upgrade from 4.9 to 4.12.12.

```

drewch@piper /usr/src/linux-4.9.16-gentoo $ sudo genkernel all 

* Gentoo Linux Genkernel; Version 3.4.52.4

* Running with options: all

* Using genkernel.conf from /etc/genkernel.conf

* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..

* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 4.12.12-gentoo for x86_64...

* .. with config file /usr/share/genkernel/arch/x86_64/generated-config

mount: can't find UUID=127a9aed-d2fd-4cbd-8366-b14980306f51

* WARNING: Failed to mount /boot!

* kernel: Using config from /usr/share/genkernel/arch/x86_64/generated-config

*         Previous config backed up to .config--2017-09-30--19-25-20.bak

* kernel: >> Running mrproper...

*         >> Running oldconfig...

* kernel: >> Cleaning...

* kernel: >> Invoking menuconfig...

*         >> Compiling 4.12.12-gentoo bzImage...

*         >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y...

*         >> Compiling 4.12.12-gentoo modules...

* ERROR: Failed to compile the "modules" target...

* 

* -- Grepping log... --

* 

* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..

* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

*

* Linux Kernel 4.12.12-gentoo for x86_64...

* .. with config file /usr/share/genkernel/arch/x86_64/generated-config

* WARNING: Failed to mount /boot!

*--

*  SHIPPED scripts/kconfig/zconf.lex.c

*  SHIPPED scripts/kconfig/zconf.hash.c

*  HOSTCC  scripts/kconfig/zconf.tab.o

*  HOSTLD  scripts/kconfig/conf

*scripts/kconfig/conf  --oldconfig Kconfig

*.config:76:warning: override: reassigning to symbol UV_MMTIMER

*.config:125:warning: symbol value 'm' invalid for X86_INTEL_PSTATE

*.config:879:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP

*.config:881:warning: symbol value 'm' invalid for NF_CT_PROTO_SCTP

*.config:882:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE

*.config:900:warning: symbol value 'm' invalid for NF_NAT_PROTO_DCCP

*.config:901:warning: symbol value 'm' invalid for NF_NAT_PROTO_UDPLITE

*.config:902:warning: symbol value 'm' invalid for NF_NAT_PROTO_SCTP

*.config:2390:warning: override: FB_MB862XX_LIME changes choice state

*.config:2811:warning: symbol value 'm' invalid for AB3100_CORE

*.config:2820:warning: symbol value 'm' invalid for MFD_WM8400

*.config:2821:warning: symbol value 'm' invalid for MFD_WM8350_I2C

*.config:2822:warning: symbol value 'm' invalid for MFD_WM8350

*.config:2823:warning: symbol value 'm' invalid for MFD_WM831X

*.config:3460:warning: symbol value 'm' invalid for POWER_SUPPLY

*--

*Allow for memory compaction (COMPACTION) [Y/n/?] y

*  Page migration (MIGRATION) [Y/?] y

*Enable bounce buffers (BOUNCE) [Y/n/?] (NEW) 

*Enable KSM for page merging (KSM) [Y/n/?] y

*Low address space to protect from user allocation (DEFAULT_MMAP_MIN_ADDR) [4096] 4096

*Enable recovery from hardware memory errors (MEMORY_FAILURE) [Y/n/?] y

*--

*  Debug Statements (ACPI_DEBUG) [N/y/?] (NEW) 

*  PCI slot detection driver (ACPI_PCI_SLOT) [Y/n/?] y

*  Container and Module Devices (ACPI_CONTAINER) [Y/?] (NEW) y

*  Memory Hotplug (ACPI_HOTPLUG_MEMORY) [Y/n/?] y

*  Smart Battery System (ACPI_SBS) [N/m/y/?] (NEW) 

*  Hardware Error Device (ACPI_HED) [Y/?] y

*  Allow ACPI methods to be inserted/replaced at run time (ACPI_CUSTOM_METHOD) [N/m/y/?] (NEW) 

*  Boottime Graphics Resource Table support (ACPI_BGRT) [N/y/?] (NEW) 

*  ACPI NVDIMM Firmware Interface Table (NFIT) (ACPI_NFIT) [N/m/y/?] (NEW) 

*  ACPI Platform Error Interface (APEI) (ACPI_APEI) [Y/n/?] y

*    APEI Generic Hardware Error Source (ACPI_APEI_GHES) [Y/n/?] y

*    APEI PCIe AER logging/recovering support (ACPI_APEI_PCIEAER) [Y/n/?] y

*    APEI memory error recovering support (ACPI_APEI_MEMORY_FAILURE) [Y/n/?] y

*    APEI Error INJection (EINJ) (ACPI_APEI_EINJ) [M/n/y/?] m

*    APEI Error Record Serialization Table (ERST) Debug Support (ACPI_APEI_ERST_DEBUG) [M/n/y/?] m

*  DPTF Platform Power Participant (DPTF_POWER) [N/m/y/?] (NEW) 

*  Extended Error Log support (ACPI_EXTLOG) [N/m/y/?] (NEW) 

*--

* Bus options (PCI etc.)

*

*PCI support (PCI) [Y/n/?] y

*  Support mmconfig PCI config space access (PCI_MMCONFIG) [N/y] (NEW) 

*  PCI Express Port Bus support (PCIEPORTBUS) [Y/n/?] y

*    Root Port Advanced Error Reporting support (PCIEAER) [Y/n/?] y

*      PCI Express ECRC settings control (PCIE_ECRC) [Y/n/?] y

*      PCIe AER error injector support (PCIEAER_INJECT) [M/n/y/?] m

*--

*      *

*      round-robin scheduling (IP_VS_RR) [M/n/?] m

*      weighted round-robin scheduling (IP_VS_WRR) [M/n/?] m

*      least-connection scheduling (IP_VS_LC) [M/n/?] m

*      weighted least-connection scheduling (IP_VS_WLC) [M/n/?] m

*      weighted failover scheduling (IP_VS_FO) [N/m/?] (NEW) 

*--

*  * Wireless

*  *

*  Wireless (WIRELESS) [Y] y

*    cfg80211 - wireless configuration API (CFG80211) [M/n/?] m

*      nl80211 testmode command (NL80211_TESTMODE) [N/y/?] n

*      enable developer warnings (CFG80211_DEVELOPER_WARNINGS) [N/y/?] n

*--

*SCSI CDROM support (BLK_DEV_SR) [M/n/y/?] m

*  Enable vendor-specific extensions (for SCSI CDROM) (BLK_DEV_SR_VENDOR) [Y/n/?] y

*SCSI generic support (CHR_DEV_SG) [M/n/y/?] m

*SCSI media changer support (CHR_DEV_SCH) [M/n/y/?] m

*SCSI Enclosure Support (SCSI_ENCLOSURE) [M/n/?] m

*Verbose SCSI error reporting (kernel size += 36K) (SCSI_CONSTANTS) [Y/n/?] y

*--

*  Compile All OSD modules with lots of DEBUG prints (SCSI_OSD_DEBUG) [N/y/?] n

*

* Serial ATA and Parallel ATA drivers (libata)

*

*Serial ATA and Parallel ATA drivers (libata) (ATA) [Y/n/m/?] y

*  Verbose ATA error reporting (ATA_VERBOSE_ERROR) [Y/n/?] y

*--

*  Default debug level (NOUVEAU_DEBUG_DEFAULT) [3] 3

*  Support for backlight control (DRM_NOUVEAU_BACKLIGHT) [Y/n/?] y

*Intel 8xx/9xx/G3x/G4x/HD Graphics (DRM_I915) [M/n/?] m

*  Enable alpha quality support for new Intel hardware by default (DRM_I915_ALPHA_SUPPORT) [N/y/?] (NEW) 

*  Enable capturing GPU state following a hang (DRM_I915_CAPTURE_ERROR) [Y/n/?] (NEW) 

*    Compress GPU error state (DRM_I915_COMPRESS_ERROR) [Y/n/?] (NEW) 

*--

*  iSCSI Extensions for RDMA (iSER) (INFINIBAND_ISER) [M/n/?] m

*  Intel OPA VNIC support (INFINIBAND_OPA_VNIC) [N/m/?] (NEW) 

*  RDMA verbs transport library (INFINIBAND_RDMAVT) [N/m/?] (NEW) 

*  Broadcom Netxtreme HCA support (INFINIBAND_BNXT_RE) [N/m/?] (NEW) 

*

* EDAC (Error Detection And Correction) reporting

*

*EDAC (Error Detection And Correction) reporting (EDAC) [Y/n/m/?] y

*  EDAC legacy sysfs (EDAC_LEGACY_SYSFS) [Y/n/?] y

*  Debugging (EDAC_DEBUG) [N/y/?] n

*  Decode MCEs in human-readable form (only on AMD for now) (EDAC_DECODE_MCE) [M/n/y/?] m

*  Output ACPI APEI/GHES BIOS detected errors via EDAC (EDAC_GHES) [N/y/?] (NEW) 

*  AMD64 (Opteron, Athlon64) (EDAC_AMD64) [M/n/?] m

*    Sysfs HW Error injection facilities (EDAC_AMD64_ERROR_INJECTION) [Y/n/?] y

*--

*  JFS statistics (JFS_STATISTICS) [N/y/?] n

*XFS filesystem support (XFS_FS) [M/n/y/?] m

*  XFS Quota support (XFS_QUOTA) [Y/n/?] y

*  XFS POSIX ACL support (XFS_POSIX_ACL) [Y/n/?] y

*  XFS Realtime subvolume support (XFS_RT) [N/y/?] n

*  XFS Verbose Warnings (XFS_WARN) [N/y/?] (NEW) 

*--

*Inotify support for userspace (INOTIFY_USER) [Y/n/?] y

*Filesystem wide access notification (FANOTIFY) [Y/n/?] y

*  fanotify permissions checking (FANOTIFY_ACCESS_PERMISSIONS) [N/y/?] (NEW) 

*Quota support (QUOTA) [Y/n/?] y

*Report quota messages through netlink interface (QUOTA_NETLINK_INTERFACE) [Y/n/?] y

*Print quota warnings to console (OBSOLETE) (PRINT_QUOTA_WARNING) [Y/n/?] y

*--

*Enable tracing for RCU (RCU_TRACE) [N/y/?] n

*Provide debugging asserts for adding NO_HZ support to an arch (RCU_EQS_DEBUG) [N/y/?] (NEW) 

*Force round-robin CPU selection for unbound work items (DEBUG_WQ_FORCE_RR_CPU) [N/y/?] (NEW) 

*Force extended block device numbers and spread them (DEBUG_BLOCK_EXT_DEVT) [N/y/?] n

*Enable CPU hotplug state control (CPU_HOTPLUG_STATE_CONTROL) [N/y/?] (NEW) 

*Notifier error injection (NOTIFIER_ERROR_INJECTION) [N/m/y/?] (NEW) 

*--

*  CC      arch/x86/lib/msr.o

*  CC      drivers/base/attribute_container.o

*  AS      arch/x86/lib/msr-reg.o

*  LD      net/dns_resolver/built-in.o

*  CC      net/dsa/dsa.o

*  CC      mm/memory-failure.o

*--

*  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz

*  MKPIGGY arch/x86/boot/compressed/piggy.S

*  AS      arch/x86/boot/compressed/piggy.o

*  DATAREL arch/x86/boot/compressed/vmlinux

*  LD      arch/x86/boot/compressed/vmlinux

*ld: arch/x86/boot/compressed/head_64.o: warning: relocation in readonly section `.head.text'

*ld: warning: creating a DT_TEXTREL in a shared object.

*--

*  CC [M]  fs/jffs2/security.o

*  CC [M]  sound/pci/trident/trident_memory.o

*  CC [M]  sound/pci/oxygen/xonar_dg.o

*  CC [M]  fs/nls/nls_cp862.o

*fs/jffs2/xattr.c: In function ‘jffs2_build_xattr_subsystem’:

*fs/jffs2/xattr.c:887:1: warning: the frame size of 1128 bytes is larger than 1024 bytes [-Wframe-larger-than=]

*--

*  CC [M]  drivers/infiniband/hw/cxgb4/device.o

*  CC [M]  drivers/gpu/drm/i915/intel_uc.o

*  CC [M]  drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.o

*  CC [M]  net/ipv4/ah4.o

*  CC [M]  net/ipv4/esp4.o

*gcc: internal compiler error: Segmentation fault (program as)

*Please submit a full bug report,

*with preprocessed source if appropriate.

*See <https://bugs.gentoo.org/> for instructions.

*make[4]: *** [scripts/Makefile.build:302: drivers/gpu/drm/radeon/radeon_encoders.o] Error 4

*make[3]: *** [scripts/Makefile.build:561: drivers/gpu/drm/radeon] Error 2

*--

*  CC [M]  drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.o

*  CC [M]  net/rfkill/input.o

*  CC [M]  net/netfilter/nfnetlink_log.o

*  CC [M]  net/phonet/socket.o

*net/openvswitch/datapath.c: In function ‘ovs_flow_cmd_set’:

*net/openvswitch/datapath.c:1211:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]

*--

*  CC [M]  drivers/media/usb/pvrusb2/pvrusb2-devattr.o

*  CC [M]  drivers/usb/atm/ueagle-atm.o

*  CC [M]  drivers/media/usb/pwc/pwc-v4l.o

*  CC [M]  drivers/media/usb/pvrusb2/pvrusb2-context.o

*  CC [M]  drivers/usb/atm/usbatm.o

*make[2]: *** [scripts/Makefile.build:561: drivers/gpu/drm] Error 2

*make[1]: *** [scripts/Makefile.build:561: drivers/gpu] Error 2

*--

*  CC [M]  drivers/scsi/qla2xxx/qla_sup.o

*  CC [M]  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.o

*  CC [M]  drivers/net/ethernet/mellanox/mlx4/en_cq.o

*  CC [M]  drivers/net/ethernet/mellanox/mlx4/en_resources.o

*drivers/net/ethernet/neterion/vxge/vxge-main.c: In function ‘vxge_poll_inta’:

*drivers/net/ethernet/neterion/vxge/vxge-main.c:1873:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]

* }

* ^

*drivers/net/ethernet/neterion/vxge/vxge-main.c: In function ‘vxge_tx_msix_handle’:

*drivers/net/ethernet/neterion/vxge/vxge-main.c:2246:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]

* }

* ^

*  CC [M]  drivers/usb/serial/navman.o

*drivers/net/ethernet/neterion/vxge/vxge-main.c: In function ‘vxge_netpoll’:

*drivers/net/ethernet/neterion/vxge/vxge-main.c:1908:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=]

*--

*  CC [M]  drivers/net/wireless/ti/wlcore/scan.o

*  LD [M]  drivers/net/wireless/intel/iwlwifi/mvm/iwlmvm.o

*  CC [M]  drivers/net/wireless/ti/wlcore/sysfs.o

*  CC [M]  drivers/net/wireless/ti/wlcore/vendor_cmd.o

*  LD [M]  drivers/net/wireless/ti/wlcore/wlcore.o

*make: *** [Makefile:1019: drivers] Error 2

*--

* Running with options: all

* Using genkernel.conf from /etc/genkernel.conf

* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..

* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

*

* ERROR: Failed to compile the "modules" target...

* 

* -- End log... --

* 

* Please consult /var/log/genkernel.log for more information and any

* errors that were reported above.

* 

* Report any genkernel bugs to bugs.gentoo.org and

* assign your bug to genkernel@gentoo.org. Please include

* as much information as you can in your bug report; attaching

* /var/log/genkernel.log so that your issue can be dealt with effectively.

* 

* Please do *not* report compilation failures as genkernel bugs!

* 

```

----------

## fedeliallalinea

```
gcc: internal compiler error: Segmentation fault (program as) 
```

You can post output of command

```
$ qlist -Iv binutils 
```

----------

## c0vert

 *fedeliallalinea wrote:*   

> 
> 
> You can post output of command
> 
> ```
> ...

 

Thanks, here it is:

```

drewch@piper /usr/src/linux-4.9.16-gentoo $ qlist -Iv binutils  

sys-devel/binutils-2.28.1

sys-devel/binutils-config-5-r3

sys-libs/binutils-libs-2.28.1

```

----------

## fedeliallalinea

Nothing wrong here, possible hardware issue?

----------

## c0vert

 *fedeliallalinea wrote:*   

> Nothing wrong here, possible hardware issue?

 

Yeah I am thinking it's caused by my early rev Ryzen 1800x...

Thanks,

Andrew

----------

## zemuldo

I got my solution by editing kernel menuconfig as in this Wiki page

https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide

Built-in vs modular

Most configuration options are tristate: they can be either not built at all (N), built directly into the kernel (Y), or built as a module (M). Modules are stored externally on the filesystem, whereas built-in items are built directly into the kernel image itself.

There is an important difference between built-in and modular: with a few exceptions, the kernel makes no attempt whatsoever to load any external modules when the system might need them; it is left up to the user to decide when, or when to not, load a module. While certain other parts of the system may have load-on-demand facilities, and there are some automatic module loading utilities available, it is recommended to build hardware support and kernel features directly into the kernel. The kernel can then ensure the functionality and hardware support is available whenever needed. This is done by setting each kernel feature to (Y). For this setup to be coherent it is also necessary to include firmware support in the kernel. This is done setting FW_LOADER=y and CONFIG_FIRMWARE_IN_KERNEL=y in the kernel's .config or by the following:

KERNEL Enabling firmware in kernel

Device Drivers  --->

   Generic Driver Options  --->

       -*- Userspace firmware loading support

       [*] Include in-kernel firmware blobs in kernel binary

----------

