Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 600288 - www-client/chromium-56.0.2922.1 build failure with gcc-4.9
Summary: www-client/chromium-56.0.2922.1 build failure with gcc-4.9
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL: https://bugs.chromium.org/p/webrtc/is...
Whiteboard:
Keywords:
: 602554 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-20 13:46 UTC by Seong-ho Cho
Modified: 2017-01-22 05:24 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
webrtc/modules/desktop_capture patch (chromium-webrtc-r1.patch,408 bytes, patch)
2016-11-20 13:46 UTC, Seong-ho Cho
Details | Diff
emerge --info (emerge-info.log,8.96 KB, text/x-log)
2016-11-20 23:00 UTC, Seong-ho Cho
Details
build log (www-client:chromium-56.0.2922.1:20161120-230118.log.xz,142.34 KB, application/x-xz)
2016-11-20 23:27 UTC, Mike Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Seong-ho Cho 2016-11-20 13:46:18 UTC
Created attachment 453804 [details, diff]
webrtc/modules/desktop_capture patch

../../third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc:415:10: error: cannot bind ‘std::unique_ptr<webrtc::{anonymous}::ScreenCapturerLinux>’ lvalue to ‘std::unique_ptr<webrtc::{anonymous}::ScreenCapturerLinux>&&’
   return capturer;
          ^
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/memory:81:0,
                 from ../../third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc:13:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = webrtc::{anonymous}::ScreenCapturerLinux; _Ep = std::default_delete<webrtc::{anonymous}::ScreenCapturerLinux>; <template-parameter-2-3> = void; _Tp = webrtc::DesktopCapturer; _Dp = std::default_delete<webrtc::DesktopCapturer>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
../../third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc:416:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
for the lazy readers:

I found above error, and I suggest my patch to fix an error occured by type mismatch between function return type and return object.

NOTE: This package is currently masked, because it's testing by developers and/or it's unstable.
Comment 1 Mike Gilbert gentoo-dev 2016-11-20 16:28:50 UTC
What specific version(s) of chromium have you tested?

Also, please provide emerge --info and attach a full build log.
Comment 2 Seong-ho Cho 2016-11-20 23:00:45 UTC
Created attachment 453946 [details]
emerge --info
Comment 3 Mike Gilbert gentoo-dev 2016-11-20 23:27:04 UTC
Created attachment 453952 [details]
build log

I can reproduce in an amd64 stable container.
Comment 4 Seong-ho Cho 2016-11-20 23:58:15 UTC
(In reply to Mike Gilbert from comment #3)
> Created attachment 453952 [details]
> build log
> 
> I can reproduce in an amd64 stable container.

Thank you, Mike!
I have the same problem.
Comment 5 Seong-ho Cho 2016-11-20 23:59:24 UTC
and I tried two version,

56.0.2914.3 and here version someone said onto the summary(title?) field.
Comment 6 Mike Gilbert gentoo-dev 2016-11-21 15:49:00 UTC
Unfortunately, I'm really not familiar enough with the WebRTC code or C++ in general to be able to properly review this patch.

Could you please report this issue upstream?

Bug tracker:

http://bugs.webrtc.org/

Code submission guide:

https://webrtc.org/contributing/
Comment 7 Jouni Kosonen 2016-12-10 22:52:36 UTC
A datapoint: I too had to add the capture patch to successfully emerge 
chromium-56.0.2924.21 with gcc-4.9.3.

The upstream issue https://bugs.chromium.org/p/webrtc/issues/detail?id=6760 is currently at WontFix.

www-client/chromium-56.0.2924.21::local-repo was built with the following:
USE="cups hangouts (pic) proprietary-codecs pulseaudio system-ffmpeg tcmalloc widevine -custom-cflags -gnome -gnome-keyring (-gtk3) -kerberos (-neon) (-selinux) -suid -test" ABI_X86="64" L10N="fi -am -ar -bg -bn -ca -cs -da -de -el -en-GB -es -es-419 -et -fa -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -vi -zh-CN -zh-TW"
CXXFLAGS="-march=amdfam10 -O2 -pipe -fno-delete-null-pointer-checks"

$ diff /usr{,/local}/portage/www-client/chromium/chromium-56.0.2924.21.ebuild
165a166
>       "${FILESDIR}/${PN}-56-webrtc_capture.patch"
Comment 8 Ivan Iraci 2016-12-13 10:16:49 UTC
Same problem here.
Comment 9 Mike Gilbert gentoo-dev 2016-12-13 17:34:43 UTC
*** Bug 602554 has been marked as a duplicate of this bug. ***
Comment 10 Norman Shulman 2016-12-13 21:58:09 UTC
(In reply to Jouni Kosonen from comment #7)
> A datapoint: I too had to add the capture patch to successfully emerge 
> chromium-56.0.2924.21 with gcc-4.9.3.

Thanks for the patch!

Version 56.0.2924.21 (64-bit)

> The upstream issue https://bugs.chromium.org/p/webrtc/issues/detail?id=6760
> is currently at WontFix.

Ugh!
Comment 11 Freddie Witherden 2016-12-13 22:28:03 UTC
Can someone try patching:

  return capturer;

to

  return std::move(capturer);

and let me know if it fixes the issue (I am away from my desktop, but believe that this is the 'correct' solution).
Comment 12 Mike Gilbert gentoo-dev 2016-12-13 22:50:58 UTC
Upstream seems like they will accept patches, but only if you follow their code submission guide.

https://webrtc.org/contributing/

As I indicated before, I am not qualified to submit a patch myself.
Comment 13 Thomas Bettler 2016-12-13 23:05:56 UTC
(In reply to Freddie Witherden from comment #11)
> Can someone try patching:
> 
>   return capturer;
> 
> to
> 
>   return std::move(capturer);
> 
> and let me know if it fixes the issue (I am away from my desktop, but
> believe that this is the 'correct' solution).

I can confirm this compiles fine with your solution.
Comment 14 Christian Merkle 2016-12-14 00:14:08 UTC
Same problem here.
Comment 15 Freddie Witherden 2016-12-14 02:15:53 UTC
(In reply to Mike Gilbert from comment #12)
> Upstream seems like they will accept patches, but only if you follow their
> code submission guide.
> 
> https://webrtc.org/contributing/
> 
> As I indicated before, I am not qualified to submit a patch myself.

The issue itself is a GCC bug (4.9.x at least, maybe 4.8.x, too).  Newer versions of GCC, and all of the versions of Clang I have to hand, accept the code fragment without issue.  (Although, for those that are interested, ICC also chokes unless one adds move semantics.)

Given the position of the maintainers for the average user it might be better to upgrade to GCC 5.4.0.
Comment 16 Jouni Kosonen 2016-12-14 12:44:57 UTC
(In reply to Norman Shulman from comment #10)
> (In reply to Jouni Kosonen from comment #7)
> > A datapoint: I too had to add the capture patch to successfully emerge 
> > chromium-56.0.2924.21 with gcc-4.9.3.
> 
> Thanks for the patch!

It's not mine, it's from Seong-ho Cho – thanks belong there.
The Freddie Witherden version from comment #11 worked here too:

--- a/third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc 
+++ b/third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc 
@@ -434,2 +434,2 @@
-  return capturer;
+  return std::move(capturer);
 }
Comment 17 Christian Merkle 2016-12-14 20:19:34 UTC
-  return capturer;
+  return std::unique_ptr<DesktopCapturer>(static_cast<DesktopCapturer*>(capturer.release()));

Fixed the issue for me (at least, chromium compiles again. If that break webrtc? I don't know).
Comment 18 Christian Merkle 2016-12-14 20:29:32 UTC
chromium-57.0.2946.0 has the same webrtc problem, so the fix/patch needs to be used for that version too (Same file, same line).
Comment 19 Mike Gilbert gentoo-dev 2016-12-14 21:02:35 UTC
commit 4e7604710d87d31d8836086bf2e1c2ffa4271235
Author: Mike Gilbert <floppym@gentoo.org>
Date:   Wed Dec 14 16:00:26 2016 -0500

    www-client/chromium: require >=gcc-5

    Package-Manager: Portage-2.3.3_p7, Repoman-2.3.1

 www-client/chromium/chromium-56.0.2924.21.ebuild | 15 +++++++++++----
 www-client/chromium/chromium-57.0.2946.0.ebuild  | 15 +++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)
Comment 20 Seong-ho Cho 2016-12-18 15:16:41 UTC
Thanks for testing my patch, but huuummmmmmmmm ... 

I didn't "feature" test, I'm not sure this patch made webrtc working well. I just checked successful compilation. I need someone who claims for my patch. so I did not yet submit this patch onto the upstream.

The main objective of my patch is just resolving "static cast" problem as we know. I don't know whether capturer object should be remained on the memory as is or not, so I'm not sure that applying Freddie's solution(applying std::move()) is ok. but, anyway, I have consider to test Freddie's suggestion. 

and... yes. This is the bug of gcc-4.9(version-specific bug), we need modify my  suggestion to make be able to build on every version of gcc(without modifing there source line as we can). anyway, my suggestion is just for gcc-4.9, so it should be applied only for gcc-4.9.
Comment 21 Jouni Kosonen 2016-12-18 22:12:35 UTC
(In reply to Seong-ho Cho from comment #20)
> Thanks for testing my patch, but huuummmmmmmmm ... 

Thanks anyway, and the report did end up getting a resolution in the tree.

Of course, the resolution in comment #19 ended up causing rebuilds of 
655 packages to me personally as per[1] but this bug did serve to isolate 
the problem and to point to solutions. 

Adding move semantics as in comment #11 would have been lighter but given the lack of interest in the upstream probably not sustainable in the long run.

[1]https://wiki.gentoo.org/wiki/Upgrading_from_gcc-4.x_to_gcc-5.x
Comment 22 Seong-ho Cho 2016-12-19 00:09:47 UTC
(In reply to Jouni Kosonen from comment #21)
> (In reply to Seong-ho Cho from comment #20)
> > Thanks for testing my patch, but huuummmmmmmmm ... 
> 
> Thanks anyway, and the report did end up getting a resolution in the tree.
> 

Thank you. Than's so clear advise for me.

umm then ... how would we better to deal with this issue?
It seems actually bug-fixed by comment #19. yeah.

I think it is better someone to change this bug status as "fixed". ;)
Comment 23 Mike Gilbert gentoo-dev 2016-12-19 01:55:22 UTC
I was hoping someone would actually get a patch accepted upstream to make it work with stable gcc 4.9.

However it seems that will not actually happen. So it is "FIXED" indeed.
Comment 24 Mike Gilbert gentoo-dev 2017-01-19 23:34:03 UTC
Soap verified that using std::move() to work around this is "correct". I sent a patch upstream.

https://codereview.webrtc.org/2642053003/
Comment 25 Mike Gilbert gentoo-dev 2017-01-22 05:24:28 UTC
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6159ac3f9f5d2eb5be6cbd6737c5ad901e3011c5

warning: only found copies from modified paths due to too many files.
commit 6159ac3f9f5d2eb5be6cbd6737c5ad901e3011c5
Author: Mike Gilbert <floppym@gentoo.org>
Date:   Sun Jan 22 00:22:50 2017 -0500

    www-client/chromium: bump to 56.0.2924.67
    
    Fix build with gcc 4.9.
    
    Bug: https://bugs.gentoo.org/600288
    Package-Manager: Portage-2.3.3_p32, Repoman-2.3.1_p25

 www-client/chromium/Manifest                       |  2 +-
 ...2924.21.ebuild => chromium-56.0.2924.67.ebuild} | 17 ++++----
 www-client/chromium/files/chromium-56-gcc4.patch   | 48 ++++++++++++++++++++++
 3 files changed, 57 insertions(+), 10 deletions(-)