Skip to content
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

VST compilation fail on Ubuntu 16.10 #3582

Closed
GuessWhatBBQ opened this issue May 28, 2017 · 35 comments · Fixed by #3593
Closed

VST compilation fail on Ubuntu 16.10 #3582

GuessWhatBBQ opened this issue May 28, 2017 · 35 comments · Fixed by #3593

Comments

@GuessWhatBBQ
Copy link

Errors:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/wine/libwine.so when searching for -lwine
/usr/bin/ld: cannot find -lwine

https://hastebin.com/uvumutoman.erl

@karmux
Copy link
Contributor

karmux commented May 28, 2017

Hi @GuessWhatBBQ have you looked into #3142?

@tresf
Copy link
Member

tresf commented May 28, 2017

@GuessWhatBBQ per @karmux's research in #3142, can you please run:

sudo apt-get install libwine-dev:i386 wine32-tools:i386

This will remove wine64-tools and install the wine32-tools, which should allow the build to succeed.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented May 29, 2017

libwine-dev:i386 was already installed but wine32-tools:i386 was not
Thank you @karmux
Research followed through.
Compilation success after installing wine32-tools:i386 with full(hopefully) Vst support only for 32bit dlls (64bit dlls still fail but that's another story).

@tresf
Copy link
Member

tresf commented May 30, 2017

Vst support only for 32bit dlls (64bit dlls still fail but that's another story).

Yes, this is a problem. I spent a day trying to crack it but it appears something with either gcc, winegcc or the winebuild utility are broken and upstream probably needs a bug report.

According to the docs I'm reading, gcc should be perfectly capable of compiling using m32 but somewhere along the way winegcc (a wrapper around gcc) started linking against the 64-bit libraries. @tobydox's age-old fix to identify the 64-bit library and switch to 32-bit linking using -nodefaultlibs while providing the full path to the library doesn't work anymore. The 64-bit libraries still end up getting linked somehow which will fail against a 32-bit binary.

I even tried to use the -Wb,option as well as the -Bprefix to try to force winebuild to override the library linking but it simply doesn't work and using a more aggressive -nostdlib makes my build unrecoverable with missing std links all over the place.

Perhaps someone with a more advanced knowledge of the underlying wrapper could shim a proper fix. Our existing one seems to have broken. :(

@tresf tresf reopened this May 30, 2017
@tresf
Copy link
Member

tresf commented May 30, 2017

I've crawled the internet and back again and it appears only a handful of people have solid experiencing hacking winegcc, or at least those that use it don't talk about it much. For these reasons I've emailed Toby to see if he can point us in the right direction. We can use this bug report for tracking it and I'll close the other as a duplicate of this.

@tresf
Copy link
Member

tresf commented May 30, 2017

So here's a conversation including @jasp00 in regards to this new(ish) wine64-tools package which seems to be the difference between the working Ubuntu 16.04 and the broken Ubuntu 16.10 environments.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824673#27

To quote the mailing list...

So for the former it doesn't matter which package is installed, and for
the latter I don't see how the 64-bit winegcc is able to find the 32-bit
files.

@jasp00 writes:

The -L/usr/lib/i386-linux-gnu/wine flag is needed.

He specifically mentions the -L flag which is identical to this PR #3220 (comment). I tried this and didn't have much luck. What are we missing? :)

@tresf
Copy link
Member

tresf commented May 31, 2017

Ok... I deleted build/plugins/vst_base and #3220 seems to fix it. Since @gnudles's original branch is deleted, reopened under #3593.

@GuessWhatBBQ @n-pigeon can you reinstall wine64-tools and do a fresh build with this patch applied?

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented May 31, 2017

Do I just git pull and then make clean and make sequentially after installing wine64-tools ?

Edit:

Still new at this
I manually added the line

-L/usr/lib/i386-linux-gnu/wine/

to /lmms/plugins/vst_base/CMakeLists.txt and am compiling after installing wine64-tools

Edit v2:

:/
https://hastebin.com/bacubofuha.erl
Possibly dependency error (just a hunch tho)

Edit v3

libwine-dev:amd64 also required
Recompiled without success
https://hastebin.com/punanidesa.erl

@tresf
Copy link
Member

tresf commented May 31, 2017

@GuessWhatBBQ I assume libwine-dev:i386 is still installed and that /usr/lib/i386-linux-gnu/wine/ exists on your machine?

I would recommend firing off a brand new build if possible (e.g. remove the build directory completely). I've had mixed results if I didn't.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 1, 2017

This is the error without libwine-dev:amd64 and libwine:amd64 installed with make VERBOSE=1(I deleted the build directory as asked):


[ 83%] Generating ../RemoteVstPlugin
cd /home/guesswhatbbq/lmms/build/plugins/vst_base && /usr/bin/wineg++ -I"/home/guesswhatbbq/lmms/build" -I"/home/guesswhatbbq/lmms/include" -I"/usr/local/include/wine/windows" -I"/usr/local/include" -I/usr/include/wine/windows "/home/guesswhatbbq/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
/usr/bin/ld: cannot find -lshell32
/usr/bin/ld: cannot find -lcomdlg32
/usr/bin/ld: cannot find -lgdi32
/usr/bin/ld: cannot find -ladvapi32
/usr/bin/ld: cannot find -luser32
/usr/bin/ld: cannot find -lwinecrt0
/usr/bin/ld: cannot find -lkernel32
/usr/bin/ld: cannot find -lntdll
/usr/bin/ld: cannot find -lwine
collect2: error: ld returned 1 exit status
winegcc: g++ 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/guesswhatbbq/lmms/build'
CMakeFiles/Makefile2:7700: 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/guesswhatbbq/lmms/build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Output of dpkg -l|grep wine:

ii  fonts-wine                                      1.8.5-1ubuntu2                              all          Windows API implementation - fonts
ii  libwine:i386                                    1.8.5-1ubuntu2                              i386         Windows API implementation - library
ii  libwine-dev:i386                                1.8.5-1ubuntu2                              i386         Windows API implementation - development files
ii  wine-stable                                     1.8.5-1ubuntu2                              all          Windows API implementation - standard suite
ii  wine32:i386                                     1.8.5-1ubuntu2                              i386         Windows API implementation - 32-bit binary loader
ii  wine64-tools                                    1.8.5-1ubuntu2                              amd64        Windows API implementation - 64-bit developer tools
ii  winetricks                                      0.0+20160425-1ubuntu1                       all          package manager for WINE to install software easily

$ locate winecrt
/usr/lib/i386-linux-gnu/wine/libwinecrt0.a

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 1, 2017

After installing libwine-dev:amd64 and libwine:amd64 (Again after removing /build):


[ 83%] Generating ../RemoteVstPlugin
cd /home/guesswhatbbq/lmms/build/plugins/vst_base && /usr/bin/wineg++ -I"/home/guesswhatbbq/lmms/build" -I"/home/guesswhatbbq/lmms/include" -I"/usr/local/include/wine/windows" -I"/usr/local/include" -I/usr/include/wine/windows "/home/guesswhatbbq/lmms/plugins/vst_base/RemoteVstPlugin.cpp" -ansi -mwindows -lpthread -m32 -nodefaultlibs /usr/lib/i386-linux-gnu/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32 -fno-omit-frame-pointer -fno-exceptions -Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow -Wno-array-bounds -fPIC -DPIC -o ../RemoteVstPlugin
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/wine/libwine.so when searching for -lwine
/usr/bin/ld: cannot find -lwine
collect2: error: ld returned 1 exit status
winegcc: g++ 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/guesswhatbbq/lmms/build'
CMakeFiles/Makefile2:7700: 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/guesswhatbbq/lmms/build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Output of dpkg -l|grep wine:


$ dpkg -l|grep wine
ii  fonts-wine                                      1.8.5-1ubuntu2                              all          Windows API implementation - fonts
ii  libwine:amd64                                   1.8.5-1ubuntu2                              amd64        Windows API implementation - library
ii  libwine:i386                                    1.8.5-1ubuntu2                              i386         Windows API implementation - library
ii  libwine-dev:amd64                               1.8.5-1ubuntu2                              amd64        Windows API implementation - development files
ii  libwine-dev:i386                                1.8.5-1ubuntu2                              i386         Windows API implementation - development files
ii  wine-stable                                     1.8.5-1ubuntu2                              all          Windows API implementation - standard suite
ii  wine32:i386                                     1.8.5-1ubuntu2                              i386         Windows API implementation - 32-bit binary loader
ii  wine64                                          1.8.5-1ubuntu2                              amd64        Windows API implementation - 64-bit binary loader
ii  wine64-tools                                    1.8.5-1ubuntu2                              amd64        Windows API implementation - 64-bit developer tools
ii  winetricks                                      0.0+20160425-1ubuntu1                       all          package manager for WINE to install software easily


$ locate winecrt
/usr/lib/i386-linux-gnu/wine/libwinecrt0.a
/usr/lib/x86_64-linux-gnu/wine/libwinecrt0.a

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 1, 2017

I edited the Ubuntu dependency page to also install the libwine-dev:amd64 package

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 1, 2017

Note: Addition of -L/usr/lib/i386-linux-gnu/wine/ has no effect if wine32-tools:i386 is also installed and compilation progresses fine.

@tresf
Copy link
Member

tresf commented Jun 1, 2017

Note: Addition of -L/usr/lib/i386-linux-gnu/wine/ has no effect if wine32-tools:i386 is also installed and compilation progresses fine.

It's not in the verbose logs though. Why not? Did you accidentally edit the Fedora block instead of the Ubuntu block?

@tresf
Copy link
Member

tresf commented Jun 1, 2017

if wine32-tools:i386 is also installed and compilation progresses fine.

Please use wine64-tools as that's the baseline for this bug report as well as the fix proposed in the PR. wine64-tools conflicts with wine32-tools so all testing should use wine64-tools specifically.

I edited the Ubuntu dependency page to also install the libwine-dev:amd64 package

I think simply libwine-dev will do the same thing, as amd64 is the default architecture. Anyway, once we determine if the -L trick works, we need to do a clean-build on a fresh install of 16.10 to identify the minimal packages needed for compilation to succeed.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 1, 2017

Did you accidentally edit the Fedora block instead of the Ubuntu block?

Well this is embarassing...
Fixed it

I think simply libwine-dev will do the same thing, as amd64 is the default architecture.

Ditto about this ^.
Modified extra packages required for 64-bit in Ubuntu Dependency Wiki. Does my edit become live instantly ?

we need to do a clean-build on a fresh install of 16.10

Would a simple liveboot suffice ? As a clean install would be too time consuming (for me at least)

use wine64-tools as that's the baseline for this bug report

Noted. Switched back to wine64-tools

Compilation Succeeded with -L/usr/lib/i386-linux-gnu/wine/
As per verbose_output.txt
64-bit dlls still don't work(Equivalent 32-bit dlls of same Vst works fine).

Note:The tried Vsts were Synth1 and TyrellN6

Wine Setup($ dpkg -l | grep wine):

ii  fonts-wine                                      1.8.5-1ubuntu2                              all          Windows API implementation - fonts
ii  libwine:amd64                                   1.8.5-1ubuntu2                              amd64        Windows API implementation - library
ii  libwine:i386                                    1.8.5-1ubuntu2                              i386         Windows API implementation - library
ii  libwine-dev:amd64                               1.8.5-1ubuntu2                              amd64        Windows API implementation - development files
ii  libwine-dev:i386                                1.8.5-1ubuntu2                              i386         Windows API implementation - development files
ii  wine-stable                                     1.8.5-1ubuntu2                              all          Windows API implementation - standard suite
ii  wine32:i386                                     1.8.5-1ubuntu2                              i386         Windows API implementation - 32-bit binary loader
ii  wine64                                          1.8.5-1ubuntu2                              amd64        Windows API implementation - 64-bit binary loader
ii  wine64-tools                                    1.8.5-1ubuntu2                              amd64        Windows API implementation - 64-bit developer tools
ii  winetricks                                      0.0+20160425-1ubuntu1                       all          package manager for WINE to install software easily

@tresf
Copy link
Member

tresf commented Jun 1, 2017

Does my edit become live instantly ?

Yes.

Would a simple liveboot suffice ? As a clean install would be too time consuming (for me at least)

If your RAM can afford it. If not, I can do it. Anyway, merging and closing. Thanks a ton!

@tresf
Copy link
Member

tresf commented Jun 1, 2017

Did you accidentally edit the Fedora block instead of the Ubuntu block?

Well this is embarassing...

I've done it 5 times now so it was an educated guess. 😆

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 2, 2017

If your RAM can afford it

I didn't buy 8 Gigs for nothing(Not a lot I know,but enough).I'll do it within today

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 2, 2017

Minimal packages required for compilation to succeed seem to be:

libwine-dev libwine-dev:i386 gcc-multilib g++-multilib

libc6-dev-i386 unnecessary as it's installed as a dependency of gcc-multilib. As per:

$ aptitude why libc6-dev-i386
i   gcc-multilib   Depends gcc-6-multilib (>= 6.1.1-9~)
i A gcc-6-multilib Depends libc6-dev-i386 (>= 2.11)

Other people's mileage may vary but I required a few extra commands to get apt to detect i386 packages in the repo mirror :

sudo dpkg --add-architecture i386
sudo apt update

Compiled under Ubuntu 64-bit(Liveboot)

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 2, 2017

Note:Trying to run Synth1(32-bit) without wine32 package installed yeilded:

$ ./lmms
Notice: could not set realtime priority.
VST sync support disabled in your configuration
it looks like wine32 is missing, you should install it.
as root, please execute "apt-get install wine32"
it looks like wine32 is missing, you should install it.
as root, please execute "apt-get install wine32"
wine: Bad EXE format for Z:\media\ubuntu\0b829e4d-43d8-4203-9d0d-7239ca348634\guesswhatbbq\lmms\build\plugins\RemoteVstPlugin.exe.so.
Unexpected poll error.
Error while writing.
QProcess: Destroyed while process is still running.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 2, 2017

I just read the bug report on debian and the whole point of the -L/usr/lib/i386-linux-gnu/wine/ flag was to safely allow compilation without installing the libwine-dev:amd64 package. Any idea on why that doesn't work ? @tresf

@tresf
Copy link
Member

tresf commented Jun 2, 2017

Any idea on why that doesn't work ? @tresf

I think it does, you just don't have the 32-bit Wine environment to run it. I don't believe wine32-tools is the same as wine32.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 2, 2017

you just don't have the 32-bit Wine environment to run it

Understood.
Should I go ahead and edit the Dependency page ?

@tresf
Copy link
Member

tresf commented Jun 2, 2017

Should I go ahead and edit the Dependency page ?

Sure. I assume you've verified that wine32 fixes the message.

@GuessWhatBBQ
Copy link
Author

I assume you've verified that wine32 fixes the message.

It does.
As per the message itself and my own experience.
I'm confused about whether this is arch specific or not though.
Any advice ? @tresf

@tresf
Copy link
Member

tresf commented Jun 2, 2017

I'm confused about whether this is arch specific or not though.

I've done some reading on 64-bit wine versus 32-bit wine and I'm not entirely sure myself. I can't figure out if 64-bit wine is capable of running 32-bit binaries or not. I've found some forum posts that suggest 64-bit wine can't do it, which sort of validates what we are seeing, but I simply don't know enough to say how this should work.

@GuessWhatBBQ
Copy link
Author

I'll add it as a separate warning/tip then.

@aFoxNamedMorris
Copy link

aFoxNamedMorris commented Jun 3, 2017

@tresf Wine64 can and does run 32-bit applications. For example, I run Halo Custom Edition, which is a 32-bit executable in my 64-bit Wine prefix.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 3, 2017

Wine64 can and does run 32-bit applications

I know. I've run 32-bit applications under Wine64 as well. Doesn't work all the time though.Another quirk of wine ?

@aFoxNamedMorris
Copy link

aFoxNamedMorris commented Jun 3, 2017 via email

@GuessWhatBBQ
Copy link
Author

Haven't tried Wine-Staging sadly.Still using packages from the outdated ubuntu repos 😅

@karmux
Copy link
Contributor

karmux commented Jun 3, 2017

I'm using Wine-Staging 2.8 and haven't seen 64-bit VST plugin yet that can be run in LMMS.

@tresf
Copy link
Member

tresf commented Jun 3, 2017

Pretty sure we need to port a 64-bit bridge then. Windows does a 64-bit bridge as well as a 32-bit bridge. AFAIK, Linux has always been 32-bit only.

@GuessWhatBBQ
Copy link
Author

GuessWhatBBQ commented Jun 4, 2017

Windows does a 64-bit bridge as well as a 32-bit bridge

Why a 32-bit bridge ?
Why does it even need a bridge ?

zerkalica added a commit to zerkalica/airwave that referenced this issue Dec 1, 2018
Can't compile airwave-host-32: cmake can't find installed in /usr/lib/i386-linux-gnu/wine libs.

Error message:
```
[ 30%] Building CXX object src/host/CMakeFiles/airwave-host-32.dir/main.cpp.o
[ 32%] Linking CXX executable airwave-host-32
ld: relocatable linking with relocations from format elf64-x86-64 (/usr/lib/x86_64-linux-gnu/wine/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (airwave-host-32.0GjNO7.o) is not supported
winebuild: ld failed with status 1
winegcc: /usr/lib/wine/winebuild failed
```

Command:
```
    mkdir -p build && cd build && \
    cmake \
        -DCMAKE_BUILD_TYPE="Release" \
        -DCMAKE_INSTALL_PREFIX=/opt/airwave \
        ..
```

Related links:

psycha0s#65
LMMS/lmms#3582

OS: Ubuntu 18.10

Packages:
```
sudo apt install -y git cmake gcc-multilib build-essential qt5-qmake qtbase5-dev libmagic-dev libwine-dev libwine-dev:i386
```
JohannesLorenz pushed a commit to JohannesLorenz/lmms-wiki that referenced this issue Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants