ARM-software / bbr-acs

Arm SystemReady : BBR Compliance Suite
Apache License 2.0
8 stars 28 forks source link

build fail in cross compile env, [-Werror=vla-parameter] #34

Closed WangYin3 closed 1 year ago

WangYin3 commented 1 year ago

command: bbr-acs/sbbr/scripts$ ./build-scripts/build_sbbr.sh output log: .... gcc -c -I ./brotli/c/include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I-I . -I ../Include/X64/ -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Weprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2 brotlic -o brotli/c/dec/bit_reader.o gcc -c -I ./brotli/c/include -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I-I . -I ../Include/X64/ -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Weprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2 brotli brotli/c/dec/decode.o brotli/c/dec/decode.c:2033:41: error: argument 2 of type ‘const uint8_t ’ {aka ‘const unsigned char ’} ter [-Werror=vla-parameter] 2033 | size_t encoded_size, const uint8_t encoded_buffer, size_t decoded_size, | ~~~^~~~~~ In file included from brotli/c/dec/decode.c:7: ./brotli/c/include/brotli/decode.h:204:19: note: previously declared as a variable length array ‘const uie]’ {aka ‘const unsigned char[decoded_size]’} 204 | const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)], | ~~~~^~~~~~~~~~ brotli/c/dec/decode.c:2034:14: error: argument 4 of type ‘uint8_t ’ {aka ‘unsigned char ’} declared as =vla-parameter] 2034 | uint8_t decoded_buffer) { | ~~~^~~~ In file included from brotli/c/dec/decode.c:7: ./brotli/c/include/brotli/decode.h:206:13: note: previously declared as a variable length array ‘uint8_t[a ‘unsigned char[encoded_size]’} 206 | uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]); | ~~^~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: [../Makefiles/footer.makefile:21: brotli/c/dec/decode.o] Error 1 make[2]: Leaving directory '/home/yin/c/acs/bbr-acs/sbbr/scripts/edk2/BaseTools/Source/C/BrotliCompress' make[1]: [GNUmakefile:76: BrotliCompress] Error 2 make[1]: Leaving directory '/home/yin/c/acs/bbr-acs/sbbr/scripts/edk2/BaseTools/Source/C' make: *** [GNUmakefile:19: Source/C] Error 2 make: Leaving directory '/home/yin/c/acs/bbr-acs/sbbr/scripts/edk2/BaseTools'

Build failed: error while running do_build at line 134 in ./build-scripts/build-sct.sh for [][].

chetan-rathore commented 1 year ago

Hello @WangYin3,

Can you share the toolchain version used for compilation?

Thanks, Chetan

WangYin3 commented 1 year ago

Hi Chetan, Attach the toolchain info: aarch64-linux-gnu-gcc -v gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)

chetan-rathore commented 1 year ago

Hi @WangYin3,

We are able to reproduce the issue at our end also, it is due to edk2 tag used in bbr and default toolchain version installed in the machine. Ubuntu 22.XX comes with gcc 11.xx by default.

We are working on using a latest edk2 tag for bbr and will need some time to verify the changes at our side.

Can you please use ubuntu 20.xx or 18.xx where the default gcc toolchain version is not 11.xx to proceed ahead.

Thanks, ACS team

edhay commented 1 year ago

Hi @WangYin3 , The issue is resolved as part of this commit : https://github.com/ARM-software/bbr-acs/commit/151faf8c7e002175255ca80c891e0163b98b1c76

Could you please verify and confirm.

ACS Team