kometbomb / klystrack

A chiptune tracker
http://kometbomb.github.io/klystrack/
Other
485 stars 28 forks source link

failed to build on 32bit powerpc #222

Closed alexmyczko closed 6 years ago

alexmyczko commented 6 years ago
Compiling config.c...
In file included from ../klystron/src/gfx/objhdr.h:32:0,
                 from ../klystron/src/gfx/bgcell.h:30,
                 from ../klystron/src/gfx/tiledescriptor.h:31,
                 from ../klystron/src/gfx/font.h:30,
                 from src/mused.h:30,
                 from src/config.c:27:
src/config.c: In function ‘apply_config’:
../klystron/src/macros.h:91:26: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 #  define CASTTOPTR(t,x) (t*)(Uint64)x
                          ^
src/config.c:87:21: note: in expansion of macro ‘CASTTOPTR’
  change_pixel_scale(CASTTOPTR(void,mused.pixel_scale), 0, 0);
                     ^
../klystron/src/macros.h:91:26: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 #  define CASTTOPTR(t,x) (t*)(Uint64)x
                          ^
src/config.c:90:20: note: in expansion of macro ‘CASTTOPTR’
  change_oversample(CASTTOPTR(void,mused.oversample), 0, 0);
                    ^
cc1: all warnings being treated as errors
Makefile:151: recipe for target 'objs.release/config.o' failed
make[3]: *** [objs.release/config.o] Error 1
make[3]: Leaving directory '/data/klystrack-0.20171212/klystrack'
Makefile:128: recipe for target 'build' failed
make[2]: *** [build] Error 2
make[2]: Leaving directory '/data/klystrack-0.20171212/klystrack'
dh_auto_build: make -j1 CFG=release returned exit code 2
debian/rules:15: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/data/klystrack-0.20171212'
debian/rules:12: recipe for target 'build' failed
make: *** [build] Error 2
alexmyczko commented 6 years ago

There is a few more architectures that did not build (red): https://buildd.debian.org/status/package.php?p=klystrack&suite=unstable

kometbomb commented 6 years ago

The method I use there is terrible but I guess it's unavoidable since I'm not rewriting this in the near future. :) I assume the pointers something like 48 bits wide or so. Need to check if there's a safe way to force it to 64 bits or so.

darkhog commented 6 years ago

Maybe this has something to do with this?

cc1: all warnings being treated as errors

Try turning that option off and see if it builds then.

kometbomb commented 6 years ago

That indeed is what stops the build but it's never good to just ignore warnings. It would probably work right now but what if the pointer type was larger than the provided 64 bits? Better to fix the warning.

2018-01-03 21:50 GMT+02:00 darkhog notifications@github.com:

Maybe this has something to do with this?

cc1: all warnings being treated as errors

Try turning that option off and see if it builds then.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kometbomb/klystrack/issues/222#issuecomment-355108977, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCK6ZWjS3rqrf67CuVbvP9yHafy6tmhks5tG9oAgaJpZM4RJ0lj .

kometbomb commented 6 years ago

I am not able to test all platforms but I just committed a fix here: kometbomb/klystron@ba8e768ad6bd8bec0fb7c0f3b01cb60f02c70013

This ensures the cast is done with a type whose width equals that of a pointer type. Can the build process above be tested with the branch referenced above?

alexmyczko commented 6 years ago

I can test it on 32bit ppc... will report back results here.

alexmyczko commented 6 years ago

works

kometbomb commented 6 years ago

Thanks a lot for testing! I'll merge the klystron PR.