-
Notifications
You must be signed in to change notification settings - Fork 44
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
Compilation Error #92
Comments
Can you share more on your building environment ? |
I run a self-built LFS-referenced variant. (Sort of experimental toy: https://github.com/smileaf419/spkg) |
Ok, let me try to reproduce and come back to you. |
To provide more context, ares currently builds all C source files, including those from libchdr, with -std=c11. This causes There are many macros supported by glibc that can influence these definitions:
References: For ares, we can work around this by tweaking the flags passed to the compiler, but there's an opportunity to make the following code more robust across varying compilation environments. Lines 2973 to 2988 in fec8ab9
There are a couple of issues with this code as it stands:
There are a lot of options for which macros to define, of course. One or more of As an aside, none of this seems to be an issue with BSD libc. It defines fseeko/ftello even with -std=c11 and the offsets are always 64-bit. I have not examined other C standard library implementations. |
ares-emulator/ares#1102 Enforce using GCC due to another bug in libchdr rtissera/libchdr#92
Using: cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_SYSTEM_ZLIB=1 -DCMAKE_C_COMPILER=clang -D CMAKE_C_STANDARD=11 -D CMAKE_C_EXTENSIONS=0
-- The C compiler identification is Clang 16.0.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ZLIB: /lib/libz.so (found version "1.2.13")
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /var/tmp/spkg/libchdr-master/build
[ 4%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/Alloc.c.o
[ 8%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/Bra86.c.o
[ 12%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/BraIA64.c.o
[ 16%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/CpuArch.c.o
[ 20%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/Delta.c.o
[ 24%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/LzFind.c.o
[ 28%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/Lzma86Dec.c.o
[ 32%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/LzmaDec.c.o
[ 36%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/LzmaEnc.c.o
[ 40%] Building C object deps/lzma-22.01/CMakeFiles/lzma.dir/src/Sort.c.o
[ 44%] Linking C static library liblzma.a
[ 44%] Built target lzma
[ 48%] Building C object CMakeFiles/chdr-static.dir/src/libchdr_bitstream.c.o
[ 52%] Building C object CMakeFiles/chdr-static.dir/src/libchdr_cdrom.c.o
[ 56%] Building C object CMakeFiles/chdr-static.dir/src/libchdr_chd.c.o
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:814:10: warning: implicit conversion from enumeration type 'enum huffman_error' to different enumeration type 'chd_error' (aka 'enum _chd_error') [-Wenum-conversion]
return err;
~~~~~~ ^~~
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2993:6: error: call to undeclared function 'ftello'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
p = core_stdio_ftell_impl(fp);
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2987:32: note: expanded from macro 'core_stdio_ftell_impl'
#define core_stdio_ftell_impl ftello
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2993:6: note: did you mean 'ftell'?
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2987:32: note: expanded from macro 'core_stdio_ftell_impl'
#define core_stdio_ftell_impl ftello
^
/usr/include/stdio.h:718:17: note: 'ftell' declared here
extern long int ftell (FILE *__stream) __wur;
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2994:2: error: call to undeclared function 'fseeko'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
core_stdio_fseek_impl(fp, 0, SEEK_END);
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2986:32: note: expanded from macro 'core_stdio_fseek_impl'
#define core_stdio_fseek_impl fseeko
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2994:2: note: did you mean 'fseek'?
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2986:32: note: expanded from macro 'core_stdio_fseek_impl'
#define core_stdio_fseek_impl fseeko
^
/usr/include/stdio.h:713:12: note: 'fseek' declared here
extern int fseek (FILE __stream, long int __off, int __whence);
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:3031:9: error: call to undeclared function 'fseeko'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
return core_stdio_fseek_impl((FILE)file->argp, offset, whence);
^
/var/tmp/spkg/libchdr-master/src/libchdr_chd.c:2986:32: note: expanded from macro 'core_stdio_fseek_impl'
#define core_stdio_fseek_impl fseeko
^
1 warning and 3 errors generated.
make[2]: *** [CMakeFiles/chdr-static.dir/build.make:104: CMakeFiles/chdr-static.dir/src/libchdr_chd.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/chdr-static.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
The text was updated successfully, but these errors were encountered: