antmicro / zynq-mkbootimage

An open source replacement of the Xilinx bootgen application.
BSD 2-Clause "Simplified" License
99 stars 49 forks source link

Failure to build on newer compilers #21

Closed midicase closed 2 years ago

midicase commented 2 years ago

Newer compilers (I think gcc 10 and newer) will fail on declaring variables in headers.

gcc -Isrc -DMKBOOTIMAGE_VER="\"mkbootimage 2.2-4ee42d7\"" -Wall -Wextra -Wpedantic --std=c11  src/bif.o src/bootrom.o src/common.o src/mkbootimage.o src/arch/common.o src/arch/zynq.o src/arch/zynqmp.o src/file/bitstream.o src/file/elf.o -o mkbootimage -lpcre -lelf
/usr/bin/ld: src/arch/zynqmp.o:(.data.rel.local+0x0): multiple definition of `zynqmp_bops'; src/mkbootimage.o:(.bss+0x0): first defined here

bootrom_ops_t zynqmp_bops; to extern bootrom_ops_t zynqmp_bops;

in both zynq.h and zynqmp.h is a quick fix.

tgorochowik commented 2 years ago

Hi, thanks for the report!

Please make sure to use the current sources, this has been fixed a while ago: #13

midicase commented 2 years ago

I thought I was using master, but now i see it.

tgorochowik commented 2 years ago

No problem, thanks again!