Bug 233040 - multimedia/x264: Fails to link: /usr/bin/ld: cannot find -lgcov
Summary: multimedia/x264: Fails to link: /usr/bin/ld: cannot find -lgcov
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kubilay Kocak
Keywords: needs-qa
Depends on:
Reported: 2018-11-06 19:24 UTC by Laurence 'GreenReaper' Parry
Modified: 2019-05-03 11:59 UTC (History)
0 users

See Also:
koobs: maintainer-feedback+

Log of failed build via portupgrade (23.77 KB, text/plain)
2018-11-06 19:24 UTC, Laurence 'GreenReaper' Parry
no flags Details
/etc/make.conf (2.41 KB, text/plain)
2019-05-03 11:53 UTC, Laurence 'GreenReaper' Parry
no flags Details
config.log from libx264 (same happened with x264) (2.52 KB, text/plain)
2019-05-03 11:54 UTC, Laurence 'GreenReaper' Parry
no flags Details
Output of 'pkg version -v' (40.23 KB, text/plain)
2019-05-03 11:59 UTC, Laurence 'GreenReaper' Parry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurence 'GreenReaper' Parry 2018-11-06 19:24:49 UTC
Created attachment 199024 [details]
Log of failed build via portupgrade

I attempted to use portupgrade to upgrade x264-0.155.2917_3 to x264-0.155.2917_4 on 11.2-RELEASE-p4. Linking failed with '/usr/bin/ld: cannot find -lgcov' which appears to refer to a GNU test coverage library

There is "Unknown option --disable-debug, ignored" in the configuration (as well as enable-gpag, enable-lavf and enable-swscale). The full log is attached.

Options selected: LAVF, PGO SWSCALE and GPAC
Not selected: DEBUG, FFMS, GCC and LSMASH

I thought enabling modern GCC might resolve the situation, however it did not. Indeed it did not seem to use it, still showing 'gcc' as the command line.

Built-in gcc is gcc version 4.2.1 20070719  [FreeBSD]

I had gcc6 and gcc7 (gcc version 7.3.0) ports installed and up to date. Installing the port of gcc8 did not resolve the situation.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-20 08:45:25 UTC
Apologies for the delay Laurence.

Is this still an issue with the latest version of the ports tree?

If so, can you please provide more information regarding the system, in particular:

- pkg version -v output (as an attachment) so i can see what gcc/toolchain versions are being used
- /etc/make.conf contents (as an attachment, sanitized if necessary)
- Information re how the build is set to use gcc

I can't find references to lgcov or gcov in the {lib}x264 sources
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-20 08:51:09 UTC
(In reply to Kubilay Kocak from comment #1)

This could be coming in due to the PGO option (due to -fprofile* flag use). 

Could you disable the PGO option and confirm whether or not the issue is still reproducible
Comment 3 Laurence 'GreenReaper' Parry 2019-05-03 11:53:20 UTC
Sorry for my own delay, I had a bunch of other things to poke at recently.

The PGO option seems to 'override' the GCC option, making it configure with 'gcc' rather than 'gcc8' which was installed as a port. gcc 4.2.1 20070719 doesn't understand the option "-fstack-protector-strong" -> "no working C compiler".

Disabling PGO made libx264 compile with the installed gcc8, and allowed x264 to compile as well (I had to do libx264 first manually)

I tried forcing 'gcc8' by altering CC/CXX/CPP in make.conf but they did not seem to have any impact on whether it used gcc in configure. Previously I have also had to avoid using the gold linker with x264 but that was not an issue at this time.
Comment 4 Laurence 'GreenReaper' Parry 2019-05-03 11:53:38 UTC
Created attachment 204184 [details]
Comment 5 Laurence 'GreenReaper' Parry 2019-05-03 11:54:28 UTC
Created attachment 204185 [details]
config.log from libx264 (same happened with x264)
Comment 6 Laurence 'GreenReaper' Parry 2019-05-03 11:57:07 UTC
And now I re-look at the title, this actually turned into a *different* issue. >_<
But it still prevented me from building the port!
Comment 7 Laurence 'GreenReaper' Parry 2019-05-03 11:59:03 UTC
Created attachment 204186 [details]
Output of 'pkg version -v'