Summary: | media-video/vlc-2.2.x fails to build with gcc-6 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexey Shvetsov <alexxy> |
Component: | Current packages | Assignee: | Nick Andrade <SDNick484> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fturco, herrtimson, media-video, plevine457, proxy-maint, rose, ua_gentoo_bugzilla |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 582084 | ||
Attachments: |
build.log.gz
vlc-gcc-6-buildfixes.patch vlc-2.2.X-gcc6.patch Fix-build-using-old-GCC-intrinsics.patch |
Description
Alexey Shvetsov
2016-07-04 08:00:52 UTC
Created attachment 439648 [details]
build.log.gz
Thanks for reporting this. I haven't tried GCC 6 myself yet so I haven't encountered it, but it looks like other distros (i.e. OpenSuse) have a patch. I will tackle this tomorrow. Created attachment 440416 [details, diff] vlc-gcc-6-buildfixes.patch Patch taken from opensuse (https://build.opensuse.org/request/show/397726) to allow VLC 2.2.x to build with GCC-6; it requires USE="-atmo" (which is a deprecated feature anyway and won't be in 3.0). This patch requires further testing before it's committed, but should work on all versions of VLC-2.2.x. I'm still updating my system to get GCC-6.1 version you're using installed (I assume it's the one in the "hardened-development" overlay). I will do further tests tomorrow and will update. I was able to conduct some testing, and this is what I've found: 1. VLC 2.2.x builds fine with GCC 6.1 if you're not using the new QT5 interface (enabled by the qt5 USE flag) - tested with 2.2.2, 2.2.3, & 2.2.4 2. If you enable USE="-qt4 qt5", then VLC fails 3. The patch attached to this bug allows VLC to build with QT5 enabled using GCC 6.1. (tested via epatch_user) I now need to confirm whether there's any downsides to the patch (i.e. will it break VLC for GCC < 6), so more testing is needed however this patch should allow you to move forward. Okay, after further testing I have confirmed the current patch does break GCC < 6. The break occurs even when building with "qt4 -qt5". I'll need to do some further research to either modify it to work with both GCC versions or see if there's a mechanism in Portage to only apply it if building with GCC > 6. Same problem with gcc-5.4.0 and Qt-5.7. It's the ordering of includes in vlc, that causes this. VLC defines some macros in vlc_atomic.h that are definded in the system headers, but with different parameters. I'm working on a patch. Created attachment 447020 [details, diff] vlc-2.2.X-gcc6.patch (In reply to Nick Andrade from comment #5) > Okay, after further testing I have confirmed the current patch does break > GCC < 6. The break occurs even when building with "qt4 -qt5". I'll need to > do some further research to either modify it to work with both GCC versions > or see if there's a mechanism in Portage to only apply it if building with > GCC > 6. FTFY. Changed two lines. This should work for any version of GCC. Tested on gcc-5.4.0 and gcc-6.2.0. Created attachment 447024 [details, diff] Fix-build-using-old-GCC-intrinsics.patch Previous patch didn't work for USE="-qt4 qt5". This patch is taken from Debian: https://sources.debian.net/src/vlc/2.2.4-4/debian/patches/Fix-build-using-old-GCC-intrinsics.patch/ Tested and working for gcc-5.4.0 and gcc-6.2.0, and for USE="-qt4 qt5" and USE="qt4 -qt5". Thank you Peter, I am testing the patch on multiple GCCs, should be ready to merge the change soon. Sorry for the delay. There's a much simpler fix which will work for this, and maybe for other GCC 6 cases, and that's to just revert back to the C++ standard that was the default before: --- a/configure.ac.old 2016-08-24 23:11:00.205794236 +0100 +++ b/configure.ac 2016-08-25 01:09:22.222407299 +0100 @@ -867,6 +867,7 @@ RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration]) RDC_PROG_CC_FLAGS([-pipe]) AC_LANG_PUSH([C++]) +RDC_PROG_CXX_FLAGS([-std=gnu++98]) RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var]) AC_LANG_POP([C++]) From the GCC 6 release notes: "Default standard is now GNU++14 GCC 6 defaults to -std=gnu++14 instead of -std=gnu++98: the C++14 standard, plus GNU extensions. This brings several changes that users should be aware of, some new with the C++14 standard, others that appeared with the C++11 standard. The following paragraphs describe some of these changes and suggest how to deal with them. Some users might prefer to stay with gnu++98, in which case we suggest to use the -std=gnu++98 command-line option, perhaps by putting it in CXXFLAGS or similar variables in Makefiles." https://gcc.gnu.org/gcc-6/porting_to.html I don't think distributions should be making extensive changes to port applications to newer versions of the C++ standard. Fixed upstream: https://git.videolan.org/?p=vlc/vlc-2.2.git;a=commit;h=8b0a359be21c8b66c7f7f5d34b85df3cf6689035 (In reply to Andrew John Hughes from comment #10) > There's a much simpler fix which will work for this, and maybe for other GCC > 6 cases, and that's to just revert back to the C++ standard that was the > default before: "-std=c++98" and "-std=gnu++98" are simple fixes that will work on most packages that fail with GCC-6 but it is a bandaid that could cripple maintenance in the future as many c++11/14 features get added to source and source files start having quiet dependence on such features. For some packages they are inevitable, temporary, and upstream. For packages that haven't been maintained in a while and aren't expected to, I suppose it wouldn't matter. But its a bandaid that should be used sparingly. Please re-check if the recent changes also fix build with gcc-6. (In reply to Andreas Sturmlechner from comment #12) > Please re-check if the recent changes also fix build with gcc-6. Builds fine for me now. Tested with vlc-2.2.4-r1 and gcc-6.3.0. vlc-gcc-6-buildfixes.patch worked for me on media-video/vlc-2.2.4-r1[+qt5 -qt4] with GCC 5.4.0, CXXFLAGS="-std=c++11" and Qt 5.7.1-r1. Didn't test Fix-build-using-old-GCC-intrinsics.patch. (In reply to Peter Levine from comment #13) > Builds fine for me now. Tested with vlc-2.2.4-r1 and gcc-6.3.0. Thanks, that's what wanted to hear. Alessandro, the question was about vanilla 2.2.4-r1 and not about the attached patches in this bug. Please re-open if an _unmodified_ vlc-2.2.4-r1 fails to build for you. |