Bug 223563 - www/firefox: PGO=on build fails
Summary: www/firefox: PGO=on build fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-09 13:47 UTC by johan van Zanten
Modified: 2017-11-10 14:15 UTC (History)
0 users

See Also:


Attachments
poudriere build log for firefox (131.06 KB, application/gzip)
2017-11-09 13:47 UTC, johan van Zanten
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description johan van Zanten 2017-11-09 13:47:52 UTC
Created attachment 187881 [details]
poudriere build log for firefox

I recently created a new jail for building ports with poudriere in FreeBSD-11.  Firefox has never been able to build in this environment. CCACHE is also in use.

The server running pourdrier was recently upgraded to FreeBSD11.1.  It is running a custom kernel. ZFS is in use for the build jail. Please see the attached log for details.

The first fatal error i see in the log is:

/wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/toolkit/components/protobuf/src/google/protobuf/extension_set_heavy.cc: In member function 'void google::protobuf::internal::ExtensionSet::AppendToList(const google::protobuf::Descripto
r*, const google::protobuf::DescriptorPool*, std::__1::vector<const google::protobuf::FieldDescriptor*>*) const':
/wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/toolkit/components/protobuf/src/google/protobuf/extension_set_heavy.cc:97:8: error: reference to 'map' is ambiguous
   for (map<int, Extension>::const_iterator iter = extensions_.begin();
        ^~~
In file included from /usr/include/c++/v1/set:389:0,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/system_wrappers/set:3,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/stl_wrappers/set:44,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/include/google/protobuf/descriptor.h:57,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/toolkit/components/protobuf/src/google/protobuf/extension_set_heavy.cc:39:
/usr/include/c++/v1/__tree:1465:77: note: candidates are: template<class, class, class, class> class std::__1::map
     template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
                                                                             ^~~
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/system_wrappers/map:3:0,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/stl_wrappers/map:44,
                 from /wrkdirs/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd11.1/dist/include/google/protobuf/extension_set.h:42,

--------


/usr/include/c++/v1/set (Within the Jail, and in "real" /usr/include...) appears to be from LLVM, and the compiler in use in the error appears to be g++6 .  Maybe there's a conflict between the two environments?
Comment 1 johan van Zanten 2017-11-09 13:53:04 UTC
I should add that i update the jail and ports area before each build, so
my typical run looks like:

rel_arch=11amd64
release_name=11.1-RELEASE

poudriere jail -u -j $rel_arch -v $release_name

poudriere ports -u -p local

poudriere options -j $rel_arch -p local -z $rel_arch \
  -f /usr/local/etc/poudriere.d/pkglist_fnord_all
poudriere bulk -J 2:4 -j $rel_arch -p local -z $rel_arch \
  -f /usr/local/etc/poudriere.d/pkglist_fnord_all
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-11-09 17:22:48 UTC
Try disabling PGO option.

I only remember PGO working when Firefox could be built with base GCC 4.2. Later GCC versions from ports had some issues with libgcov symbols. After FreeBSD switched to Clang *and* libc++ the latter made using GCC hard because GCC defaults to libstdc++ which is dangerous[1] to use with dependencies built against libc++ (e.g., hunspell). Clang supports PGO (in FreeBSD 11.0+) but the flags are a bit different[2].

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221288#c4
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1064049
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-11-09 17:28:30 UTC

*** This bug has been marked as a duplicate of bug 221451 ***
Comment 4 johan van Zanten 2017-11-10 10:55:06 UTC
Thank you for your help, i'm trying now with PGO off.  My build machine isn't super fast, so it'll take around 4 hours to get to the point where it'd usually fail.

One other slightly weird thing, i hadn't turned PGO on, and was unable to turn it off using the "expected" ways, such as:

cd .../poudriere/ports/local/www/firefox
make config

poudriere options -j 11amd64 -p local -z FreeBSD-11 firefox

In both of those methods, PGO appeared unselected, but when i'd start the build with poudriere, it'd show up in firefox's build log with "PGO=ON"

I was able to disable it by manually editing

/pierogi/poudriere/ports/local/www/firefox/Makefile.options

And removing it from this section, at the top of the file:

OPTIONS_DEFINE+=

It could be i've screwed up my build environment, but it seems less likely (than usual) because it's a pretty fresh one, and i don't think i've manually manipulated anything within it -- i only was using poudriere.
Comment 5 johan van Zanten 2017-11-10 14:15:33 UTC
disabling PGO fixed the problem -- firefox built successfully.