On Thu, 2021-10-14 at 11:39 +0200, Adrian Fiergolski wrote: > > On 12.10.2021 18:50, Rob Herring wrote: > > On Tue, Oct 12, 2021 at 9:47 AM Adrian Fiergolski > > <adrian.fiergolski@xxxxxxxxxxxxx> wrote: > > > On 12.10.2021 15:38, Rob Herring wrote: > > > > On Tue, Oct 12, 2021 at 8:16 AM Adrian Fiergolski > > > > <adrian.fiergolski@xxxxxxxxxxxxx> wrote: > > > > > Hi David, > > > > > > > > > > I am being hit by this problem again. This time on Ubuntu 20.04 LTS with > > > > > gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04), yocto (hardknott) and > > > > > kernel v5.10. > > > > > > > > > > As it's standard kernel built, I am using scripts/Makefile.lib from > > > > > kernel sources. This line [1] causes the problem. As you indicated, it > > > > > calls the preprocessor and afterwards dtc. > > > > How is '-g3' getting introduced here? You are externally overriding > > > > HOSTCC with 'gcc -g3' or something like that? > > > Yes, that's the way yocto introduces kernel build flags [1]. > > HOSTCC is supposed to be set to just the compiler. HOSTCFLAGS and > > others should be used to set the flags. > > > > Rob > > > > > [1] > > > https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/kernel.bbclass#n229 > > > > > > Adrian > > > > > I let myself add to this thread Wenzong, author of the change in the > yocto class using HOSTCC, and Ross and Richard who signed off the change. > > Wenzong, Ross and Richard, there is a problem in the way you use HOSTCC, > once one adds '-g3' debug flag and DTS compiler. All the details > regarding the problem can be found in the archives [1]. > > > [1] https://www.spinics.net/lists/devicetree-compiler/index.html#03281 This isn't my area of expertise but I took a look and discussed it with our kernel people and we agree this doesn't look right. I've queued a change for testing which makes this look like: EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"" which I think is what you're asking for. Whether this breaks things, we'll see. Cheers, Richard