You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the error when building PCem v17 with musl libc:
$ make
Making all in src
make[1]: Entering directory '/home/ellie/pcem/src'
gcc -DPACKAGE_NAME=\"PCem\" -DPACKAGE_TARNAME=\"pcem\" -DPACKAGE_VERSION=\"v17\" -DPACKAGE_STRING=\"PCem\ v17\" -DPACKAGE_BUGREPORT=\"Sarah\ Walker\ \<[email protected]\>\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pcem\" -DVERSION=\"v17\" -DHAVE_LIBPTHREAD=1 -DHAVE_LIBGL=1 -DHAVE_LIBOPENAL=1 -I. -I/usr/lib/wx/include/gtk3-unicode-3.2 -I/usr/include/wx-3.2 -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -pthread -I/usr/include/SDL2 -D_REENTRANT -O3 -fcommon -MT pcem-wx-config.o -MD -MP -MF .deps/pcem-wx-config.Tpo -c -o pcem-wx-config.o `test -f 'wx-config.c' || echo './'`wx-config.c
wx-config.c:1465:39: error: unknown type name 'off64_t'; did you mean 'off_t'?
1465 | static void check_hd_type(void* hdlg, off64_t sz)
| ^~~~~~~
| off_t
wx-config.c: In function 'hdnew_dlgproc':
wx-config.c:1810:37: error: implicit declaration of function 'fopen64'; did you mean 'fopen'? [-Wimplicit-function-declaration]
1810 | f = fopen64(hd_new_name, "wb");
| ^~~~~~~
| fopen
wx-config.c:1810:35: error: assignment to 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1810 | f = fopen64(hd_new_name, "wb");
| ^
wx-config.c: In function 'hd_file':
wx-config.c:2221:17: error: unknown type name 'off64_t'; did you mean 'off_t'?
2221 | off64_t sz;
| ^~~~~~~
| off_t
wx-config.c:2222:27: error: initialization of 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2222 | FILE *f = fopen64(openfilestring, "rb");
| ^~~~~~~
wx-config.c:2274:25: error: implicit declaration of function 'fseeko64'; did you mean 'fseeko'? [-Wimplicit-function-declaration]
2274 | fseeko64(f, -1, SEEK_END);
| ^~~~~~~~
| fseeko
wx-config.c:2275:30: error: implicit declaration of function 'ftello64'; did you mean 'ftello'? [-Wimplicit-function-declaration]
2275 | sz = ftello64(f) + 1;
| ^~~~~~~~
| ftello
wx-config.c:2277:25: error: implicit declaration of function 'check_hd_type' [-Wimplicit-function-declaration]
2277 | check_hd_type(hdlg, sz);
| ^~~~~~~~~~~~~
make[1]: *** [Makefile:5123: pcem-wx-config.o] Error 1
make[1]: Leaving directory '/home/ellie/pcem/src'
make: *** [Makefile:365: all-recursive] Error 1
To Reproduce
Steps to reproduce the behavior:
Set up any musl libc Linux, e.g. Alpine. A container or a VM should work as well.
Build PCem 17 with configure and make as usual.
Expected behavior
The build works, which doesn't seem to be the case. This seems to be due to a problem with how the 64-bit file access functions are used.
Screenshots
If applicable, add screenshots to help explain your problem.
Emulator configuration
I didn't get that far.
Host machine
OS: Alpine
Emulator version: PCem v17
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently, PCem doesn't seem to build with musl libc. Based on https://stackoverflow.com/questions/14184031/what-is-the-difference-between-largefile-source-and-file-offset-bits-64 and on https://gitlab.alpinelinux.org/alpine/aports/-/issues/16851#note_474717 when compiling with
-D_FILE_OFFSET_BITS=64
but without-D_LARGEFILE64_SOURCE
, C/C++ code is apparently expected to useftell()
,fopen()
etc. and notftell64()
/fopen64()
which PCem v17 seems to be doing. This seems to cause issues compiling with musl libc. The solution seems to be to either stop using the 64 prefix, or to define-D_LARGEFILE64_SOURCE
as well.Here is the error when building PCem v17 with musl libc:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The build works, which doesn't seem to be the case. This seems to be due to a problem with how the 64-bit file access functions are used.
Screenshots
If applicable, add screenshots to help explain your problem.
Emulator configuration
I didn't get that far.
Host machine
Additional context
The text was updated successfully, but these errors were encountered: