Closed Wohlstand closed 6 years ago
Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).
The errno warning is more concerning, that seems to indicate a build system confusion. There was a similar bug report recently with issue #16, but I was never able to figure out anything there other than that the build system seems broken somehow (even if it worked with 0.6.2).
The signed compare warning is less of a concern, though I'll want to fix it anyways (god knows we've had enough integer confusion bugs in the past year or so).
I'm not sure what to make of the __assert_func
stuff, it feels like another build system hangup. By its name it would be used in the C standard "assert
" function that we use -- but we used that in 0.6.2 (and much much earlier) as well. I did some searching myself and came to a suggestion from this page involving adding additional Cygwin libraries.
You could also try less optimized linker flags (e.g. you seem to be using --as-needed
, might try without that and see if it at least links properly).
If you're comfortable with git-bisect
then you might try to see if you could find the offending git commit (somewhere between the 0.6.2 tag and current master), that would help narrow it down as well.
Either way if you do figure out something please let me know so I can at least get any buildsystem-specific notes documented since it seems like a repeated issue. I'm not trying to make this harder to build. :)
Original comment by Reino17 (Bitbucket: Reino17, GitHub: Reino17).
I spent a lot of time trying to add -lcygwin
, but it was all in vain.
After closely examining 'CMakeCache.txt' however I noticed:
ZLIB_INCLUDE_DIR:PATH=/usr/include
ZLIB_LIBRARY:FILEPATH=/usr/lib/libz.dll.a
I find it strange that this is the only place to find out that these parameters exist at all. 'CMakeLists.txt' and neither 'readme.txt' mention anything about this.
Anyway, this meant LibGME was using Cygwin's own zlib library (v1.2.8) instead of zlib 1.2.11 that I had compiled and installed in my MingW directory. And thus after changing ZLIB_INCLUDE_DIR
and ZLIB_LIBRARY
:
cmake -G"Unix Makefiles" . -DENABLE_STATIC_RUNTIME=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RANLIB=/cygdrive/m/[...]/bin/i686-w64-mingw32-ranlib -DCMAKE_C_COMPILER=/cygdrive/m/[...]/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=/cygdrive/m/[...]/bin/i686-w64-mingw32-g++ -DCMAKE_RC_COMPILER=/cygdrive/m/[...]/bin/i686-w64-mingw32-windres -DCMAKE_INSTALL_PREFIX=/cygdrive/m/[...]/i686-w64-mingw32 -DBUILD_SHARED_LIBS=0 -DENABLE_UBSAN=0 -DZLIB_INCLUDE_DIR=/cygdrive/m/[...]/i686-w64-mingw32/include -DZLIB_LIBRARY=/cygdrive/m/[...]/i686-w64-mingw32/lib/libz.a
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /cygdrive/m/[...]/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /cygdrive/m/[...]/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /cygdrive/m/[...]/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /cygdrive/m/[...]/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test __LIBGME_TEST_VISIBILITY
-- Performing Test __LIBGME_TEST_VISIBILITY - Success
-- Performing Test __LIBGME_SWITCH_FALLTHROUGH_WARNINGS
-- Performing Test __LIBGME_SWITCH_FALLTHROUGH_WARNINGS - Success
** ZLib library located, compressed file formats will be supported
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
ENABLE_STATIC_RUNTIME
-- Build files have been written to: /cygdrive/m/[...]/game-music-emu_git
Doing make in /cygdrive/m/[...]/game-music-emu_git as make -j 1
Scanning dependencies of target gme
[ 2%] Building CXX object gme/CMakeFiles/gme.dir/Blip_Buffer.cpp.obj
[ 4%] Building CXX object gme/CMakeFiles/gme.dir/Classic_Emu.cpp.obj
[ 6%] Building CXX object gme/CMakeFiles/gme.dir/Data_Reader.cpp.obj
/cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp: In member function 'virtual long int Std_File_Reader::read_avail(void*, long int)':
/cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp:375:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ( file_ && s > 0 && s <= UINT_MAX ) {
^
In file included from /cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp:21:0:
/cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp: In member function 'virtual const char* Std_File_Reader::read(void*, long int)':
/cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp:389:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
RETURN_VALIDITY_CHECK( s > 0 && s <= UINT_MAX );
^
/cygdrive/m/[...]/game-music-emu_git/gme/blargg_source.h:28:44: note: in definition of macro 'unlikely'
#define unlikely( x ) __builtin_expect(x, 0)
^
/cygdrive/m/[...]/game-music-emu_git/gme/Data_Reader.cpp:389:2: note: in expansion of macro 'RETURN_VALIDITY_CHECK'
RETURN_VALIDITY_CHECK( s > 0 && s <= UINT_MAX );
^~~~~~~~~~~~~~~~~~~~~
[ 8%] Building CXX object gme/CMakeFiles/gme.dir/Dual_Resampler.cpp.obj
[ 10%] Building CXX object gme/CMakeFiles/gme.dir/Effects_Buffer.cpp.obj
[ 12%] Building CXX object gme/CMakeFiles/gme.dir/Fir_Resampler.cpp.obj
[ 14%] Building CXX object gme/CMakeFiles/gme.dir/gme.cpp.obj
[ 17%] Building CXX object gme/CMakeFiles/gme.dir/Gme_File.cpp.obj
[ 19%] Building CXX object gme/CMakeFiles/gme.dir/M3u_Playlist.cpp.obj
[ 21%] Building CXX object gme/CMakeFiles/gme.dir/Multi_Buffer.cpp.obj
[ 23%] Building CXX object gme/CMakeFiles/gme.dir/Music_Emu.cpp.obj
[ 25%] Building CXX object gme/CMakeFiles/gme.dir/Ay_Apu.cpp.obj
[ 27%] Building CXX object gme/CMakeFiles/gme.dir/Ym2612_Emu.cpp.obj
[ 29%] Building CXX object gme/CMakeFiles/gme.dir/Sms_Apu.cpp.obj
[ 31%] Building CXX object gme/CMakeFiles/gme.dir/Ay_Cpu.cpp.obj
[ 34%] Building CXX object gme/CMakeFiles/gme.dir/Ay_Emu.cpp.obj
[ 36%] Building CXX object gme/CMakeFiles/gme.dir/Gb_Apu.cpp.obj
[ 38%] Building CXX object gme/CMakeFiles/gme.dir/Gb_Cpu.cpp.obj
[ 40%] Building CXX object gme/CMakeFiles/gme.dir/Gb_Oscs.cpp.obj
[ 42%] Building CXX object gme/CMakeFiles/gme.dir/Gbs_Emu.cpp.obj
[ 44%] Building CXX object gme/CMakeFiles/gme.dir/Gym_Emu.cpp.obj
[ 46%] Building CXX object gme/CMakeFiles/gme.dir/Hes_Apu.cpp.obj
[ 48%] Building CXX object gme/CMakeFiles/gme.dir/Hes_Cpu.cpp.obj
[ 51%] Building CXX object gme/CMakeFiles/gme.dir/Hes_Emu.cpp.obj
[ 53%] Building CXX object gme/CMakeFiles/gme.dir/Kss_Cpu.cpp.obj
[ 55%] Building CXX object gme/CMakeFiles/gme.dir/Kss_Emu.cpp.obj
[ 57%] Building CXX object gme/CMakeFiles/gme.dir/Kss_Scc_Apu.cpp.obj
[ 59%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Apu.cpp.obj
[ 61%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Cpu.cpp.obj
[ 63%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Fme7_Apu.cpp.obj
[ 65%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Namco_Apu.cpp.obj
[ 68%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Oscs.cpp.obj
[ 70%] Building CXX object gme/CMakeFiles/gme.dir/Nes_Vrc6_Apu.cpp.obj
[ 72%] Building CXX object gme/CMakeFiles/gme.dir/Nsf_Emu.cpp.obj
[ 74%] Building CXX object gme/CMakeFiles/gme.dir/Nsfe_Emu.cpp.obj
[ 76%] Building CXX object gme/CMakeFiles/gme.dir/Sap_Apu.cpp.obj
[ 78%] Building CXX object gme/CMakeFiles/gme.dir/Sap_Cpu.cpp.obj
[ 80%] Building CXX object gme/CMakeFiles/gme.dir/Sap_Emu.cpp.obj
[ 82%] Building CXX object gme/CMakeFiles/gme.dir/Snes_Spc.cpp.obj
[ 85%] Building CXX object gme/CMakeFiles/gme.dir/Spc_Cpu.cpp.obj
[ 87%] Building CXX object gme/CMakeFiles/gme.dir/Spc_Dsp.cpp.obj
[ 89%] Building CXX object gme/CMakeFiles/gme.dir/Spc_Emu.cpp.obj
[ 91%] Building CXX object gme/CMakeFiles/gme.dir/Spc_Filter.cpp.obj
[ 93%] Building CXX object gme/CMakeFiles/gme.dir/Vgm_Emu.cpp.obj
[ 95%] Building CXX object gme/CMakeFiles/gme.dir/Vgm_Emu_Impl.cpp.obj
[ 97%] Building CXX object gme/CMakeFiles/gme.dir/Ym2413_Emu.cpp.obj
[100%] Linking CXX static library libgme.a
[100%] Built target gme
Installing /cygdrive/m/[...]/game-music-emu_git as make install
[100%] Built target gme
Install the project...
-- Install configuration: ""
-- Installing: /cygdrive/m/[...]/i686-w64-mingw32/lib/libgme.a
-- Installing: /cygdrive/m/[...]/i686-w64-mingw32/include/gme/gme.h
-- Installing: /cygdrive/m/[...]/i686-w64-mingw32/lib/pkgconfig/libgme.pc
The errno warnings are now gone (the other warnings remain obviously) and above all, FFmpeg's configure is happy as well! No more errors.
You can close this issue as far as I'm concerned. Thanks.
-- Reino
Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).
Thanks for looking into this! I'll leave it open for now until I figure out a good way to fix the check for zlib to find static versions if we're doing a static build. Or until I give up and document that you need to either disable zlib or pass the right path yourself...
Original comment by Reino17 (Bitbucket: Reino17, GitHub: Reino17).
'CMakeCache.txt' now indeed shows the static library...
ZLIB_INCLUDE_DIR:PATH=/usr/include
ZLIB_LIBRARY:FILEPATH=/usr/lib/libz.a
...but it doesn't necessarily fix the specific issue I had, because even with Cygwin's static zlib I still get the "errno"-warnings.
Cygwin's zlib I have installed is v1.2.8. To see if I perhaps need a minimum zlib version installed I've just compiled v1.2.8 myself and built LibGME again. No "errno"-warnings appeared, so I guess it's save to say this really is a Cygwin issue and I always have to point cmake to the right zlib path.
Original report by Anonymous.
Hello LibGME devs,
I'm cross-compiling FFmpeg with LibGME from git (on Windows using Cygwin, MinGW and GCC).
Compiling LibGME:
LibGME is successfully built in the end, but I don't know what to think of the '_DataReader.cpp.obj' warnings. How bad are they?
Then, compiling FFmpeg. The following is an excerpt from FFmpeg's 'config.log'. It's the part where it fails to link against LibGME:
All the private libraries (-lstdc++ -lz) are there, but it fails nonetheless. I've searched the web for "undefined reference to __assert_func", but I can't find any explanation for this. Do you have any idea?
For now 'game-music-emu-0.6.2.tar.xz' does work all the way 'till the end.
Thanks.
-- Reino