Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32027 )
Change subject: Make common macros double-evaluation safe ......................................................................
Patch Set 11:
Do you have the error message? I assume it's a name collision with one of the new macros(maybe __CMP). It's impossible to predict all the possible conflicts with all possible environments this may have, but if we know which ones to check for, it should be easy to fix.
Hey Julius,
It's clobbering my build of cbfstool. I don't yet have a strong sense of why:
coreboot/util/cbfstool/cbfstool.c: In function 'cbfs_add_component': coreboot/src/commonlib/include/commonlib/compiler.h:59:2: error: first argument to '__builtin_choose_expr' not a constant __builtin_choose_expr(__builtin_constant_p(expr), fallback_expr, expr)) ^ coreboot/src/commonlib/include/commonlib/helpers.h:39:2: note: in expansion of macro '__TYPEOF_UNLESS_CONST' __TYPEOF_UNLESS_CONST(a, b) var_a = (a); \ ^ coreboot/src/commonlib/include/commonlib/helpers.h:49:26: note: in expansion of macro '__CMP_SAFE' __CMP_UNSAFE(a, b, op), __CMP_SAFE(a, b, op, __TMPNAME, __TMPNAME)) ^ coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ coreboot/util/cbfstool/cbfstool.c:546:19: note: in expansion of macro 'MAX' uint32_t size = MAX(hs, param.padding); ^ and the same problem for line 957: MAX(bootblock.size, sizeof(int32_t));
Is __builtin_constant_p() guaranteed to return a constant value? I get the impression it's not: https://www.lkml.org/lkml/2018/3/18/268
My crosstools are up to date (e.g. gcc at 8.2.0), but these were built on Unbuntu 14.04 system with gcc 4.8.4. I have a 17.04 VM sitting around, with older xgcc/bin files, and it builds fine. I'm building a plain google/grunt with no configuration changes.