[coreboot] [help]build cbfstool fail with cygwin64

Kurt Qiao kurtqqh at gmail.com
Thu Sep 17 11:34:17 CEST 2015


hi
i finally built pass with define
CFLAGS += -std=gnu99  in cbfstool/Makefile
TOOLCFLAGS ?= -std=gnu99  in cbfstool/Makefile.inc

change cbfstool.c code to :
--  if (tolower(suffix[0])=='k') {
++ if (tolower((int)suffix[0])=='k') {

--  if (tolower(suffix[0])=='m') {
++ if (tolower((int)suffix[0])=='m') {

is there anyway to dynamic define std to gnu99 when detect build with cygwin?


2015-09-15 21:05 GMT+08:00 Kurt Qiao <kurtqqh at gmail.com>:
> sorry for typo, fix step 1 code:
>
> so i change my cbfstool.c code to :
> --  if (tolower(suffix[0])=='k') {
> ++ if (tolower((int)suffix[0])=='k') {
>
> --  if (tolower(suffix[0])=='m') {
> ++ if (tolower((int)suffix[0])=='m') {
>
> 2015-09-15 21:01 GMT+08:00 Kurt Qiao <kurtqqh at gmail.com>:
>> do a quick update here, thanks for Stefan, the solution seems part of
>> work for me
>>
>> 1. i changed to cygwin(32bit) due to cygwin64 always got fail, but i
>> got same fail with cygwin, so below update i based on cygwin.
>>
>> 2. default build will error as below,
>> HOSTCC     cbfstool/cbfstool.o
>> /cygdrive/d/FW/coreboot/util/cbfstool/cbfstool.c: In function 'main':
>> /cygdrive/d/FW/coreboot/util/cbfstool/cbfstool.c:1075:5: error: array
>> subscript has type 'char' [-Werror=char-subscripts]
>>      if (tolower(suffix[0])=='k') {
>>      ^
>> /cygdrive/d/FW/coreboot/util/cbfstool/cbfstool.c:1078:5: error: array
>> subscript has type 'char' [-Werror=char-subscripts]
>>      if (tolower(suffix[0])=='m') {
>>      ^
>>
>> so i change my cbfstool.c code to :
>> --  if (tolower(suffix[0])=='k') {
>> ++ if ((int)tolower(suffix[0])=='k') {
>>
>> --  if (tolower(suffix[0])=='m') {
>> ++ if ((int)tolower(suffix[0])=='m') {
>>
>>
>> 3. patch 11636 works, so build pass util/cbfstool/common.c
>> but patch 11637 will fail with function '_fileno'
>>     HOSTCC     cbfstool/fmaptool.o
>>     HOSTCC     cbfstool/cbfs_sections.o
>>     HOSTCC     cbfstool/fmap_from_fmd.o
>>     HOSTCC     cbfstool/fmd.o
>>     HOSTCC     cbfstool/fmd_parser.o
>>     HOSTCC     cbfstool/fmd_scanner.o
>> <stdout>: In function 'yy_init_buffer':
>> <stdout>:1399:9: error: implicit declaration of function '_fileno'
>> [-Werror=implicit-function-declaration]
>> cc1: all warnings being treated as errors
>> util/cbfstool/Makefile.inc:59: recipe for target
>> 'build/util/cbfstool/fmd_scanner.o' failed
>> make: *** [build/util/cbfstool/fmd_scanner.o] Error 1
>>
>>
>> 2015-09-15 2:07 GMT+08:00 Stefan Reinauer <stefan.reinauer at coreboot.org>:
>>> * Kurt Qiao <kurtqqh at gmail.com> [150909 09:42]:
>>>> does anyone try cygwin64 to build coreboot in windows7 64bit?
>>>> i got fail when build cbfstool with cygwin64.
>>>
>>> Can you try the following two patches to see if they solve your problem
>>>
>>> http://review.coreboot.org/11636 Don't use fileno() to get file size
>>> http://review.coreboot.org/11637 fmd: Use _fileno() on MINGW
>>>
>>> Also, if that doesn't work try to replace the MINGW check with something
>>> like #if defined (_WIN64) || defined (__CYGWIN64__) instead.
>>>
>>> (Make sure to run make clean in the cbfstool directory before trying)
>>>
>>> Stefan



More information about the coreboot mailing list