Re: New ORC unwinder in 4.14 broke cross-compilation?

From: Randy Dunlap
Date: Sat Dec 02 2017 - 22:31:36 EST


On 11/13/2017 10:33 AM, Andrew Randrianasulu wrote:
> Hello!
>
> I was building my new 4.14 kernel, and on first instance I got working kernel +
> modules, booted ok, found my fb console was missing, recompiled kernel with
> framebuffer console built-in (it resetted itself from M to N, because I was
> using menuconfig on .config from 4.12 where I had fbcon = M). After reboot into
> new kernel everything works, so far. But if I select new ORC unwinder under
> kernel hacking submenu - I get compilation error early:
>
> guest@slax:/dev/shm/src/linux-2.6$ LANG=C make ARCH=x86_64
> CROSS_COMPILE=x86_64-unknown-linux-gnu-
> CHK include/config/kernel.release
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> DESCEND objtool
> CC /dev/shm/src/linux-2.6/tools/objtool/orc_dump.o
> orc_dump.c: In function 'orc_dump':
> orc_dump.c:105:2: error: passing argument 2 of 'elf_getshdrnum' from
> incompatible pointer type [-Werror]
> if (elf_getshdrnum(elf, &nr_sections)) {
> ^
> In file included from /usr/include/gelf.h:32:0,
> from elf.h:22,
> from warn.h:26,
> from orc_dump.c:20:
> /usr/include/libelf.h:244:12: note: expected 'size_t *' but argument is of
> type 'long unsigned int *'
> extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
> ^
> orc_dump.c:190:4: error: format '%lx' expects argument of type 'long unsigned
> int', but argument 3 has type 'Elf64_Sxword' [-Werror=format=]
> printf("%s+%lx:", name, rela.r_addend);
> ^
> cc1: all warnings being treated as errors
> mv: cannot stat '/dev/shm/src/linux-2.6/tools/objtool/.orc_dump.o.tmp': No such
> file or directory
> make[3]: *** [/dev/shm/src/linux-2.6/tools/objtool/orc_dump.o] Error 1
> make[2]: *** [/dev/shm/src/linux-2.6/tools/objtool/objtool-in.o] Error 2
> make[1]: *** [objtool] Error 2
> make: *** [tools/objtool] Error 2
>
>
> --------------
>
> I try to cross-compile from 32-bit slackware with self-built minimal
> cross-compiler:
>
> LANG=C /opt/kgcc64/bin/x86_64-unknown-linux-gnu-gcc --version
> x86_64-unknown-linux-gnu-gcc (GCC) 4.9.2
> Copyright (C) 2014 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.
>
> I basically just followed steps from https://www.linux-mips.org/wiki/Toolchains
> but replaced mips with x86_64 . It worked on many kernels for long time. This
> new kernel first complained about missing gelf.h include, and after installing
> elfutils-0.163-i586-1 (compiled on 32-bit slackware) I now have this error.
> Problem is, even if I unselect ORC unwinder and choose Frame-pointer based
> unwinder again - error remain, at least after make clean.
>
> I usually monitor LKML via web-interface, but please CC me just in case I miss
> my answers. Attached .config after changing unwinder back to frame-pointer
> based.

Hi,
Please try the patch that was posted today:
https://marc.info/?l=linux-kernel&m=151225312110866&w=2



--
~Randy