On Wed, Feb 10, 2021 at 10:44:31AM +0100, Pierre Labastie wrote: > On Tue, 2021-02-09 at 17:14 -0500, Jean-Marc Pigeon wrote: > > Hello, > > On Tue, 2021-02-09 at 18:27 +0000, Ken Moffat wrote: > > > On Tue, Feb 09, 2021 at 12:29:14AM +0000, Ken Moffat wrote: > > > > On Mon, Feb 08, 2021 at 03:52:35AM +0000, Ken Moffat wrote: > > > > > > > > > > ../configure --prefix=/usr \ > > > > > --disable-werror \ > > > > > --enable-kernel=3.2 \ > > > > > --enable-stack-protector=strong \ > > > > > --with-headers=/usr/include \ > > > > > libc_cv_slibdir=/lib > > > > > libc_cv_include_x86_isa_level=no > > > > > > > > > > I've started the native build, but the machine is slow (i3, > > > > > slow > > > > > DRAM) and I'm not sure it will get very far before I go to > > > > > bed. > > > > > My > > > > > revised plan is to wait for it to fail, whether that is failign > > > > > the > > > > > build or failing to boot. > > > > > > > > > > Assuming it does fail, I'll start again with that workaround. > > > > > > > > > Well I don't need that workaround for using '-march=native -O2' > > > > on > > > > my skylake, it booted successfully. Fortunately, Frans said it > > > > works for him, and htat distros are using it, so I guess we too > > > > should use it. > > > > > > > > However, there was one problem other than my own typos in editing > > > > scripts - tried to build linux-5.10.13 - > > > > > > > > CC arch/x86/kernel/apic/apic.o > > > > make[3]: *** [scripts/Makefile.build:279: > > > > arch/x86/kernel/apic/apic.o] Segmentation fault > > Exact same problem here (not a memory problem, or very big > > "cosmic ray"). same problem on kernel-5.10.9 too. > > this happen using glibc-2.33 AND binutils-2.36.1 > > > > rebuilding from scratch using binutils-2.36.1 and keeping > > glibc-2.32 make the segmentation fault (I previously restarted > > build from scratch with glibc-2.32 + binutils-2.35.1, kernel > > compilation was OK). > > My conclusion, binutils is the trouble maker. > > Could somebody confirm this finding? > > Google is mute on this subject but may be my search > > keywords were not that good. > > advices? suggestions? > > Since you two are the only ones (among the persons on this list, up to > now) who see this, I guess it has something to do with either: > - an option in the config, that you use and the others don't > - some CFLAGS settings, but I doubt it, because the kernel build system > resets them > > > > > > > > > > > Feb 8 20:45:13 leshp klogd: [62379.838193] objtool[10870]: > > > > segfault at 70 ip 000000000040c13e sp 00007ffd0f655670 error 4 in > > > > objtool[402000+11000] > > > > followed by a dump of the code bytes. > > objtool is a kernel thing. According to > tools/objtool/Documentation/stack-validation.txt, > " > The kernel CONFIG_STACK_VALIDATION option enables a host tool named > objtool which runs at compile time. It has a "check" subcommand which > analyzes every .o file and ensures the validity of its stack metadata. > It enforces a set of rules on asm code and C inline assembly code so > that stack traces can be reliable. > " > > Note that I do have that option set to y, but maybe other options in > the "Compile-time checks and compiler options" may differ... > > rebuilding with "make V=1", I see that objtool is run after each > compilation. It might be interesting to compare the options that are > passed to objtool in my case and in yours. Mine has: > ./tools/objtool/objtool check --retpoline --uaccess \ > arch/x86/kernel/apic/apic.o > > (same options for any object file, but I show the one that might be > faulty in your case). > > Maybe "gdb objtool" would allow to learn more (but may need to > recompile objtool with debug enabled, I'm not sure how to do that) > > Pierre >
Hi all, I've gone back to my skylake and attempted a fresh build of 5.10.14. I used KBUILD_VERBOSE=1, for objtool I have: ./tools/objtool/objtool orc generate --no-fp --retpoline --uaccess \ arch/x86/kernel/apic/apic.o Note that the segfault seems to be happening *before* what you quote above (in generate, check presumably comes after that). The full command leading up to the error (not reformatted, everything between gcc and apic.c is one line): make -f ./scripts/Makefile.build obj=arch/x86/kernel/apic \ \ need-builtin=1 \ need-modorder=1 gcc -Wp,-MMD,arch/x86/kernel/apic/.apic.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include -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/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=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -DCONFIG_X86_X32_ABI -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -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-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fcf-protection=none -Wno-packed-not-aligned -fplugin=./scripts/gcc-plugins/latent_entropy_plugin.so -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/randomize_layout_plugin.so -DLATENT_ENTROPY_PLUGIN -fplugin-arg-structleak_plugin-byref-all -DSTRUCTLEAK_PLUGIN -DRANDSTRUCT_PLUGIN -fplugin-arg-randomize_layout_plugin-performance-mode -DKBUILD_MODFILE='"arch/x86/kernel/apic/apic"' -DKBUILD_BASENAME='"apic"' -DKBUILD_MODNAME='"apic"' -c -o arch/x86/kernel/apic/apic.o arch/x86/kernel/apic/apic.c ./tools/objtool/objtool orc generate --no-fp --retpoline --uaccess arch/x86/kernel/apic/apic.o make[3]: *** [scripts/Makefile.build:279: arch/x86/kernel/apic/apic.o] Segmentation fault make[3]: *** Deleting file 'arch/x86/kernel/apic/apic.o' make[2]: *** [scripts/Makefile.build:496: arch/x86/kernel/apic] Error 2 make[1]: *** [scripts/Makefile.build:496: arch/x86/kernel] Error 2 make: *** [Makefile:1805: arch/x86] Error 2 I'm attaching my gzipped config. The segfault is actually in objtool - Feb 10 16:10:09 leshp klogd: [ 176.318096] objtool[11443]: segfault at 70 ip 000000000040c07e sp 00007ffc68d330c0 error 4 in objtool[402000+11000] Feb 10 16:10:09 leshp klogd: [ 176.318106] Code: 89 68 10 49 89 6d 50 49 39 dc 74 b9 48 8b 43 48 8b 4b 50 48 83 c2 18 48 89 42 e8 48 63 43 54 48 89 42 f8 48 8b 43 40 48 8b 1b <8b> 40 70 48 c1 e0 20 48 01 c8 48 89 42 f0 49 39 dc 75 cf 45 31 c0 Feb 10 16:12:54 leshp klogd: [ 340.875536] objtool[21151]: segfault at 70 ip 000000000040c07e sp 00007ffe2c1a00a0 error 4 in objtool[402000+11000] Feb 10 16:12:54 leshp klogd: [ 340.875545] Code: 89 68 10 49 89 6d 50 49 39 dc 74 b9 48 8b 43 48 8b 4b 50 48 83 c2 18 48 89 42 e8 48 63 43 54 48 89 42 f8 48 8b 43 40 48 8b 1b <8b> 40 70 48 c1 e0 20 48 01 c8 48 89 42 f0 49 39 dc 75 cf 45 31 c0 Unfortunately, at this point I'm out of my depth and I don't have gdb installed yet. ĸen -- Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. -- rfc 2324 (1st April 1998)
config-segfault.gz
Description: application/gunzip
-- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style