Re: [coreboot] [help]build cbfstool fail with cygwin64
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 : > 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 : >> 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 >> : In function 'yy_init_buffer': >> :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 : >>> * Kurt Qiao [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 -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Re: [coreboot] [help]build cbfstool fail with cygwin64
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 : In function 'yy_init_buffer': :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 : > * Kurt Qiao [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 -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Re: [coreboot] [help]build cbfstool fail with cygwin64
don't know why my email didn't receive in the list, so i reply again: i finally built pass with define: CFLAGS += -std=gnu99 in cbfstool/Makefile TOOLCFLAGS ?= -std=gnu99 in cbfstool/Makefile.inc and 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') { -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
[coreboot] [help]build cbfstool fail with cygwin64
does anyone try cygwin64 to build coreboot in windows7 64bit? i got fail when build cbfstool with cygwin64. my steps as below: 1. cygwin64 install utility "patch", "flex", 'wget' etc. 2. git pull latest coreboot from github build crossgcc ./buildgcc -j 4 3. build iasl download src from link [1] make cp acpica-unix-20150818/generate/unix/bin/iasl /usr/local/bin 4. make menuconfig choose "emulation/qemu-q35" in my case 5.make then fail as below : In function 'yy_init_buffer': :1395: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 --- i follow link [2] to modify cbfstool makefile, add _D_GNU_SOURCE for TOOLCPPFLAGS, CPPFLAGS and fail as below log. --- Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 432 Optimizations 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 HOSTCC cbfstool/fmap.o HOSTCC cbfstool/kv_pair.o HOSTCC cbfstool/valstr.o HOSTCC cbfstool/fmaptool (link) build/util/cbfstool/fmd.o:fmd.c:(.text+0xa23): undefined reference to `yylex_destroy' build/util/cbfstool/fmd.o:fmd.c:(.text+0xa23): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `yylex_destroy' build/util/cbfstool/fmd.o:fmd.c:(.rdata$.refptr.yyin[.refptr.yyin]+0x0): undefined reference to `yyin' build/util/cbfstool/fmd_parser.o:fmd_parser.c:(.text+0x386): undefined reference to `yylex' build/util/cbfstool/fmd_parser.o:fmd_parser.c:(.text+0x386): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `yylex' collect2: error: ld returned 1 exit status util/cbfstool/Makefile.inc:83: recipe for target 'build/util/cbfstool/fmaptool' failed make: *** [build/util/cbfstool/fmaptool] Error 1 --- [1]:https://acpica.org/sites/acpica/files/acpica-unix-20150818.tar.gz [2]:http://review.coreboot.org/#/c/10027/1 -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
[coreboot] Build Coreboot Google Rambi SPD fail with ubuntu dash shell
Hi everyone, i just met a problem when i try to build coreboot google mainboard rambi, the spd.bin got incorrect content, and thanks for help from the great pgeorgi, finally problem solved. root cause: ubuntu 12.04 x86_64, and default shell use dash. solution: change to use bash as default, you can just 'sudo dpkg-reconfigure dash', and choose 'no'. the rambi spd make file may be updated to solve problem, hope my share can help other people like me, it really confuse me for couple of hours. -below's in detail- i use ubuntu 12.04 x86_64, with gcc46 1. i git coreboot with git clone http://review.coreboot.org/p/coreboot 2. make menuconfig and select mainboard with google/rambi 3. make and everything goes well with build success. but when i check the spd.bin file, the content of spd.bin look like below: -spd.bin--- -e -n \x92 -e -n \x11 -e -n \x0b -e -n \x03 ... ... ... - check 'src/mainboard/google/rambi/spd/Makefile.inc', will see below: - ... # Include spd rom data $(SPD_BIN): $(SPD_DEPS) for f in $+; \ do for c in $$(cat $$f | grep -v ^#); \ do echo -e -n "\\x$$c"; \ done; \ done > $@ ... when i modify the makefile to use 'printf' instead of 'echo -e -n', nothing in spd.bin after build. as patrick said, printf should also work when use dash. i still have no idea why this problem happened to me. thanks again for patrick and paule. BR, kurtqiao -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot