Closed djnotes closed 7 years ago
Per instructions in #5, can you also set VERBOSE=1
and post the relevant output?
Yep, with VERBOSE=1, I get:
cd /home/mhd/src/lmms/build/plugins/vst_base && /usr/bin/wineg++ -I"/home/mhd/src/lmms/build" -I"/home/mhd/src/lmms/include" -I"/usr/local/include/wine/windows" -I"/usr/local/include" -I/usr/include/wine/windows "/home/mhd/src/lmms/plugins/vst_base/RemoteVstPlugin.cpp" -ansi -mwindows -lpthread -m32 -fno-omit-frame-pointer -fno-exceptions -Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow -Wno-array-bounds -fPIC -DPIC -o ../RemoteVstPlugin
ld: Relocatable linking with relocations from format elf64-x86-64 (/usr/lib64/wine/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (RemoteVstPlugin.yePEra.o) is not supported
winebuild: ld failed with status 1
winegcc: winebuild failed
plugins/vst_base/CMakeFiles/vstbase.dir/build.make:61: recipe for target 'plugins/RemoteVstPlugin' failed
make[2]: *** [plugins/RemoteVstPlugin] Error 2
make[2]: Leaving directory '/home/mhd/src/lmms/build'
CMakeFiles/Makefile2:8768: recipe for target 'plugins/vst_base/CMakeFiles/vstbase.dir/all' failed
make[1]: *** [plugins/vst_base/CMakeFiles/vstbase.dir/all] Error 2
make[1]: Leaving directory '/home/mhd/src/lmms/build'
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
From what I'm reading with the other bug report (which doesn't really explain the workaround, leaving us to infer), this occurs if wineg++
is linked against the 64-bit libraries instead of the 32-bit libraries.
The workaround shims this with the following pseudo logic:
m32
flag, does the output of the command wineg++ -v -m32 /dev/zero
contain the 64-bit version of the libwinecrt0.a
library?libwinecrt0.a
as well as user32
, kernel32
and gdi32
.If your bug is the same cause, it may as simple as the above test is failing. Can you post the output of wineg++ -v -m32 /dev/zero
?
Disclaimer, I'm not an expert on this, just reading between the lines on the aforementioned bug.
Sure, @tresf, here is the output of wineg++ -v -m32 /dev/zero
:
[mhd@localhost build]$ wineg++ -v -m32 /dev/zero
g++ -m64 -m32 -fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__)) -D__cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)) -D_stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__)) -D_cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)) -D__fastcall=__attribute__((__fastcall__)) -D_fastcall=__attribute__((__fastcall__)) -D__declspec(x)=__declspec_##x -D__declspec_align(x)=__attribute__((aligned(x))) -D__declspec_allocate(x)=__attribute__((section(x))) -D__declspec_deprecated=__attribute__((deprecated)) -D__declspec_dllimport=__attribute__((dllimport)) -D__declspec_dllexport=__attribute__((dllexport)) -D__declspec_naked=__attribute__((naked)) -D__declspec_noinline=__attribute__((noinline)) -D__declspec_noreturn=__attribute__((noreturn)) -D__declspec_nothrow=__attribute__((nothrow)) -D__declspec_novtable=__attribute__(()) -D__declspec_selectany=__attribute__((weak)) -D__declspec_thread=__thread -D__int8=char -D__int16=short -D__int32=int -D__int64=long long -D__WINE__ -c -o zero-4G8gPw.o -v -m32 /dev/zero -isystem/usr/include/wine/windows
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.2.1 20160916 (Red Hat 6.2.1-2) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/:/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/6.2.1/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib64/../lib/:/usr/lib/gcc/x86_64-redhat-linux/6.2.1/32/:/usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib64/:/usr/lib/gcc/x86_64-redhat-linux/6.2.1/:/usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-fshort-wchar' '-D' 'WINE_UNICODE_NATIVE' '-D' '_REENTRANT' '-fPIC' '-D' 'WIN32' '-D' '_WIN32' '-D' '__WIN32' '-D' '__WIN32__' '-D' '__WINNT' '-D' '__WINNT__' '-D' '__stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))' '-D' '__cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))' '-D' '_stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))' '-D' '_cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))' '-D' '__fastcall=__attribute__((__fastcall__))' '-D' '_fastcall=__attribute__((__fastcall__))' '-D' '__declspec(x)=__declspec_##x' '-D' '__declspec_align(x)=__attribute__((aligned(x)))' '-D' '__declspec_allocate(x)=__attribute__((section(x)))' '-D' '__declspec_deprecated=__attribute__((deprecated))' '-D' '__declspec_dllimport=__attribute__((dllimport))' '-D' '__declspec_dllexport=__attribute__((dllexport))' '-D' '__declspec_naked=__attribute__((naked))' '-D' '__declspec_noinline=__attribute__((noinline))' '-D' '__declspec_noreturn=__attribute__((noreturn))' '-D' '__declspec_nothrow=__attribute__((nothrow))' '-D' '__declspec_novtable=__attribute__(())' '-D' '__declspec_selectany=__attribute__((weak))' '-D' '__declspec_thread=__thread' '-D' '__int8=char' '-D' '__int16=short' '-D' '__int32=int' '-D' '__int64=long long' '-D' '__WINE__' '-c' '-o' 'zero-4G8gPw.o' '-v' '-m32' '-isystem' '/usr/include/wine/windows' '-shared-libgcc' '-mtune=generic' '-march=i686'
g++: warning: /dev/zero: linker input file unused because linking not done
winebuild -v -fno-asynchronous-unwind-tables --cc-cmd=gcc -m64 --ld-cmd=ld -m32 -D_REENTRANT -fPIC --exe -o a.out-mYercU.spec.o -F a.out --subsystem console -L/usr/lib64/wine -L/usr/lib64 -- zero-4G8gPw.o /usr/lib64/wine/libadvapi32.def /usr/lib64/wine/libuser32.def /usr/lib64/wine/libwinecrt0.a /usr/lib64/wine/libkernel32.def /usr/lib64/wine/libntdll.def
winebuild: zero-4G8gPw.o is an empty file
winegcc: winebuild failed
Thanks. Again, this is just a guess ,but can you change plugins/vst_base/CMakeLists.txt
as follows?
# workaround for broken wineg++ in WINE 1.4 (shipped e.g. with Ubuntu Precise)
EXEC_PROGRAM( ${WINE_CXX} ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT)
- if("${WINEBUILD_OUTPUT}" MATCHES ".*x86_64-linux-gnu/wine/libwinecrt0.a.*")
+ if("${WINEBUILD_OUTPUT}" MATCHES ".*lib64/wine/libwinecrt0.a.*")
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386-linux-gnu/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32)
ENDIF()
Thanks, I changed it a bit and finally got it working :+1:
The trick was to change /usr/lib/i386-linux-gnu/wine/libwinecrt0.a
to /usr/lib/wine/libwinecrt0.a
, but then you would have to install also 32 bit versions of wine development packages since there was only one libwinecrt0.a, which was under lib64/wine, so then you will want to install wine.i686 and wine-devel.i686.
Here is the resulting application fully built:
Just one more thing, does anyone know why the application quite different from (and more fully featured than) the one provided by my Fedora repositories?
Does anyone know why the application quite different from (and more fully featured than) the one provided by my Fedora repositories?
Fedora offers 1.1.3. The version you've compiled is 1.2.0-RC1 with some additional changes before the 1.2.0-RC2 release.
Thanks, I changed it a bit and finally got it working 👍
Can you provide the exact Fedora steps you performed (yum
or dnf
commands)?
We can shim the CMakeLists.txt
to accommodate Fedora, but we should also add the Fedora package names to our documentation.
To solve this issue in Fedora, first look for libwinecrt0.a on your system with the following command:
(1) sudo find /usr -name libwinecrt0.a
You will most probably get /usr/lib64/wine/libwinecrt0.a
only, which is 64 bit. you need to install 32 bit version too. To find those 32 bit packages look up the repositories, as follows:
(2)
dnf search wine| grep i686
You will get several package names including wine.i686
and wine-devel.i686
, Install them as follows:
(3)
sudo dnf install wine.i686 wine-devel.i686
Be careful not to install every wine-related package you see as some conflict with each other and you might need to erase some to install some. If I knew how, I would list here all wine packages I have on my Fedora, before starting the build.
(4) If you issue the the find command of step 1, now you will also see /usr/lib/wine/libwinecrt0.a
, which shows the location of 32 bit wine version. Change the patch in CMakeLists.txt as follows:
if("${WINEBUILD_OUTPUT}" MATCHES ".*lib64/wine/libwinecrt0.a.*")
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32)
Now, lmms should build fine.
Can/should I or apply this patch to CMakeLists.txt? How can I do this?
I just made minor changes to the said file.
Can/should I or apply this patch to CMakeLists.txt? How can I do this?
Sure. You look like you're well on your way. I've added some comments to your pull request. Please free to commit additional changes to your branch and they will automatically be reflected in your pull request.
@jasonMisaq I've added your Fedora hint to our compilation tutorial here: https://github.com/LMMS/lmms/wiki/Compiling-lmms#building-on-linux
Once the Pull Request is completed, we'll merge and close out this issue.
Thank you @tresf. It is great pleasure to be part of this great community :+1:
A similar issue has already been discussed on https://github.com/LMMS/lmms/issues/15, but those instructions are mostly for Ubuntu and I could not solve this on Fedora x86_64. Also, if anyone can tell me where I should use the workaround given by user @tobydox on the same page linked above, I would appreciate it. Currently, the complete output for my make is as follows: