On Mon, 4 Jan 2021 at 01:51, BALATON Zoltan <bala...@eik.bme.hu> wrote: > Something is still not right with this, I've noticed that a few other > boards also have this option selected but they don't need fdt.o that's > gated by this option in meson.build. That fdt.o is only needed by PSERIES > and POWERNV but removing FDT_PPC from other boards I get: > > ../hw/ppc/sam460ex.c:43:10: fatal error: libfdt.h: No such file or directory > #include <libfdt.h> > > so apparently this switch also pulls in the necessary CPPFLAGS or libfdt > dependency. Is there a separate switch for that or we can only get it with > fdt.o. Not a big deal just not trivial why we need an option that at first > sight select a source file which we don't need. I think I'll drop this > patch for now when resending the series.
This happens because hw/ppc/meson.build does: ppc_ss.add(when: 'CONFIG_FDT_PPC', if_true: [files( 'fdt.c', ), fdt]) ie if CONFIG_FDT_PPC is set then both * add fdt.c to the build * add the 'fdt' dependency (which brings in the CFLAGS and LDFLAGS necessary for libfdt). So yes, at the moment for PPC there are only two options: * board doesn't use FDT at all * board uses FDT and gets hw/ppc/fdt.c linked in even if it doesn't use the functions there Since fdt.c currently has just one not very large function (which is only even present if TARGET_PPC64) this doesn't seem like a big deal, but in theory the "need libfdt" and "need fdt.c" parts could be decoupled. thanks -- PMM