Compile warnings: alignment

  • kroq-gar78
    19th Aug 2012 Member 0 Permalink

    Hello,

     

    I'm still trying to get The Powder Toy into Debian, but I've recently seen some warnings:

    ../the-powder-toy_81.7-0~ppa3_amd64.build:/usr/bin/ld: Warning: alignment 8 of symbol `gravmap' in build/obj/gravity.powder-64-sse2.o is smaller than 16 in build/obj/luaconsole.powder-64-sse2.o
    ../the-powder-toy_81.7-0~ppa3_amd64.build:/usr/bin/ld: Warning: alignment 8 of symbol `gravmap' in build/obj/gravity.powder-64-sse2.o is smaller than 16 in build/obj/powder.powder-64-sse2.o
    ../the-powder-toy_81.7-0~ppa3_amd64.build:/usr/bin/ld: Warning: alignment 8 of symbol `gravmap' in build/obj/gravity.powder-64-sse2.o is smaller than 16 in build/obj/elements/gbmb.powder-64-sse2.o
    ../the-powder-toy_81.7-0~ppa3_amd64.build:/usr/bin/ld: Warning: alignment 8 of symbol `gravmap' in build/obj/gravity.powder-64-sse2.o is smaller than 16 in build/obj/elements/nbhl.powder-64-sse2.o
    ../the-powder-toy_81.7-0~ppa3_amd64.build:/usr/bin/ld: Warning: alignment 8 of symbol `gravmap' in build/obj/gravity.powder-64-sse2.o is smaller than 16 in build/obj/elements/nwhl.powder-64-sse2.o

     

    I think fixing these warnings will encourage some package sponsors to upload the package into Debian. I've seen some Fedora users on the Fedora Forums having the same problems, too, so it's not just an Ubuntu/Debian problem.

     

    If you're curious, my branch for Debian packaging is here: https://github.com/kroq-gar78/The-Powder-Toy_deb

     

    If you have any suggestions, please tell me.

     

    Thanks in advance!

  • jacksonmj
    20th Aug 2012 Developer 1 Permalink
    Does adding
    extern
    before all the variable declarations on lines 26-36 of includes/gravity.h fix it? (It doesn't seem to happen for me, but that might be because I'm not using a 64 bit computer)
  • kroq-gar78
    21st Aug 2012 Member 0 Permalink

    Yep, looks like that did it, and I can also confirm that it doesn't happen to non-amd64 processors. Will this cause any problems for non-64bit processors (I don't know much C)?

  • plypencil
    21st Aug 2012 Member 0 Permalink

    When compiling for raspberry pi I got the same warnings with my compiler. No noticeable problems though.

     

    Raspberry PI is 32 bit AFAIK

  • kroq-gar78
    21st Aug 2012 Member 0 Permalink

    @plypencil (View Post)

     Hmm... I don't seem to be getting these warnings on my Raspberry Pi. My branch is 'raspi' in the repository listed above, if you're interested. If you want, you can try to compile using that branch and see if the errors persist... and yes, I think the raspi is 32-bit.

  • plypencil
    21st Aug 2012 Member 0 Permalink

    I am now adopting raspi....so much easier than saying the whole thing.

     

    Did you remove the CPU checks in your raspi build?

  • kroq-gar78
    21st Aug 2012 Member 0 Permalink

    @plypencil (View Post)

     Yes, it compiles perfectly and builds .deb's, too. Note that you must manually apply the patch using "patch -i debian/patches/raspi-fix-compile.patch -p1". Then run "make powder" and it should work fine.

  • plypencil
    21st Aug 2012 Member 0 Permalink

    I just changed the code to make it work...new to compiling to its simpler for me xD lol