[Bug 48497] New: DXVA2 patchset not compatible with GCC 10

WineHQ Bugzilla wine-bugs at winehq.org
Wed Jan 22 13:52:08 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=48497

            Bug ID: 48497
           Summary: DXVA2 patchset not compatible with GCC 10
           Product: Wine-staging
           Version: 5.0
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: mike at cchtml.com
                CC: leslie_alistair at hotmail.com, z.figura12 at gmail.com
      Distribution: ---

GCC 10 defaults have changed.

https://gcc.gnu.org/gcc-10/porting_to.html#common

Default to -fno-common

A common mistake in C is omitting extern when declaring a global variable in a
header file. If the header is included by several files it results in multiple
definitions of the same variable. In previous GCC versions this error is
ignored. GCC 10 defaults to -fno-common, which means a linker error will now be
reported. To fix this, use extern in header files when declaring global
variables, and ensure each global is defined in exactly one C file. As a
workaround, legacy C code can be compiled with -fcommon.


      int x;  // tentative definition - avoid in header files

      extern int y;  // correct declaration in a header file

Fedora Rawhide (Fedora 32) now has GCC 10 and Wine-staging fails to build.

The fix is simple. Add 'extern' to the two offending lines below:

sed -i 's/BOOL config_vaapi_drm DECLSPEC_HIDDEN;/extern BOOL config_vaapi_drm
DECLSPEC_HIDDEN;/' dlls/dxva2/dxva2_private.h
sed -i 's/char config_vaapi_drm_path\[MAX_PATH\] DECLSPEC_HIDDEN;/extern char
config_vaapi_drm_path\[MAX_PATH\] DECLSPEC_HIDDEN;/' dlls/dxva2/dxva2_private.h

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list