I was surprised to see this while doing a build of LTS 6.1.23 kernel :
CC [M] drivers/media/pci/cx18/cx18-driver.o
CC [M] drivers/media/pci/cx18/cx18-cards.o
CC [M] drivers/media/pci/cx18/cx18-i2c.o
during GIMPLE pass: fre
drivers/media/pci/cx18/cx18-i2c.c: In function ‘init_cx18_i2c’:
drivers/media/pci/cx18/cx18-i2c.c:300:1: internal compiler error:
Segmentation fault
300 | }
| ^
0x7f33d8fccd5f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f33d8fb7d09 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
make[5]: *** [scripts/Makefile.build:250:
drivers/media/pci/cx18/cx18-i2c.o] Error 1
make[4]: *** [scripts/Makefile.build:500: drivers/media/pci/cx18] Error 2
make[3]: *** [scripts/Makefile.build:500: drivers/media/pci] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/media] Error 2
make[1]: *** [scripts/Makefile.build:500: drivers] Error 2
make: *** [Makefile:2012: .] Error 2
The machine is bone stock Devuan/Debian type :
t# uname -a
Linux titan 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
GNU/Linux
t# which gcc
/usr/bin/gcc
t# gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So I went to the top level and run the usual V=1 verbose stuff :
t# pwd
/usr/local/build/linux-6.1.23
t#
t#
t# make V=1 drivers/media/pci/cx18/
make -f ./scripts/Makefile.build obj=arch/x86/entry/syscalls all
make -f ./scripts/Makefile.build obj=scripts/basic
make -f ./scripts/Makefile.build obj=arch/x86/tools relocs
make -f ./scripts/Makefile.build obj=scripts/dtc
make -f ./scripts/Makefile.build obj=scripts
make -f ./scripts/Makefile.build obj=scripts/genksyms \
need-builtin= \
need-modorder= \
make -f ./scripts/Makefile.build obj=scripts/selinux \
need-builtin= \
need-modorder= \
make -f ./scripts/Makefile.build obj=scripts/selinux/genheaders \
need-builtin= \
need-modorder= \
make -f ./scripts/Makefile.build obj=scripts/selinux/mdp \
need-builtin= \
need-modorder= \
set -e; mkdir -p include/config/; trap "rm -f
include/config/.kernel.release.tmp" EXIT; { echo "6.1.23$(sh
./scripts/setlocalversion .)"; } > include/config/.kernel.release.tmp;
if [ ! -r include/config/kernel.release ] || ! cmp -s
include/config/kernel.release include/config/.kernel.release.tmp; then :
' UPD include/config/kernel.release'; mv -f
include/config/.kernel.release.tmp include/config/kernel.release; fi
make -f ./scripts/Makefile.asm-generic
obj=arch/x86/include/generated/uapi/asm \
generic=include/uapi/asm-generic
make -f ./scripts/Makefile.asm-generic obj=arch/x86/include/generated/asm \
generic=include/asm-generic
set -e; mkdir -p include/generated/uapi/linux/; trap "rm -f
include/generated/uapi/linux/.version.h.tmp" EXIT; { if [ 23 -gt
255 ]; then echo \#define LINUX_VERSION_CODE 393727; else echo \#define
LINUX_VERSION_CODE 393495; fi; echo '#define KERNEL_VERSION(a,b,c) (((a)
<< 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))'; echo \#define
LINUX_VERSION_MAJOR 6; echo \#define LINUX_VERSION_PATCHLEVEL 1; echo
\#define LINUX_VERSION_SUBLEVEL 23; } >
include/generated/uapi/linux/.version.h.tmp; if [ ! -r
include/generated/uapi/linux/version.h ] || ! cmp -s
include/generated/uapi/linux/version.h
include/generated/uapi/linux/.version.h.tmp; then : ' UPD
include/generated/uapi/linux/version.h'; mv -f
include/generated/uapi/linux/.version.h.tmp
include/generated/uapi/linux/version.h; fi
set -e; mkdir -p include/generated/; trap "rm -f
include/generated/.utsrelease.h.tmp" EXIT; { if [ `echo -n
"6.1.23-genunix" | wc -c ` -gt 64 ]; then echo '"6.1.23-genunix" exceeds
64 characters' >&2; exit 1; fi; echo \#define UTS_RELEASE
\"6.1.23-genunix\"; } > include/generated/.utsrelease.h.tmp; if [ ! -r
include/generated/utsrelease.h ] || ! cmp -s
include/generated/utsrelease.h include/generated/.utsrelease.h.tmp; then
: ' UPD include/generated/utsrelease.h'; mv -f
include/generated/.utsrelease.h.tmp include/generated/utsrelease.h; fi
set -e; mkdir -p include/generated/; trap "rm -f
include/generated/.compile.h.tmp" EXIT; { ./scripts/mkcompile_h "x86_64"
"gcc (Debian 10.2.1-6) 10.2.1 20210110" "ld"; } >
include/generated/.compile.h.tmp; if [ ! -r include/generated/compile.h
] || ! cmp -s include/generated/compile.h
include/generated/.compile.h.tmp; then : ' UPD
include/generated/compile.h'; mv -f include/generated/.compile.h.tmp
include/generated/compile.h; fi
./scripts/remove-stale-files
make -f ./scripts/Makefile.build obj=scripts/mod
set -e; mkdir -p scripts/mod/; trap "rm -f
scripts/mod/.devicetable-offsets.h.tmp" EXIT; { echo "#ifndef
__DEVICETABLE_OFFSETS_H__"; echo "#define __DEVICETABLE_OFFSETS_H__";
echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was
generated by Kbuild"; echo " */"; echo ""; sed -ne
's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/*
\1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:;
s:->::; p;}' < scripts/mod/devicetable-offsets.s; echo ""; echo
"#endif"; } > scripts/mod/.devicetable-offsets.h.tmp; if [ ! -r
scripts/mod/devicetable-offsets.h ] || ! cmp -s
scripts/mod/devicetable-offsets.h
scripts/mod/.devicetable-offsets.h.tmp; then : ' UPD
scripts/mod/devicetable-offsets.h'; mv -f
scripts/mod/.devicetable-offsets.h.tmp scripts/mod/devicetable-offsets.h; fi
make -f ./scripts/Makefile.build obj=. prepare
set -e; mkdir -p include/generated/; trap "rm -f
include/generated/.timeconst.h.tmp" EXIT; { echo 250 | bc -q
kernel/time/timeconst.bc; } > include/generated/.timeconst.h.tmp; if [ !
-r include/generated/timeconst.h ] || ! cmp -s
include/generated/timeconst.h include/generated/.timeconst.h.tmp; then :
' UPD include/generated/timeconst.h'; mv -f
include/generated/.timeconst.h.tmp include/generated/timeconst.h; fi
set -e; mkdir -p include/generated/; trap "rm -f
include/generated/.bounds.h.tmp" EXIT; { echo "#ifndef
__LINUX_BOUNDS_H__"; echo "#define __LINUX_BOUNDS_H__"; echo "/*"; echo
" * DO NOT MODIFY."; echo " *"; echo " * This file was generated by
Kbuild"; echo " */"; echo ""; sed -ne
's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/*
\1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:;
s:->::; p;}' < kernel/bounds.s; echo ""; echo "#endif"; } >
include/generated/.bounds.h.tmp; if [ ! -r include/generated/bounds.h ]
|| ! cmp -s include/generated/bounds.h include/generated/.bounds.h.tmp;
then : ' UPD include/generated/bounds.h'; mv -f
include/generated/.bounds.h.tmp include/generated/bounds.h; fi
set -e; mkdir -p include/generated/; trap "rm -f
include/generated/.asm-offsets.h.tmp" EXIT; { echo "#ifndef
__ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo "
* DO NOT MODIFY."; echo " *"; echo " * This file was generated by
Kbuild"; echo " */"; echo ""; sed -ne
's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/*
\1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:;
s:->::; p;}' < arch/x86/kernel/asm-offsets.s; echo ""; echo "#endif"; }
> include/generated/.asm-offsets.h.tmp; if [ ! -r
include/generated/asm-offsets.h ] || ! cmp -s
include/generated/asm-offsets.h include/generated/.asm-offsets.h.tmp;
then : ' UPD include/generated/asm-offsets.h'; mv -f
include/generated/.asm-offsets.h.tmp include/generated/asm-offsets.h; fi
sh scripts/checksyscalls.sh gcc -Wp,-MMD,./.missing-syscalls.d
-nostdinc -I./arch/x86/include -I./arch/x86/include/generated
-I./include -I./arch/x86/include/uapi
-I./arch/x86/include/generated/uapi -I./include/uapi
-I./include/generated/uapi -include ./include/linux/compiler-version.h
-include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./=
-Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int
-Werror=return-type -Wno-format-security -std=gnu11 -mno-sse -mno-mmx
-mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1
-falign-loops=1 -mno-80387 -mno-fp-ret-in-387
-mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic
-mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern
-mindirect-branch-register -mfunction-return=thunk-extern
-fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address
-Wno-format-truncation -Wno-format-overflow
-Wno-address-of-packed-member -O2 -fno-allow-store-data-races
-Wframe-larger-than=2048 -fstack-protector-strong -Wno-main
-Wno-unused-but-set-variable -Wno-unused-const-variable
-fno-stack-clash-protection -pg -mrecord-mcount -mfentry
-DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign
-Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow
-Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than
-Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check
-fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -Wno-packed-not-aligned
-DKBUILD_MODFILE='"./missing-syscalls"'
-DKBUILD_BASENAME='"missing_syscalls"'
-DKBUILD_MODNAME='"missing_syscalls"'
-D__KBUILD_MODNAME=kmod_missing_syscalls
mkdir -p ./tools
make LDFLAGS= MAKEFLAGS=" " O=/usr/local/build/linux-6.1.23 subdir=tools
-C ./tools/ objtool
mkdir -p /usr/local/build/linux-6.1.23/tools/objtool && make
O=/usr/local/build/linux-6.1.23 subdir=tools/objtool
--no-print-directory -C objtool
make -C /usr/local/build/linux-6.1.23/tools/build CFLAGS= LDFLAGS=
/usr/local/build/linux-6.1.23/tools/objtool/fixdep
make -f /usr/local/build/linux-6.1.23/tools/build/Makefile.build dir=.
obj=fixdep
make -C /usr/local/build/linux-6.1.23/tools/lib/subcmd/
OUTPUT=/usr/local/build/linux-6.1.23/tools/objtool/
make -C /usr/local/build/linux-6.1.23/tools/build CFLAGS= LDFLAGS=
/usr/local/build/linux-6.1.23/tools/objtool/fixdep
make -f /usr/local/build/linux-6.1.23/tools/build/Makefile.build dir=.
obj=fixdep
make -f /usr/local/build/linux-6.1.23/tools/build/Makefile.build
dir=./arch/x86 obj=objtool
make -f ./scripts/Makefile.build obj=. need-builtin=1 need-modorder=1
./drivers/media/pci/cx18/
make -f ./scripts/Makefile.build obj=drivers \
need-builtin=1 \
need-modorder=1 \
drivers/media/pci/cx18/
make -f ./scripts/Makefile.build obj=drivers/media \
need-builtin=1 \
need-modorder=1 \
drivers/media/pci/cx18/
make -f ./scripts/Makefile.build obj=drivers/media/pci \
need-builtin=1 \
need-modorder=1 \
drivers/media/pci/cx18/
make -f ./scripts/Makefile.build obj=drivers/media/pci/cx18 \
need-builtin= \
need-modorder=1 \
drivers/media/pci/cx18/
gcc -Wp,-MMD,drivers/media/pci/cx18/.cx18-i2c.o.d -nostdinc
-I./arch/x86/include -I./arch/x86/include/generated -I./include
-I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include
./include/linux/compiler-version.h -include ./include/linux/kconfig.h
-include ./include/linux/compiler_types.h -D__KERNEL__
-fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int
-Werror=return-type -Wno-format-security -std=gnu11 -mno-sse -mno-mmx
-mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1
-falign-loops=1 -mno-80387 -mno-fp-ret-in-387
-mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic
-mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern
-mindirect-branch-register -mfunction-return=thunk-extern
-fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address
-Wno-format-truncation -Wno-format-overflow
-Wno-address-of-packed-member -O2 -fno-allow-store-data-races
-Wframe-larger-than=2048 -fstack-protector-strong -Wno-main
-Wno-unused-but-set-variable -Wno-unused-const-variable
-fno-stack-clash-protection -pg -mrecord-mcount -mfentry
-DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign
-Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow
-Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than
-Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check
-fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -Wno-packed-not-aligned -I
./drivers/media/dvb-frontends -I ./drivers/media/tuners -DMODULE
-DKBUILD_BASENAME='"cx18_i2c"' -DKBUILD_MODNAME='"cx18"'
-D__KBUILD_MODNAME=kmod_cx18 -c -o drivers/media/pci/cx18/cx18-i2c.o
drivers/media/pci/cx18/cx18-i2c.c ; ./tools/objtool/objtool
--hacks=jump_label --hacks=noinstr --orc --retpoline --rethunk
--static-call --uaccess --module drivers/media/pci/cx18/cx18-i2c.o
during GIMPLE pass: fre
drivers/media/pci/cx18/cx18-i2c.c: In function ‘init_cx18_i2c’:
drivers/media/pci/cx18/cx18-i2c.c:300:1: internal compiler error:
Segmentation fault
300 | }
| ^
0x7f9090953d5f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f909093ed09 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
make[5]: *** [scripts/Makefile.build:250:
drivers/media/pci/cx18/cx18-i2c.o] Error 1
make[4]: *** [scripts/Makefile.build:500: drivers/media/pci/cx18] Error 2
make[3]: *** [scripts/Makefile.build:500: drivers/media/pci] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/media] Error 2
make[1]: *** [scripts/Makefile.build:500: drivers] Error 2
make: *** [Makefile:2012: .] Error 2
t#
Feels like a bug in gcc.
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
Four decades in production systems.