Hi,
I'm trying to generate a coreboot.rom for this AMD development board and update a board status report in order to avoid deprecation this board.
I'm using the commit f77f2c79c2bb898c123ffe89a0bd1acb5362afc5 (just one before a0a50775) and I get some compilation errors.
The first is from iasl compiling the dsdt.asl file:
Intel ACPI Component Architecture ASL+ Optimizing Compiler/Disassembler version 20191018 Copyright (c) 2000 - 2019 Intel Corporation
coreboot toolchain v547de69 2019-10-18 Error 6154 - Warnings detected during compilation (reporting warnings as errors)
dsdt.asl 403: Device(PCI0) { Warning 3073 - ^ Multiple types (Device object requires either a _HID or _ADR, but not both)
dsdt.asl 1061: Method (_CRS, 0x0, NotSerialized) { Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
ASL Input: dsdt.asl - 22455 bytes 598 keywords 1154 source lines
Compilation failed. 1 Errors, 1 Warnings, 1 Remarks No AML files were generated due to compiler error(s)
The same file with the iasl tool generated by the 4.10 release toolchain works ok.
The second one is from src/commonlib/include/commonlib/helpers.h. I get the next error:
HOSTCC cbfstool/cbfstool.o In file included from <command-line>:0:0: /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c: In function 'cbfs_add_component': /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/compiler.h:57:2: error: first argument to '__builtin_choose_expr' not a constant __builtin_choose_expr(__builtin_constant_p(expr), fallback_expr, expr)) ^ /mnt/develop/bettong/coreboot/develop/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); \ ^ /mnt/develop/bettong/coreboot/develop/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)) ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:560:19: note: in expansion of macro 'MAX' uint32_t size = MAX(hs, param.padding); ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/compiler.h:57:2: error: first argument to '__builtin_choose_expr' not a constant __builtin_choose_expr(__builtin_constant_p(expr), fallback_expr, expr)) ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:40:2: note: in expansion of macro '__TYPEOF_UNLESS_CONST' __TYPEOF_UNLESS_CONST(b, a) var_b = (b); \ ^ /mnt/develop/bettong/coreboot/develop/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)) ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:560:19: note: in expansion of macro 'MAX' uint32_t size = MAX(hs, param.padding); ^ In file included from /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/common.h:25:0, from /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:28: /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:47:25: error: first argument to '__builtin_choose_expr' not a constant #define __CMP(a, b, op) __builtin_choose_expr( \ ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:560:19: note: in expansion of macro 'MAX' uint32_t size = MAX(hs, param.padding); ^ In file included from <command-line>:0:0: /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c: In function 'cbfs_create': /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/compiler.h:57:2: error: first argument to '__builtin_choose_expr' not a constant __builtin_choose_expr(__builtin_constant_p(expr), fallback_expr, expr)) ^ /mnt/develop/bettong/coreboot/develop/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); \ ^ /mnt/develop/bettong/coreboot/develop/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)) ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:971:6: note: in expansion of macro 'MAX' MAX(bootblock.size, sizeof(int32_t)); ^ In file included from /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/common.h:25:0, from /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:28: /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:47:25: error: first argument to '__builtin_choose_expr' not a constant #define __CMP(a, b, op) __builtin_choose_expr( \ ^ /mnt/develop/bettong/coreboot/develop/coreboot/src/commonlib/include/commonlib/helpers.h:56:19: note: in expansion of macro '__CMP' #define MAX(a, b) __CMP(a, b, >) ^ /mnt/develop/bettong/coreboot/develop/coreboot/util/cbfstool/cbfstool.c:971:6: note: in expansion of macro 'MAX' MAX(bootblock.size, sizeof(int32_t)); ^ make: *** [build/util/cbfstool/cbfstool.o] Error 1
I can generate the coreboot.rom using the old iasl tool and patching helpers.h with:
@@ -50,10 +50,10 @@ #endif
#ifndef MIN -#define MIN(a, b) __CMP(a, b, <) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX -#define MAX(a, b) __CMP(a, b, >) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif
#ifndef ABS
but the board_status.sh script then complains $ ./util/board_status/board_status.sh Extracting config.txt from build/coreboot.rom Extracting payload_config from build/coreboot.rom The repository is in a dirty state. Please see the output of 'git status' below. HEAD detached at f77f2c7 Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)
modified: src/commonlib/include/commonlib/helpers.h
no changes added to commit (use "git add" and/or "git commit -a")
How to proceed? Thanks! Jorge