Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL1 port no longer compiles on Open Pandora #21

Closed
sviscapi opened this issue Oct 27, 2018 · 3 comments
Closed

SDL1 port no longer compiles on Open Pandora #21

sviscapi opened this issue Oct 27, 2018 · 3 comments

Comments

@sviscapi
Copy link

Hi,

I'm Sam aka Magic Sam from the Open Pandora community, an handheld computer running GNU/Linux ARM (TI OMAP3). We chatted (with @wasamasa too) on IRC some days ago :)

https://www.pyra-handheld.com/boards/pages/pandora/

I'm trying to build Interim OS' SDL1 port with GCC 8.1, since I'm not too comfortable with SDL2...

My build script reads as follows:

/media/Pandora1/dev/interim/sledge$ cat build_pandora.sh
#!/bin/sh

if [ uname = "Darwin" ] ; then
CFLAGS="${CFLAGS} -I/opt/local/include -L/opt/local/lib -framework Cocoa"
fi

if [ uname -n = "pandora" ] ; then
CFLAGS="${CFLAGS} -I/mnt/utmp/codeblocks/usr/include -L/mnt/utmp/codeblocks/usr/lib"
fi

cc -g -o sledge --std=gnu99 -Wall -O1 -I. ${CFLAGS} sledge.c reader.c writer.c alloc.c strmap.c stream.c ../devices/sdl.c ../devices/posixfs.c -lm -lSDL -DCPU_ARM -DDEV_SDL -DDEV_POSIXFS

Default CFLAGS on the Pandora are:

-ffast-math -O3 -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -fsingle-precision-constant -fuse-ld=gold -fuse-linker-plugin -fsigned-char

Unfortunately, the compilation fails with this error:

/media/Pandora1/dev/interim/sledge$ ./build_pandora.sh
In file included from sledge.c:9:
compiler_new.c:58:14: warning: ���jit_out��� defined but not used [-Wunused-variable]
static FILE* jit_out;
^~~~~~~
writer.c: In function ���write_���:
writer.c:166:39: warning: format ���%ld��� expects argument of type ���long int���, but argument 4 has type ���uint32_t��� {aka ���unsigned int���} [-Wformat=]
snprintf(buffer, bufsize, "tag:%ld", cell->tag);
~~^ ~~~~~~~~~
%d
../devices/sdl.c: In function ���fbfs_mmap���:
../devices/sdl.c:89:11: error: ���Cell��� {aka ���struct Cell���} has no member named ���addr���; did you mean ���ar���?
fbtest->addr = sdl_get_fb();
^~~~
ar
../devices/sdl.c:90:9: error: ���Cell��� {aka ���struct Cell���} has no member named ���size���
fbtest->size = sdl_get_fbsize();
^~
../devices/sdl.c:91:39: error: ���Cell��� {aka ���struct Cell���} has no member named ���addr���; did you mean ���ar���?
printf("fbtest->addr: %p\n",fbtest->addr);
^~~~
ar
../devices/sdl.c:92:38: error: ���Cell��� {aka ���struct Cell���} has no member named ���size���
printf("fbtest->size: %lx\n",fbtest->size);
^~
../devices/sdl.c:94:18: error: ���Cell��� {aka ���struct Cell���} has no member named ���addr���; did you mean ���ar���?
memset(fbtest->addr,0xff,WIDTHHEIGHTBPP);
^~~~
ar
../devices/sdl.c: In function ���keyfs_read���:
../devices/sdl.c:131:19: error: ���Cell��� {aka ���struct Cell���} has no member named ���addr���; did you mean ���ar���?
((uint8_t*)res->addr)[0] = sdl_key;
^~~~
ar
At top level:
../devices/sdl.c:73:12: warning: ���cursor_y��� defined but not used [-Wunused-variable]
static int cursor_y = 0;
^~~~~~~~
../devices/sdl.c:72:12: warning: ���cursor_x��� defined but not used [-Wunused-variable]
static int cursor_x = 0;
^~~~~~~~
../devices/sdl.c:71:12: warning: ���fb_state��� defined but not used [-Wunused-variable]
static int fb_state = 0;
^~~~~~~~
../devices/posixfs.c: In function ���posixfs_open���:
../devices/posixfs.c:65:56: warning: format ���%zu��� expects argument of type ���size_t���, but argument 2 has type ���off_t��� {aka ���long int���} [-Wformat=]
printf("[posixfs] trying to read file of len %zu...\r\n",len);
~~^ ~~~
%lu

Could you please have a look ?

Best regards,

Sam

@wasamasa
Copy link
Contributor

wasamasa commented Nov 1, 2018

Hey Sam,

I've gone through the files and updated them to roughly match the SDL2 device. See #22 for the fix. You'll need to adjust the related build script to use -lSDL, but I'm sure you've figured out that one already. I've tested https://github.com/wasamasa/interim/blob/next/sledge/demos/palette.l and it works as expected. Further fixes may be necessary to achieve feature parity.

@sviscapi
Copy link
Author

sviscapi commented Nov 3, 2018

@wasamasa : thank you very much for your time and efforts, that's really appreciated :D Could you (or @mntmn) please tell me how to fetch your changes from your repo's SDL1.2 branch into my local copy of @mntmn 's reform branch (required on hosted ARM) ?

If that's not convenient and / or not the right thing to do, I may as well wait for @mntmn to accept your pull request, there's no hurry :)

Cheers, Sam

@wasamasa
Copy link
Contributor

wasamasa commented Nov 3, 2018

The easiest way is downloading the raw patch at https://patch-diff.githubusercontent.com/raw/mntmn/interim/pull/22.patch and applying it with git apply 22.patch.

@mntmn mntmn closed this as completed in 8d3fdf6 Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants