Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 568878

Summary: media-video/aegisub-3.2.2 fails to build with GCC 5.3
Product: Gentoo Linux Reporter: Josh Holmer <shssoichiro>
Component: Current packagesAssignee: Coacher <itumaykin+gentoo>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, jstein, maksbotan, nikoli, shinydoofy, thorus.dv, toralf
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/gentoo/gentoo/pull/543
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 536984    
Attachments: Build log
Emerge --info
Build Log
Build log
aegisub-3.2.2-add-missing-pthread-flags.patch
Build log for patch from comment 13
aegisub-3.2.2-add-missing-pthread-flags.patch
Build log

Description Josh Holmer 2015-12-20 15:33:36 UTC
Created attachment 419906 [details]
Build log

Previously was able to build aegisub successfully with GCC 4.9 branch. I'm using glibc-2.22-r1, and have rebuilt glibc (and all other libraries using libstdc++) since upgrading to GCC 5.3.

The error message where the build fails is:
x86_64-pc-linux-gnu-g++ -o /var/tmp/portage/media-video/aegisub-3.2.2/work/aegisub-3.2.2/tools/repack-thes-dict -Wl,-O1 -Wl,--as-needed /var/tmp/portage/media-video/aegisub-3.2.2/work/aegisub-3.2.2/tools/repack-thes-dict.o /var/tmp/portage/media-video/aegisub-3.2.2/work/aegisub-3.2.2/lib/libaegisub.a -ldl -lm  -L/usr/lib64 -lboost_filesystem -lboost_locale -lboost_regex -lboost_system -lboost_thread -lboost_chrono -licuuc -licudata -licui18n -licuuc -licudata
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/media-video/aegisub-3.2.2/work/aegisub-3.2.2/lib/libaegisub.a(dispatch.o): undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile.target:64: recipe for target '/var/tmp/portage/media-video/aegisub-3.2.2/work/aegisub-3.2.2/tools/repack-thes-dict' failed


I'm attaching emerge --info and full build log.
Comment 1 Josh Holmer 2015-12-20 15:34:14 UTC
Created attachment 419908 [details]
Emerge --info
Comment 2 Coacher 2015-12-20 16:24:20 UTC
I'll take it.
Comment 3 Coacher 2015-12-20 16:27:45 UTC
(In reply to Josh Holmer from comment #0)
> Created attachment 419906 [details]
> Build log

Your build.log is unreadable after gunzip. For some reason your build.log is gzipped twice. Please reattach a proper one.
Comment 4 Josh Holmer 2015-12-20 17:26:17 UTC
Created attachment 419914 [details]
Build Log
Comment 5 Coacher 2015-12-22 06:15:42 UTC
OK, I think I've fixed it. Please try to build aegisub-3.2.2 again and provide feedback.
Comment 6 Coacher 2015-12-22 06:23:47 UTC
commit d7810e2c933d6630efe6ab54471ef3b65cd1a357
Author: Ilya Tumaykin <itumaykin@gmail.com>
Date:   Mon Dec 21 18:01:31 2015 +0300

    media-video/aegisub: add missing pthread flags

    This also fixes build with GCC-5.

    Gentoo-Bug: 568878

    Package-Manager: portage-2.2.24
Comment 7 Coacher 2015-12-22 10:37:18 UTC
*** Bug 569132 has been marked as a duplicate of this bug. ***
Comment 8 Josh Holmer 2015-12-22 12:11:16 UTC
I am still experiencing the build error, same as before. I can verify that the new patch and the -pthread flag are now appearing in my build log, however the build is failing in the same location.

Attaching new build log.
Comment 9 Josh Holmer 2015-12-22 12:12:02 UTC
Created attachment 420216 [details]
Build log
Comment 10 Toralf Förster gentoo-dev 2015-12-22 12:16:08 UTC
The issue looks similar to those falling into the category "underlinking", or ?
Comment 11 Coacher 2015-12-22 12:47:09 UTC
Toralf, do you also have this problem only with gcc-5.3.0?
Comment 12 Coacher 2015-12-22 13:14:53 UTC
(In reply to Toralf Förster from comment #10)
> The issue looks similar to those falling into the category "underlinking",
> or ?

My take is the problem here with hand-made build system of not the best quality. pthread detecting macro adjusts either linker or preprocessor flags or both. But preprocessor flags are not included in build-system properly where needed. While linker flags are included more or less.
Comment 13 Coacher 2015-12-22 13:16:59 UTC
Created attachment 420228 [details, diff]
aegisub-3.2.2-add-missing-pthread-flags.patch

Could you please test this patch? It should be used as a drop-in replacement for the one that is currently in tree.
Comment 14 shinydoofy 2015-12-22 19:50:45 UTC
Created attachment 420350 [details]
Build log for patch from comment 13

I've got the same original issue. I can see that libaegisub/Makefile is patched successfully, but the build still fails.
Comment 15 Coacher 2015-12-23 22:47:41 UTC
Ugh! I cannot repro this on Fedora 23 live because it fails at some other stage. And I don't want to rebuild world because of libstdc++ breakage.

Will have to find another way to reproduce this.
Comment 16 Josh Holmer 2015-12-23 23:31:57 UTC
Also still experiencing failure on Gentoo with the new patch from comment 13.
Comment 17 Coacher 2015-12-26 05:26:15 UTC
OK. I am able to reproduce this in a clean GCC-5.3.0 chroot.
Comment 18 Guy 2015-12-26 20:05:43 UTC
At the moment, aegisub-9999 also fails for the same reason.

The build log tells me that the 'add-missing-pthread-flags' patch is correctly applied.

Is it worthwhile to you for me to attach my latest build log?

My last attempt was: 

# ls -l /var/tmp/portage/media-video/aegisub-9999/temp/build.log
-rw-rw---- 1 portage portage 227602 Dec 26 14:54 /var/tmp/portage/media-video/aegisub-9999/temp/build.log

Source was prepared with no errors.
Comment 19 Coacher 2015-12-26 21:54:39 UTC
(In reply to Guy from comment #18)

Thank you for the suggestion, but this is not necessary atm. Better yet please test the patch I'll add here first thing tomorrow.
Comment 20 Coacher 2015-12-27 19:03:47 UTC
Created attachment 420948 [details, diff]
aegisub-3.2.2-add-missing-pthread-flags.patch

Here's an updated version of the proposed fix. As before, one should replace with this patch the one with the same name that is currently in tree.

Please test and provide feedback.
Comment 21 Josh Holmer 2015-12-27 19:42:51 UTC
(In reply to Coacher from comment #20)
> Created attachment 420948 [details, diff] [details, diff]
> aegisub-3.2.2-add-missing-pthread-flags.patch
> 
> Here's an updated version of the proposed fix. As before, one should replace
> with this patch the one with the same name that is currently in tree.
> 
> Please test and provide feedback.

This patch fixes the issue on my system.
Comment 22 Coacher 2015-12-27 19:53:08 UTC
(In reply to Josh Holmer from comment #21)
> This patch fixes the issue on my system.

Glad to hear that. Thanks for the info.

Toralf, shinydoofy@gmail.com, can you confirm this?
Comment 23 Guy 2015-12-27 23:54:41 UTC
Patch worked for me as well for aegisub-3.2.2.

I opened a current project with no obvious issues.

Thank you.
Comment 24 Yuki N. 2015-12-27 23:55:41 UTC
Created attachment 420970 [details]
Build log
Comment 25 Yuki N. 2015-12-27 23:57:12 UTC
Comment on attachment 420970 [details]
Build log

Works for me too.
Comment 26 Coacher 2015-12-28 00:03:27 UTC
OK, I've just filed a new PR. See URL. Live ebuild will receive the needed fix, too.

Once we have aegisub fixed in Gentoo, I'll propose these changes upstream for inclusion.
Comment 27 Patrice Clement gentoo-dev 2015-12-28 09:55:00 UTC
commit 46dfefb (HEAD, origin/master, origin/HEAD, master)
Merge: 2b2c711 afe3c23
Author: Patrice Clement <monsieurp@gentoo.org>
Date:   Mon Dec 28 09:52:02 2015 +0000

    Merge remote-tracking branch 'github/pr/543'. Fixes bug 568878.

Thank you!
Comment 28 Coacher 2015-12-28 10:01:49 UTC
I've added some extra improvements on the way.

Could anyone please provide feedback how 3.2.2 from tree (after the commit mentioned in the previous post) works for you?

Guy aka no.tellin@gmail.com it would be great if you could provide feedback for the live ebuild since it seems you are using it.

Thanks.
Comment 29 Guy 2015-12-29 01:48:44 UTC
(In reply to Coacher from comment #28)
> I've added some extra improvements on the way.
> 
> Could anyone please provide feedback how 3.2.2 from tree (after the commit
> mentioned in the previous post) works for you?
> 
> Guy aka no.tellin@gmail.com it would be great if you could provide feedback
> for the live ebuild since it seems you are using it.
> 
> Thanks.

I refreshed my copy of the portage tree and removed /usr/local/portage/media-video/aegisub

Both the in tree 3.2.2 and 9999 versions emerged to completion:

pyrogyro media-video # emerge -1 =media-video/aegisub-3.2.2
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Running pre-merge checks for media-video/aegisub-3.2.2
>>> Emerging (1 of 1) media-video/aegisub-3.2.2::gentoo
>>> Installing (1 of 1) media-video/aegisub-3.2.2::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 3.76, 2.67, 1.57
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
pyrogyro media-video # emerge -1 =media-video/aegisub-9999
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Running pre-merge checks for media-video/aegisub-9999
>>> Emerging (1 of 1) media-video/aegisub-9999::gentoo
>>> Installing (1 of 1) media-video/aegisub-9999::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 3.60, 2.94, 1.94
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date

Thank you for the fix and update!
Comment 30 Kobboi 2015-12-29 01:58:20 UTC
3.2.2 fine for me as well, thanks!
Comment 31 Coacher 2015-12-29 04:56:52 UTC
That's good news. Thanks everyone for the feedback and testing.