public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Make edk2 fail on Red Hat 8.0
@ 2019-07-05  7:09 Chen, Farrah
  2019-07-05  7:25 ` Liming Gao
  0 siblings, 1 reply; 7+ messages in thread
From: Chen, Farrah @ 2019-07-05  7:09 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Hao, Xudong, Wei, Danmei


[-- Attachment #1.1: Type: text/plain, Size: 1916 bytes --]

Hi,

I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 40
...............
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibInitializeFvStruct':
FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
  strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
.....................

And detailed log attached.
Could anyone provide some advice?


Thanks,
Fan


[-- Attachment #1.2: Type: text/html, Size: 5715 bytes --]

[-- Attachment #2: make_edk2.log --]
[-- Type: application/octet-stream, Size: 44714 bytes --]

Initializing workspace
/home/build/fan/edk2/BaseTools
WORKSPACE: /home/build/fan/edk2
EDK_TOOLS_PATH: /home/build/fan/edk2/BaseTools
CONF_PATH: /home/build/fan/edk2/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
     to /home/build/fan/edk2/Conf/build_rule.txt
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
     to /home/build/fan/edk2/Conf/tools_def.txt
Copying $EDK_TOOLS_PATH/Conf/target.template
     to /home/build/fan/edk2/Conf/target.txt
Building tools no /home/build/fan/edk2/BaseTools/Source/C/bin directory
make: Entering directory '/home/build/fan/edk2/BaseTools'
make -C Source/C
make[1]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C'
Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
mkdir -p .
mkdir ./libs 
make -C Common
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/Common'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  BasePeCoff.c -o BasePeCoff.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  BinderFuncs.c -o BinderFuncs.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  CommonLib.c -o CommonLib.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  Crc32.c -o Crc32.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  Decompress.c -o Decompress.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  EfiCompress.c -o EfiCompress.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  EfiUtilityMsgs.c -o EfiUtilityMsgs.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FirmwareVolumeBuffer.c -o FirmwareVolumeBuffer.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FvLib.c -o FvLib.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  MemoryFile.c -o MemoryFile.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  MyAlloc.c -o MyAlloc.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  OsPath.c -o OsPath.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  ParseGuidedSectionTools.c -o ParseGuidedSectionTools.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  ParseInf.c -o ParseInf.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  PeCoffLoaderEx.c -o PeCoffLoaderEx.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  SimpleFileParsing.c -o SimpleFileParsing.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  StringFuncs.c -o StringFuncs.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  TianoCompress.c -o TianoCompress.o
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  PcdValueCommon.c -o PcdValueCommon.o
ar crs ../libs/libCommon.a BasePeCoff.o BinderFuncs.o CommonLib.o Crc32.o Decompress.o EfiCompress.o EfiUtilityMsgs.o FirmwareVolumeBuffer.o FvLib.o MemoryFile.o MyAlloc.o OsPath.o ParseGuidedSectionTools.o ParseInf.o PeCoffLoaderEx.o SimpleFileParsing.o StringFuncs.o TianoCompress.o PcdValueCommon.o
make[2]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/Common'
mkdir ./bin
make -C VfrCompile VfrLexer.h
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile'
BIN_DIR='.' make -C Pccts/dlg
make[3]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile/Pccts/dlg'
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c dlg_p.c
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c dlg_a.c
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c main.c
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  err.c -o err.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 ../support/set/set.c
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  support.c -o support.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  output.c -o output.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  relabel.c -o relabel.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  automata.c -o automata.o
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -o ./dlg dlg_p.o dlg_a.o main.o err.o set.o support.o output.o relabel.o automata.o
make[3]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile/Pccts/dlg'
BIN_DIR='.' make -C Pccts/antlr
make[3]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr'
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  antlr.c -o antlr.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  scan.c -o scan.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  err.c -o err.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  bits.c -o bits.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  build.c -o build.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fset2.c -o fset2.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fset.c -o fset.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  gen.c -o gen.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  globals.c -o globals.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  hash.c -o hash.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  lex.c -o lex.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  main.c -o main.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  misc.c -o misc.o
gcc -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536 -c -o set.o ../support/set/set.c
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  pred.c -o pred.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  egman.c -o egman.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  mrhoist.c -o mrhoist.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fcache.c -o fcache.o
gcc -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536 -o ./antlr antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o
make[3]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr'
Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
Antlr parser generator   Version 1.33MR33   1989-2001
VfrSyntax.g, line 3508: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3517: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3526: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3536: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3566: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3575: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
Pccts/dlg/dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
dlg  Version 1.33MR33   1989-2001

make[2]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile'
make -C BrotliCompress
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/BrotliCompress'
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  tools/brotli.c -o tools/brotli.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  common/dictionary.c -o common/dictionary.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  common/transform.c -o common/transform.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  dec/bit_reader.c -o dec/bit_reader.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  dec/decode.c -o dec/decode.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  dec/huffman.c -o dec/huffman.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  dec/state.c -o dec/state.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/backward_references.c -o enc/backward_references.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/backward_references_hq.c -o enc/backward_references_hq.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/bit_cost.c -o enc/bit_cost.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/block_splitter.c -o enc/block_splitter.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/cluster.c -o enc/cluster.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/compress_fragment.c -o enc/compress_fragment.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/dictionary_hash.c -o enc/dictionary_hash.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/encode.c -o enc/encode.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/encoder_dict.c -o enc/encoder_dict.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/entropy_encode.c -o enc/entropy_encode.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/histogram.c -o enc/histogram.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/literal_cost.c -o enc/literal_cost.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/memory.c -o enc/memory.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/metablock.c -o enc/metablock.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/static_dict.c -o enc/static_dict.o
gcc  -c -I ./include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  enc/utf8_util.c -o enc/utf8_util.o
gcc -o ../bin/Brotli   tools/brotli.o common/dictionary.o common/transform.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/backward_references_hq.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/dictionary_hash.o enc/encode.o enc/encoder_dict.o enc/entropy_encode.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o -L../libs -lm
make[2]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/BrotliCompress'
make -C VfrCompile
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile'
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -O2  Pccts/h/AParser.cpp -o AParser.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -O2  Pccts/h/DLexerBase.cpp -o DLexerBase.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -O2  Pccts/h/ATokenBuffer.cpp -o ATokenBuffer.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  EfiVfrParser.cpp -o EfiVfrParser.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  VfrLexer.cpp -o VfrLexer.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/   -O2  VfrSyntax.cpp -o VfrSyntax.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  VfrFormPkg.cpp -o VfrFormPkg.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  VfrError.cpp -o VfrError.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  VfrUtilityLib.cpp -o VfrUtilityLib.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -Wno-unused-result -O2  VfrCompiler.cpp -o VfrCompiler.o
g++ -o ../bin/VfrCompile  AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o -L../libs -lCommon
make[2]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/VfrCompile'
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function ‘LibInitializeFvStruct’:
FmmtLib.c:158:5: error: ‘memset’ used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function ‘LibFvHeaderAttributeToStr’:
FmmtLib.c:2521:47: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
   strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
                                                                  ^
FmmtLib.c:2528:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_ENABLED_CAP = TRUE \n", sizeof ("EFI_READ_ENABLED_CAP = TRUE \n"));
                                                                 ^
FmmtLib.c:2532:60: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_STATUS = TRUE \n", sizeof ("EFI_READ_STATUS = TRUE \n"));
                                                            ^
FmmtLib.c:2536:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_WRITE_DISABLED_CAP = TRUE \n", sizeof ("EFI_WRITE_DISABLED_CAP = TRUE \n"));
                                                                   ^
FmmtLib.c:2540:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_WRITE_ENABLED_CAP = TRUE \n", sizeof ("EFI_WRITE_ENABLED_CAP = TRUE \n"));
                                                                  ^
FmmtLib.c:2544:61: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_WRITE_STATUS = TRUE \n", sizeof ("EFI_WRITE_STATUS = TRUE \n"));
                                                             ^
FmmtLib.c:2548:57: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_LOCK_CAP = TRUE \n", sizeof ("EFI_LOCK_CAP = TRUE \n"));
                                                         ^
FmmtLib.c:2552:60: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_LOCK_STATUS = TRUE \n", sizeof ("EFI_LOCK_STATUS = TRUE \n"));
                                                            ^
FmmtLib.c:2556:61: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_STICKY_WRITE = TRUE \n", sizeof ("EFI_STICKY_WRITE = TRUE \n"));
                                                             ^
FmmtLib.c:2560:62: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_MEMORY_MAPPED = TRUE \n", sizeof ("EFI_MEMORY_MAPPED = TRUE \n"));
                                                              ^
FmmtLib.c:2564:60: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_ERASE_POLARITY = 1 \n", sizeof ("EFI_ERASE_POLARITY = 1 \n"));
                                                            ^
FmmtLib.c:2568:62: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_LOCK_CAP = TRUE \n", sizeof ("EFI_READ_LOCK_CAP = TRUE \n"));
                                                              ^
FmmtLib.c:2572:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_LOCK_STATUS = TRUE \n", sizeof ("EFI_READ_LOCK_STATUS = TRUE \n"));
                                                                 ^
FmmtLib.c:2576:63: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_WRITE_LOCK_CAP = TRUE \n", sizeof ("EFI_WRITE_LOCK_CAP = TRUE \n"));
                                                               ^
FmmtLib.c:2580:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_WRITE_LOCK_STATUS = TRUE \n", sizeof ("EFI_WRITE_LOCK_STATUS = TRUE \n"));
                                                                  ^
FmmtLib.c:2584:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_LOCK_STATUS = TRUE \n", sizeof ("EFI_READ_LOCK_STATUS = TRUE \n"));
                                                                 ^
FmmtLib.c:2591:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_1 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_1 = TRUE \n"));
                                                                 ^
FmmtLib.c:2593:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_2 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_2 = TRUE \n"));
                                                                 ^
FmmtLib.c:2595:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_4 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_4 = TRUE \n"));
                                                                 ^
FmmtLib.c:2597:65: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_8 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_8 = TRUE \n"));
                                                                 ^
FmmtLib.c:2599:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_16 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_16 = TRUE \n"));
                                                                  ^
FmmtLib.c:2601:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_32 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_32 = TRUE \n"));
                                                                  ^
FmmtLib.c:2603:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_64 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_64 = TRUE \n"));
                                                                  ^
FmmtLib.c:2605:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_128 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_128 = TRUE \n"));
                                                                   ^
FmmtLib.c:2607:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_256 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_256 = TRUE \n"));
                                                                   ^
FmmtLib.c:2609:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_512 = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_512 = TRUE \n"));
                                                                   ^
FmmtLib.c:2611:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_1K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_1K = TRUE \n"));
                                                                  ^
FmmtLib.c:2613:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_2K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_2K = TRUE \n"));
                                                                  ^
FmmtLib.c:2615:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_4K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_4K = TRUE \n"));
                                                                  ^
FmmtLib.c:2617:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_8K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_8K = TRUE \n"));
                                                                  ^
FmmtLib.c:2619:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_16K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_16K = TRUE \n"));
                                                                   ^
FmmtLib.c:2621:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_32K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_32K = TRUE \n"));
                                                                   ^
FmmtLib.c:2623:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_64K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_64K = TRUE \n"));
                                                                   ^
FmmtLib.c:2625:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_128K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_128K = TRUE \n"));
                                                                    ^
FmmtLib.c:2627:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_256K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_256K = TRUE \n"));
                                                                    ^
FmmtLib.c:2629:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_512K = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_512K = TRUE \n"));
                                                                    ^
FmmtLib.c:2631:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_1M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_1M = TRUE \n"));
                                                                  ^
FmmtLib.c:2633:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_2M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_2M = TRUE \n"));
                                                                  ^
FmmtLib.c:2635:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_4M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_4M = TRUE \n"));
                                                                  ^
FmmtLib.c:2637:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_8M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_8M = TRUE \n"));
                                                                  ^
FmmtLib.c:2639:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_16M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_16M = TRUE \n"));
                                                                   ^
FmmtLib.c:2641:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_32M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_32M = TRUE \n"));
                                                                   ^
FmmtLib.c:2643:67: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_64M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_64M = TRUE \n"));
                                                                   ^
FmmtLib.c:2645:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_128M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_128M = TRUE \n"));
                                                                    ^
FmmtLib.c:2647:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_256M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_256M = TRUE \n"));
                                                                    ^
FmmtLib.c:2649:68: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_512M = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_512M = TRUE \n"));
                                                                    ^
FmmtLib.c:2651:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_1G = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_1G = TRUE \n"));
                                                                  ^
FmmtLib.c:2653:66: error: argument to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_FVB2_ALIGNMENT_2G = TRUE \n", sizeof ("EFI_FVB2_ALIGNMENT_2G = TRUE \n"));
                                                                  ^
FmmtLib.c: In function ‘LibFvHeaderOptionToStr.part.3’:
FmmtLib.c:2722:3: error: ‘strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   strncat (LocalStr, TempStr, strlen(TempStr));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FmmtLib.c:2726:3: error: ‘strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   strncat (LocalStr, TempStr, strlen(TempStr));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../Makefiles/footer.makefile:21: FmmtLib.o] Error 1
make[2]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
make[1]: *** [GNUmakefile:77: FMMT] Error 2
make[1]: Leaving directory '/home/build/fan/edk2/BaseTools/Source/C'
make: *** [GNUmakefile:19: Source/C] Error 2
make: Leaving directory '/home/build/fan/edk2/BaseTools'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make edk2 fail on Red Hat 8.0
  2019-07-05  7:09 Make edk2 fail on Red Hat 8.0 Chen, Farrah
@ 2019-07-05  7:25 ` Liming Gao
  2019-07-05  7:33   ` [edk2-devel] " Gary Lin
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Liming Gao @ 2019-07-05  7:25 UTC (permalink / raw)
  To: devel@edk2.groups.io, Chen, Farrah; +Cc: Hao, Xudong, Wei, Danmei

[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]

Can you let me know your GCC compiler version?

From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
Sent: Friday, July 05, 2019 3:10 PM
To: devel@edk2.groups.io
Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0

Hi,

I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 40
...............
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibInitializeFvStruct':
FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
  strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
.....................

And detailed log attached.
Could anyone provide some advice?


Thanks,
Fan



[-- Attachment #2: Type: text/html, Size: 6900 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] Make edk2 fail on Red Hat 8.0
  2019-07-05  7:25 ` Liming Gao
@ 2019-07-05  7:33   ` Gary Lin
  2019-07-05  7:34   ` Chen, Farrah
       [not found]   ` <15AE728890343D4F.21242@groups.io>
  2 siblings, 0 replies; 7+ messages in thread
From: Gary Lin @ 2019-07-05  7:33 UTC (permalink / raw)
  To: devel@edk2.groups.io, liming.gao@intel.com
  Cc: Farrah Chen, Danmei Wei, Xudong Hao

On Fri, Jul 05, 2019 at 07:25:18AM +0000,  Liming Gao  wrote:
> Can you let me know your GCC compiler version?
> 
I also encountered the error. My system is openSUSE Tumbleweed, and the
gcc version is 9.1.1.

It seems the new gcc is restricter on memset and strncat.

Gary Lin

> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
> Sent: Friday, July 05, 2019 3:10 PM
> To: devel@edk2.groups.io
> Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
> Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0
> 
> Hi,
> 
> I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
> With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.
> 
> Steps:
> git clone https://github.com/tianocore/edk2.git
> cd edk2
> git submodule init
> git submodule update -recursive
> OvmfPkg/build.sh -a X64 -n 40
> ...............
> make -C FMMT
> make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
> gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
> FmmtLib.c: In function 'LibInitializeFvStruct':
> FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
>      memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
>      ^~~~~~
> FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
> FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
>   strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
>                                                ^
> FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
>      strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
> .....................
> 
> And detailed log attached.
> Could anyone provide some advice?
> 
> 
> Thanks,
> Fan
> 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make edk2 fail on Red Hat 8.0
  2019-07-05  7:25 ` Liming Gao
  2019-07-05  7:33   ` [edk2-devel] " Gary Lin
@ 2019-07-05  7:34   ` Chen, Farrah
  2019-07-05  7:53     ` Liming Gao
       [not found]   ` <15AE728890343D4F.21242@groups.io>
  2 siblings, 1 reply; 7+ messages in thread
From: Chen, Farrah @ 2019-07-05  7:34 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io; +Cc: Hao, Xudong, Wei, Danmei

[-- Attachment #1: Type: text/plain, Size: 3680 bytes --]

I am using the default GCC of RHEL8.0:

[root@localhost edk2]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)


Thanks,
Fan



From: Gao, Liming
Sent: Friday, July 5, 2019 3:25 PM
To: devel@edk2.groups.io; Chen, Farrah <farrah.chen@intel.com>
Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
Subject: RE: Make edk2 fail on Red Hat 8.0

Can you let me know your GCC compiler version?

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
Sent: Friday, July 05, 2019 3:10 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0

Hi,

I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 40
...............
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibInitializeFvStruct':
FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
  strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
.....................

And detailed log attached.
Could anyone provide some advice?


Thanks,
Fan



[-- Attachment #2: Type: text/html, Size: 10331 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make edk2 fail on Red Hat 8.0
  2019-07-05  7:34   ` Chen, Farrah
@ 2019-07-05  7:53     ` Liming Gao
  2019-07-05  9:14       ` Chen, Farrah
  0 siblings, 1 reply; 7+ messages in thread
From: Liming Gao @ 2019-07-05  7:53 UTC (permalink / raw)
  To: Chen, Farrah, devel@edk2.groups.io; +Cc: Hao, Xudong, Wei, Danmei

[-- Attachment #1: Type: text/plain, Size: 4106 bytes --]

I just send the patch to fix this issue. Can you help verify it?

From: Chen, Farrah
Sent: Friday, July 05, 2019 3:35 PM
To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
Subject: RE: Make edk2 fail on Red Hat 8.0

I am using the default GCC of RHEL8.0:

[root@localhost edk2]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)


Thanks,
Fan



From: Gao, Liming
Sent: Friday, July 5, 2019 3:25 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Chen, Farrah <farrah.chen@intel.com<mailto:farrah.chen@intel.com>>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: RE: Make edk2 fail on Red Hat 8.0

Can you let me know your GCC compiler version?

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
Sent: Friday, July 05, 2019 3:10 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0

Hi,

I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 40
...............
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibInitializeFvStruct':
FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
  strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
.....................

And detailed log attached.
Could anyone provide some advice?


Thanks,
Fan



[-- Attachment #2: Type: text/html, Size: 11399 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] Make edk2 fail on Red Hat 8.0
       [not found]   ` <15AE728890343D4F.21242@groups.io>
@ 2019-07-05  7:57     ` Gary Lin
  0 siblings, 0 replies; 7+ messages in thread
From: Gary Lin @ 2019-07-05  7:57 UTC (permalink / raw)
  To: devel@edk2.groups.io, liming.gao@intel.com
  Cc: Danmei Wei, Farrah Chen, Xudong Hao

On Fri, Jul 05, 2019 at 07:33:17AM +0000,  Gary Lin  wrote:
> On Fri, Jul 05, 2019 at 07:25:18AM +0000,  Liming Gao  wrote:
> > Can you let me know your GCC compiler version?
> > 
> I also encountered the error. My system is openSUSE Tumbleweed, and the
> gcc version is 9.1.1.
> 
> It seems the new gcc is restricter on memset and strncat.
> 
Those warnings are legit.

For example:

  memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);

UiName is CHAR16, so this line should be

  memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH * sizeof(CHAR16));

For those strncat() statements, the third parameter of strncat() stands
for the "available" space in the destination buffer, so using
sizeof(SRC_STR) is actually very dangerous because it doesn't guarantee
that the destination buffer has that many space for the string.

Gary Lin

> Gary Lin
> 
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
> > Sent: Friday, July 05, 2019 3:10 PM
> > To: devel@edk2.groups.io
> > Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
> > Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0
> > 
> > Hi,
> > 
> > I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
> > With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.
> > 
> > Steps:
> > git clone https://github.com/tianocore/edk2.git
> > cd edk2
> > git submodule init
> > git submodule update -recursive
> > OvmfPkg/build.sh -a X64 -n 40
> > ...............
> > make -C FMMT
> > make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
> > gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
> > FmmtLib.c: In function 'LibInitializeFvStruct':
> > FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
> >      memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
> >      ^~~~~~
> > FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
> > FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
> >   strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
> >                                                ^
> > FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
> >      strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
> > .....................
> > 
> > And detailed log attached.
> > Could anyone provide some advice?
> > 
> > 
> > Thanks,
> > Fan
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make edk2 fail on Red Hat 8.0
  2019-07-05  7:53     ` Liming Gao
@ 2019-07-05  9:14       ` Chen, Farrah
  0 siblings, 0 replies; 7+ messages in thread
From: Chen, Farrah @ 2019-07-05  9:14 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io; +Cc: Hao, Xudong, Wei, Danmei

[-- Attachment #1: Type: text/plain, Size: 6382 bytes --]

Thanks!
With this patch, new error occurred in my environment:
......
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
   strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
                                                                  ^
FmmtLib.c:2528:65: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_ENABLED_CAP = TRUE \n", sizeof ("EFI_READ_ENABLED_CAP = TRUE \n"));
                                                                 ^
FmmtLib.c:2532:60: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_STATUS = TRUE \n", sizeof ("EFI_READ_STATUS = TRUE \n"));
..................


Thanks,
Fan



From: Gao, Liming
Sent: Friday, July 5, 2019 3:53 PM
To: Chen, Farrah <farrah.chen@intel.com>; devel@edk2.groups.io
Cc: Hao, Xudong <xudong.hao@intel.com>; Wei, Danmei <danmei.wei@intel.com>
Subject: RE: Make edk2 fail on Red Hat 8.0

I just send the patch to fix this issue. Can you help verify it?

From: Chen, Farrah
Sent: Friday, July 05, 2019 3:35 PM
To: Gao, Liming <liming.gao@intel.com<mailto:liming.gao@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: RE: Make edk2 fail on Red Hat 8.0

I am using the default GCC of RHEL8.0:

[root@localhost edk2]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)


Thanks,
Fan



From: Gao, Liming
Sent: Friday, July 5, 2019 3:25 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Chen, Farrah <farrah.chen@intel.com<mailto:farrah.chen@intel.com>>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: RE: Make edk2 fail on Red Hat 8.0

Can you let me know your GCC compiler version?

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of Chen, Farrah
Sent: Friday, July 05, 2019 3:10 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Hao, Xudong <xudong.hao@intel.com<mailto:xudong.hao@intel.com>>; Wei, Danmei <danmei.wei@intel.com<mailto:danmei.wei@intel.com>>
Subject: [edk2-devel] Make edk2 fail on Red Hat 8.0

Hi,

I tried to make ovmf with the latest commit: 0a487ef96bd6d2e0ac23323adab86f9949068ed6 on Red Hat 8.0, it failed, while it succeed on Red Hat 7.6.
With commit 4b04d9d73604080a42daf737c39b98d4e1245a51 I used several days ago, it works well on both RHEL8.0 and RHEL7.6.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 40
...............
make -C FMMT
make[2]: Entering directory '/home/build/fan/edk2/BaseTools/Source/C/FMMT'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  FmmtLib.c -o FmmtLib.o
FmmtLib.c: In function 'LibInitializeFvStruct':
FmmtLib.c:158:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH);
     ^~~~~~
FmmtLib.c: In function 'LibFvHeaderAttributeToStr':
FmmtLib.c:2521:47: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
  strncat (LocalStr, "[attributes] \n", sizeof("[attributes] \n"));
                                               ^
FmmtLib.c:2524:66: error: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
     strncat (LocalStr, "EFI_READ_DISABLED_CAP = TRUE \n", sizeof ("EFI_READ_DISABLED_CAP = TRUE \n"));
.....................

And detailed log attached.
Could anyone provide some advice?


Thanks,
Fan



[-- Attachment #2: Type: text/html, Size: 17233 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-05  9:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-05  7:09 Make edk2 fail on Red Hat 8.0 Chen, Farrah
2019-07-05  7:25 ` Liming Gao
2019-07-05  7:33   ` [edk2-devel] " Gary Lin
2019-07-05  7:34   ` Chen, Farrah
2019-07-05  7:53     ` Liming Gao
2019-07-05  9:14       ` Chen, Farrah
     [not found]   ` <15AE728890343D4F.21242@groups.io>
2019-07-05  7:57     ` [edk2-devel] " Gary Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox