View Issue Details

IDProjectCategoryView StatusLast Update
0001436OpenMPTlibopenmptpublic2021-03-28 07:02
Reporterhydra3333 Assigned Tomanx  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindowsOS Version10
Product VersionOpenMPT 1.30.00.* (old testing) 
Fixed in VersionOpenMPT 1.29.09.00 / libopenmpt 0.5.8 (upgrade first) 
Summary0001436: commit 7b902a892fe59f10f2afa5ba115fe9fbbdce94d8 breaks cross-compilation under mingw64 target Win10x64
Description

Hello.
The last working openmpt commit was d5ec5e89a15ff480d368755cea232056b17e2d2f on 2021.03.21
The breaking openmpt commit is 7b902a892fe59f10f2afa5ba115fe9fbbdce94d8 on 2021.03.21
which has comment:
[New] Can now load Symphonie (SymMOD) modules. Many thanks to Revenant for the original work on this loader. Most modules play very well, but there are still some TODOs for perfect playback (https://bugs.openmpt.org/view.php?id=672).
[Mod] OpenMPT: Version is now 1.30.00.30
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@14381 56274372-70c3-4bfc-bfc3-4c3a0b034d27

The ffmpeg error message seems to be misleading since the tail of the ffmpeg config.log is shown below.

./configure --prefix=/home/u/Desktop/_working/workdir/win64_output/ffmpeg_git_3333.installed --disable-shared --enable-static --arch=x86_64 --target-os=mingw64 --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --disable-shared --enable-static --disable-w32threads --enable-pthreads --enable-cross-compile --target-exec=wine --enable-runtime-cpudetect --enable-gpl --enable-version3 --extra-version="Hydra3333/python_cross_compile_script_v100/3333" --enable-pic --enable-bzlib --enable-zlib --enable-lzma --disable-fontconfig --disable-libfontconfig --disable-libfreetype --disable-libfribidi --disable-libbluray --disable-libcdio --enable-avisynth --enable-vapoursynth --disable-librtmp --disable-libcaca --enable-iconv --enable-libxml2 --enable-gmp --enable-gnutls --enable-libzimg --enable-libx264 --enable-libx265 --enable-libvpx --enable-libdav1d --disable-libaom --enable-libxvid --enable-gray --enable-libopus --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libsoxr --enable-librubberband --disable-libass --enable-libwebp --enable-ffnvcodec --enable-cuvid --enable-cuda-llvm --disable-opengl --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --disable-libmfx --disable-amf --disable-opencl --extra-libs="-lpsapi -lintl -liconv -lssp" --enable-nonfree --enable-libfdk-aac --disable-decklink --enable-libtwolame --enable-libzvbi --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libsnappy --disable-frei0r --enable-libsrt --enable-libbs2b --enable-libilbc --disable-libgme --disable-libflite --enable-sdl2 --enable-libopenmpt --enable-libmysofa --enable-libvidstab --disable-libmodplug --disable-schannel --extra-cflags="-DLIBTWOLAME_STATIC" --extra-cflags="-DMODPLUG_STATIC" --extra-cflags="-DLIBXML_STATIC" --extra-cflags="-DGLIB_STATIC_COMPILATION" --prefix=/home/u/Desktop/_working/workdir/win64_output/ffmpeg_git_3333.installed --disable-shared --enable-static
ERROR: libopenmpt >= 0.2.6557 not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

config.log tail:

x86_64-w64-mingw32-gcc -DFRIBIDI_LIB_STATIC -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -USTRICT_ANSI -DUSE_MINGW_ANSI_STDIO=1 -Dprintf=gnu_printf -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DFRIBIDI_LIB_STATIC -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 -DLIBTWOLAME_STATIC -DMODPLUG_STATIC -DLIBXML_STATIC -DGLIB_STATIC_COMPILATION -std=c11 -fomit-frame-pointer -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -pthread -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include/bs2b -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -I/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/x86_64-w64-mingw32/include -I/usr/local/include -L/usr/local/lib -c -o /tmp/ffconf.rN7E1TAT/test.o /tmp/ffconf.rN7E1TAT/test.c
/tmp/ffconf.rN7E1TAT/test.c: In function 'check_openmpt_module_create':
/tmp/ffconf.rN7E1TAT/test.c:3:1: warning: 'openmpt_module_create' is deprecated [-Wdeprecated-declarations]
3 | long check_openmpt_module_create(void) { return (long) openmpt_module_create; }
| ^~~~
In file included from /tmp/ffconf.rN7E1TAT/test.c:1:
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/include/libopenmpt/libopenmpt.h:680:55: note: declared here
680 | LIBOPENMPT_API LIBOPENMPT_DEPRECATED openmpt_module openmpt_module_create( openmpt_stream_callbacks stream_callbacks, void stream, openmpt_log_func logfunc, void loguser, const openmpt_module_initial_ctl ctls );
| ^~~~~
/tmp/ffconf.rN7E1TAT/test.c:3:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
3 | long check_openmpt_module_create(void) { return (long) openmpt_module_create; }
| ^
x86_64-w64-mingw32-gcc -DFRIBIDI_LIB_STATIC -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000 -I/usr/local/include -L/usr/local/lib -o /tmp/ffconf.rN7E1TAT/test.exe /tmp/ffconf.rN7E1TAT/test.o -lopenmpt -lstdc++ -lpsapi -lintl -liconv -lssp
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x6f9): undefined reference to `
imp_UuidCreate'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x6f9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_UuidCreate' /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x742): undefined reference toimp_UuidIsNil'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x742): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `
imp_UuidIsNil'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x7a9): undefined reference to __imp_UuidCreateSequential' /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x7a9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_UuidCreateSequential'
/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld: /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x7f2): undefined reference to __imp_UuidIsNil' /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libopenmpt.a(mptUUID.o):mptUUID.cpp:(.text+0x7f2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_UuidIsNil'
collect2: error: ld returned 1 exit status
ERROR: libopenmpt >= 0.2.6557 not found using pkg-config

Steps To Reproduce

see cross-compile statement in comments above

TagsNo tags attached.
Has the bug occurred in previous versions?no
Tested code revision (in case you know it)

Activities

manx

manx

2021-03-27 10:03

administrator   ~0004687

Last edited: 2021-03-27 10:12

I sadly cannot see how the commit you mention would have anything to do with the error you are seeing. It does not touch anything UUID/GUID related.

Could you first try linking test.exe with -lrpcrt4 (probably setting libopenmpt_extralibs="-lrpcrt4" in the ffmpeg configure script (note that I am not at all familiar with the ffmpeg build system))?

What is the command you are using to build libopenmpt?

Which MinGW distribution are you using?

Also, I am not familiar with the actual error you are seeing relocation truncated to fit: R_X86_64_PC32 against undefined symbol. Trying to understand it, I arrived at https://www.technovelty.org/c/relocation-truncated-to-fit-wtf.html , which might imply that something actually got too large to fit in some 32bit related limit. From what I understand, building EVERYTHING with -mcmodel=large (https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html) might help, however I am really not sure here either.

As I am currently a bit lost here, it might also help if you request support from ffmpeg and MingGW and GCC projects. Please also refer them to this issue here, and please also post/cross-link any additional information they might provide here.

manx

manx

2021-03-27 12:44

administrator   ~0004689

r14448 / commit 365aff528df454c835244bd23a080eab8babacd6 might fix the issue by listing -lrpcrt4 in libopenmpt.pc Libs.Private. However, I am still somewhat confused how this would be triggered by the commit you mentioned.

hydra3333

hydra3333

2021-03-27 12:56

reporter   ~0004690

Thank you. Mingw64 with target Win10 x64.
OK, I'll look at that tomorrow night and provide the info (it's very late here).
I cannot validly comment on why that commit does any breaking ... but it does, and the prior commit does work a treat.
the build system uses this as input to drive it:
{
'repo_type' : 'git',
'url' : 'https://github.com/OpenMPT/openmpt.git',
'depth_git' : 0,
'branch' : 'tags/libopenmpt-0.5.7', # last working tag since a subsequent commit id 7b902a892fe59f10f2afa5ba115fe9fbbdce94d8 breaks cross-compiling
'needs_configure' : False,
'build_options' : 'CONFIG=mingw64-win64 TEST=0 SHARED_LIB=0 STATIC_LIB=1 EXAMPLES=0 OPENMPT123=0 ', # https://bugs.openmpt.org/view.php?id=1354#c4423 remove MODERN=1
'install_options' : 'CONFIG=mingw64-win64 TEST=0 SHARED_LIB=0 STATIC_LIB=1 EXAMPLES=0 MODERN=1 OPENMPT123=0 PREFIX={target_prefix} ',
'update_check' : { 'type' : 'git', },
'_info' : { 'version' : 'git (master)', 'fancy_name' : 'openmpt' },
}
I'll get and provide the expanded commands tomorrow night.

hydra3333

hydra3333

2021-03-28 06:59

reporter   ~0004691

Hello,
Re: r14448 / commit 365aff528df454c835244bd23a080eab8babacd6 might fix the issue by listing -lrpcrt4 in libopenmpt.pc Libs.Private.

I just tried cross-compiling git head and it works now, so that commit must have fixed it.

Thank you.

manx

manx

2021-03-28 07:02

administrator   ~0004692

I am still completely confused how it got triggered by that commit, but the fix is required anyway. So it looks like all is fine now.

Thank you for the bug report.

Issue History

Date Modified Username Field Change
2021-03-27 09:24 hydra3333 New Issue
2021-03-27 09:25 hydra3333 Steps to Reproduce Updated
2021-03-27 09:25 hydra3333 Has the bug occurred in previous versions? => no
2021-03-27 10:03 manx Assigned To => manx
2021-03-27 10:03 manx Status new => feedback
2021-03-27 10:03 manx Note Added: 0004687
2021-03-27 10:12 manx Note Edited: 0004687
2021-03-27 12:44 manx Note Added: 0004689
2021-03-27 12:56 hydra3333 Note Added: 0004690
2021-03-27 12:56 hydra3333 Status feedback => assigned
2021-03-28 06:59 hydra3333 Note Added: 0004691
2021-03-28 07:02 manx Status assigned => resolved
2021-03-28 07:02 manx Resolution open => fixed
2021-03-28 07:02 manx Fixed in Version => OpenMPT 1.29.09.00 / libopenmpt 0.5.8 (upgrade first)
2021-03-28 07:02 manx Note Added: 0004692