On Thu, 2021-02-11 at 12:28 +0800, Xi Ruoyao wrote:
> On 2021-02-10 21:57 -0500, Jean-Marc Pigeon wrote:
> > Bonjour Xi (hello the list),
> > 
> > On Thu, 2021-02-11 at 10:51 +0800, Xi Ruoyao wrote:
> > > On 2021-02-10 22:47 +0100, Pierre Labastie wrote:
> > > > On Wed, 2021-02-10 at 21:03 +0000, Ken Moffat wrote:
> > > > > On Wed, Feb 10, 2021 at 08:49:56PM +0000, Ken Moffat wrote:
> > > > > > > 
> > > > > > > Looks like I need to change the Frame pointer unwinder to
> > > > > > > the
> > > > > > > ORC unwinder to have the same config as you.
> > > > > > > 
> > > > > > 
> > > > > > The benefits of the ORC unwinder are mentioned at
> > > > > > https://www.kernel.org/doc/html/latest/x86/orc-unwinder.html
> > > > > > 
> > > > > > It has been around for quite some time, but I probably
> > > > > > picked
> > > > > > it
> > > > > > up when it first appeared (test an -rc kernel, pick up new
> > > > > > options
> > > > > > which might be useful).  I guess that old configs from
> > > > > > before
> > > > > > its
> > > > > > introduction still default to the old unwinder.
> > > > > > 
> > > > > In fact it caused trouble about 3 years ago, there are links
> > > > > to
> > > > > the
> > > > > -dev archive from around January 2018 when elfutils was still
> > > > > in
> > > > > BLFS, and at that time LFS had to use the frame pointer.  So
> > > > > when
> > > > > libelf arrived in LFS I started to use it (or use it again,
> > > > > not
> > > > > sure
> > > > > which).
> > > > > 
> > > > 
> > > > I managed to compile objtool with -g, to recompile apic.c to
> > > > apic.o
> > > > (because it gets erased when objtool fails), and to run the
> > > > objtool
> > > > command on it under gdb. The segfault is esay to understand:
> > > > 
> > > > Program received signal SIGSEGV, Segmentation fault.
> > > > 0x0000000000412f71 in elf_rebuild_rela_reloc_section
> > > > (sec=0xe22b10,
> > > > nr=16)
> > > >     at elf.c:883
> > > > 883                     relocs[idx].r_info = GELF_R_INFO(reloc-
> > > > > sym-
> > > > > idx, reloc->type);
> > > > 
> > > > and the reloc struct is:
> > > > (gdb) p *reloc
> > > > $2 = {list = {next = 0xe23240, prev = 0xe23160}, hash = {next =
> > > > 0x0, 
> > > >     pprev = 0xe23250}, {rela = {r_offset = 0, r_info = 0,
> > > > r_addend
> > > > =
> > > > 0}, 
> > > >     rel = {r_offset = 0, r_info = 0}}, sec = 0xe22b10, sym =
> > > > 0x0,
> > > > offset = 48, 
> > > >   type = 2, addend = 467, idx = 0, jump_table_start = false}
> > > > 
> > > > So reloc->sym is zero, and reloc->sym->idx is a null
> > > > dereference...
> > > > 
> > > > Now to understand why reloc->sym is zero is more complicated...
> > > 
> > > I can reproduce it too with Ken's config and just "make
> > > arch/x86/kernel/apic/apic.o".
> > > 
> > > I seen a strange warning in build:
> > > 
> > > > Warning: Kernel ABI header at 'tools/arch/x86/lib/insn.c'
> > > > differs
> > > > from latest
> > > > version at 'arch/x86/lib/insn.c'
> > > 
> > > Not sure if it causes the segfault.  I'll try 5.10.15 and if it's
> > > not
> > > fixed I'll
> > > report it as a kernel bug.
> > do you confirm it is binutil-2.36.1 related or 
> > is it a kernel only problem?
> 
> I can't confirm or disconfirm.  It's beyond my knowledge.  But I
> decided to
> report it to the kernel bugzilla.  If kernel dev thinks it's a
> binutils bug they
> can report to binutils anyway.
> 
> And, this issue seems "fixed" in 5.11-rc7 so I think the kernel dev
> may have
> some idea of it.

Looks like
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=44f6a7c0755d8dd453c70557e11687bb080a6f21


fixes it (at least with Ken's configuration). I've applied this patch
to 5.10.13 tree (I had also to download the skl_dmc_ver1_27.bin
firmware to /lib/frimware/i915 to allow the build with Ken's config).

Pierre


-- 
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

Reply via email to