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

RemoteVstPlugin fails to build with with -flto #5179

Closed
plater opened this issue Sep 9, 2019 · 11 comments
Closed

RemoteVstPlugin fails to build with with -flto #5179

plater opened this issue Sep 9, 2019 · 11 comments

Comments

@plater
Copy link

plater commented Sep 9, 2019

I've disabled vst build in openSUSE meanwhile but maybe it's easy for someone familiar with lmms to find a fix. I've attached the entire build log. See:
https://build.opensuse.org/package/show/multimedia:apps/lmms to view the patches.
Build failure point:

Arbuthnot:/home/abuild/rpmbuild/BUILD/lmms-1.2.0/build/plugins/vst_base # cd /home/abuild/rpmbuild/BUILD/lmms-1.2.0/build/plugins/vst_base && /usr/bin/wineg++ -I/home/abuild/rpmbuild/BUILD/lmms-1.2.0/build -I/home/abuild/rpmbuild/BUILD/lmms-1.2.0/include -I/usr/include -I/usr/include/wine/windows -L/usr/lib64/libwine.so /home/abuild/rpmbuild/BUILD/lmms-1.2.0/plugins/vst_base/RemoteVstPlugin.cpp -std=c++0x -mwindows -lpthread -lole32 -m32 -nodefaultlibs /usr/lib/wine/libwinecrt0.a -L/usr/lib/wine/ -luser32 -lkernel32 -lgdi32 -fno-omit-frame-pointer -fno-exceptions -Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow -Wno-array-bounds -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=4 -DNDEBUG -fPIC -DPIC -pie -o ../RemoteVstPlugin
In file included from /usr/include/wine/windows/objbase.h:252,
                 from /usr/include/wine/windows/ole2.h:25,
                 from /usr/include/wine/windows/wtypes.h:13,
                 from /usr/include/wine/windows/winscard.h:22,
                 from /usr/include/wine/windows/windows.h:70,
                 from /home/abuild/rpmbuild/BUILD/lmms-1.2.0/plugins/vst_base/RemoteVstPlugin.cpp:64:
/usr/include/wine/windows/objidl.h:6100:15: error: ‘union _userSTGMEDIUM::<unnamed struct>::__WIDL_objidl_generated_name_0000000C’ invalid; an anonymous struct may only have public non-static data members [-fpermissive]
 6100 |         union __WIDL_objidl_generated_name_0000000C {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
winegcc: g++ failed

rpmbuildlog.txt

@PhysSong
Copy link
Member

PhysSong commented Sep 9, 2019

It seems like it's a bug with Wine >= 4.14: https://bugs.winehq.org/show_bug.cgi?id=47710
According to doitsujin/dxvk#1182 (comment), -D__WIDL_objidl_generated_name_0000000C= is a possible workaround.

@plater
Copy link
Author

plater commented Sep 10, 2019

With -D__WIDL_objidl_generated_name_0000000C="" included in the CXXFLAGS I get a link time error about an undefined ExitProcess due to the vst section choking on Link Time Optimization. This is a pity because everything else except vst builds with it. I've discovered that I can build the vst plugins without wine which is the best option for me, works with LTO as well.

@PhysSong
Copy link
Member

I get a link time error about an undefined ExitProcess due to the vst section choking on Link Time Optimization.

That sounds like https://bugs.winehq.org/show_bug.cgi?id=41712

@plater
Copy link
Author

plater commented Sep 11, 2019

I get a link time error about an undefined ExitProcess due to the vst section choking on Link Time Optimization.

That sounds like https://bugs.winehq.org/show_bug.cgi?id=41712

Can confirm it is.

@PhysSong PhysSong changed the title lmms-1.2.0's vst plugins fail to build with g++>= 9.2 RemoteVstPlugin fails to build with wine >= 4.14 or with -flto Sep 12, 2019
@Reflexe
Copy link
Member

Reflexe commented Oct 12, 2019

I think we can close this issue? @PhysSong

@PhysSong
Copy link
Member

The -flto part is still not fixed, but I'm not sure if it's worth fixing it.

@PhysSong PhysSong changed the title RemoteVstPlugin fails to build with wine >= 4.14 or with -flto RemoteVstPlugin fails to build with with -flto Oct 31, 2019
@Spekular Spekular mentioned this issue Mar 31, 2020
35 tasks
@tank-trax
Copy link

try commenting out

/*__WIDL_objidl_generated_name_0000000C */

I had to do this to compile Carla

@plater
Copy link
Author

plater commented Jun 21, 2020

I've revisited openSUSE's lmms build and the only build flag I have to remove is -m64 to allow the wine-32 build to succeed. grepping the build log finds 167 instances of -flto=auto so I don't understand the issue with lto. The only modification to the build is sed out -m64 and add -D__WIDL_objidl_generated_name_0000000C="" to the build flags.

@thmo
Copy link

thmo commented May 9, 2021

The problem is still there on Fedora 34/i686, I think (for lmms 1.2.2):

# wineg++  ../../../plugins/vst_base/RemoteVstPlugin.cpp -I../../../include -I../../../i686-redhat-linux-gnu -lole32 -lpthread -std=c++0x -mwindows -O2 -m32 -flto=auto
/usr/bin/ld: /usr/bin/../lib/wine/libwinecrt0.a(exe_entry.o): warning: relocation against `strlen@@GLIBC_2.0' in read-only section `.text'
/usr/bin/ld: /usr/bin/../lib/wine/libwinecrt0.a(exe_entry.o): in function `__wine_spec_exe_entry':
(.text+0x19): undefined reference to `GetCommandLineA'
/usr/bin/ld: (.text+0x4c): undefined reference to `HeapAlloc'
/usr/bin/ld: (.text+0x107): undefined reference to `ExitProcess'
/usr/bin/ld: a.out.so: hidden symbol `HeapAlloc' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
winegcc: /usr/bin/g++ failed

with these wine packages installed:

# rpm -qa 'wine*'
wine-filesystem-6.7-1.fc34.noarch
wine-core-6.7-1.fc34.i686
wine-devel-6.7-1.fc34.i686

Compilation succeeds when omitting -flto=auto switch or adding -fno-lto (the warning is still there, but probably unrelated).

NB: Adding -D__WIDL_objidl_generated_name_0000000C="" does not fix the issue for me (which is to be expected, as this has been fixed in wine 5.0 already).

@luzpaz
Copy link
Contributor

luzpaz commented Jul 3, 2023

Is this issue impacted at all by #6672 (comment) ?

@Rossmaxx
Copy link
Contributor

I'm closing this for now as we switched to use wine >= 6.0 and i persume the regression to not be there. If it arises again, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants