antmicro / zynq-mkbootimage

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

Build fix for gcc 4.9.2 #3

Closed niklas88 closed 7 years ago

niklas88 commented 7 years ago

Using gcc 4.9.2 I got the warning "warning: ISO C99 doesn’t support unnamed structs/unions" as well as an undefined reference for __bswap_32() during linking. Using explicit --std=c11 and __builtin_bswap32() fixes these compiler errors for me.

tgorochowik commented 7 years ago

Hello Niklas,

Thank you for your contribution!

The patches look good, I can confirm that most of the changes are indeed needed for gcc 4.9.

I have one question though, why did you also add the -lm flag do LDLIBS? Is this lib also needed for you for some reason?

Best, Tom

niklas88 commented 7 years ago

You are right, the -lm was part of my investigation for why it didn't find __bswap_32(). I have added a commit to remove the -lm

tgorochowik commented 7 years ago

Ok, that's understandable. Could you please squash the first and the third commit? (So the -lm flag is not removed but never actually added).

niklas88 commented 7 years ago

:+1: great, I always wanted to try this in the real world but felt bad about pushing with --force

tgorochowik commented 7 years ago

Great, thanks! May the --force be with you!