Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41059 )
Change subject: payloads/libpayload: Fix BIT macro redefinition error ......................................................................
Patch Set 2:
Patch Set 2:
Patch Set 2:
Patch Set 2:
where are you getting this error - is this from depthcharge/src/board/tglrvp/board.c?
i was doing emerge-tglrvp depthcharge libpayload and could see this issue.
i'd suggest moving <libpayload.h> and <sysinfo.h> up in the up in the include order. also, which file is including ec_commands.h directly? it may be better to include ec.h instead. it's essentially a wrapper and will take care of the libpayload.h dependency and ordering.
ec_commands.h has a guard for a previous BIT, so as long as libpayload.h comes first, it'll be fine.
+#include <libpayload.h> +#include <sysinfo.h> #include "base/init_funcs.h" #include "base/list.h" #include "drivers/ec/cros/lpc.h" @@ -33,25 +35,33 @@ #include "drivers/power/pch.h" #include "drivers/storage/blockdev.h" #include "drivers/storage/nvme.h" -#include <libpayload.h> -#include <sysinfo.h>
this is fixing as well. But do you like to have this hard dependency of include ordering or having this check here make sense. I believe this issue has started coming along with EC_HEADERS CL.
ya, the issue started with the EC_HEADERS CL. the issue is that care must be taken when sharing headers with another source tree and cpu arch - whether it's a checked-in copy or an auto-exported copy. the wrapper shouldn't have any include ordering issues. it's better to use the wrapper header file than directly using the "low level" header file. over time, there may be other quirks that we'd want to handle in the wrapper as well. we'll make sure the wrapper header file gets us the right thing.
So u r suggesting to modify all possible DC code to add a wrapper file to abstract inclusion of below headers? to bypass this ordering issue? #include <libpayload.h> #include <sysinfo.h>