Bug 257468 - www/chromium does not compile on a Pi4, stopping with FAILED: v8_context_snapshot_generator
Summary: www/chromium does not compile on a Pi4, stopping with FAILED: v8_context_snap...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Only Me
Assignee: freebsd-chromium (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-28 02:53 UTC by Bob Prohaska
Modified: 2021-09-01 20:42 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (chromium)


Attachments
v0 (767 bytes, patch)
2021-08-03 18:11 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Prohaska 2021-07-28 02:53:15 UTC
While trying to compile www/chromium using poudriere on a Pi4 running

FreeBSD nemesis.zefox.com 14.0-CURRENT FreeBSD 14.0-CURRENT #3 main-d72d5ced80: Sun Jul 18 22:25:27 PDT 2021 

the build process stopped with
FAILED: v8_context_snapshot_generator .

The text following the error was 
python "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapsh
ot_generator" -- c++ -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -
Wl,-z,relro -Wl,-z,now -Wl,-z,max-page-size=4096 -Wl,--icf=all -Wl,--color-diagn
ostics -flto=thin -Wl,--thinlto-jobs=2 -Wl,--thinlto-cache-dir=thinlto-cache -Wl
,--thinlto-cache-policy,cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -fwhole-program-vtables -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,--lto-O0 -pie -Wl,--disable-new-dtags -Wl,--icf=none -L/usr/local/lib  -fstack-protector-strong -L/usr/local/lib  -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp"  -Wl,--end-group  -lpthread -lgmodule-2.0 -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -lintl -lnss3 -lsmime3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldl -lexecinfo -lkvm -lutil -lrt -ljpeg -lpng16 -lz -lxml2 -lxslt -llzma -lm -lgio-2.0 -lwebpdemux -lwebpmux -lwebp -lfreetype -lexpat -lfontconfig -lharfbuzz-subset -lharfbuzz -lopus -lavcodec -lavformat -lavutil -lopenh264 -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lxcb -ldrm -lxkbcommon -lgbm -latk-1.0 -latk-bridge-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgtk-3 -lgdk-3 -lcairo-gobject -lgdk_pixbuf-2.0 -lXi -lGL -lpci -lsndio -lsnappy -lcups -latspi -ldbus-1
ld.lld: error: undefined symbol: dav1d_get_cpu_flags_arm
>>> referenced by cpu.c
>>>               thinlto-cache/Thin-e24afd.tmp.o:(dav1d_init_cpu)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/www/chromium
=>> Cleaning up wrkdir
===>  Cleaning for chromium-91.0.4472.164
build of www/chromium | chromium-91.0.4472.164 ended at Fri Jul 23 10:58:54 PDT 2021
Comment 1 Mikael Urankar freebsd_committer 2021-08-03 18:11:43 UTC
Created attachment 226922 [details]
v0

it seems caused by lto. It builds fine on my board with this patch (the current behavior is that lto is ON due to the missing LTO_VARS_OFF line)
Can you try the attached patch? You may have to clean your workdir first.
Comment 2 Bob Prohaska 2021-08-03 19:00:36 UTC
Patch applied, waiting for poudriere to quit and clean up 
before restarting. 

bob
Comment 3 Bob Prohaska 2021-08-03 19:43:21 UTC
It just dawned on me that poudriere is untarring chromium,
presumably from distfiles. The patch was applied to www/chromium,
so it seems clear that my experiment can't work. 

Can patches be applied to a poudriere build, or is it better
in this case to just use make in www/chromium ? That is apt
to run afoul of python conflicts but is worth a try if it's
the simplest approach.

Thanks for your help!

bob prohaska
Comment 4 Mikael Urankar freebsd_committer 2021-08-04 11:37:31 UTC
(In reply to Bob Prohaska from comment #3)
I don't understand. Make sure that LTO_VARS_OFF=		GN_ARGS+=use_thin_lto=false is present in www/chromium/Makefile
Comment 5 Bob Prohaska 2021-08-04 19:57:51 UTC
As usual, it's I who does not understand. Doing

bob@nemesis:/usr/ports/www/chromium % grep LTO_VARS_OFF= Makefile
LTO_VARS_OFF=		GN_ARGS+=use_thin_lto=false
bob@nemesis:/usr/ports/www/chromium % 

suggests that the patch applied correctly.

When I saw bsdtar running in a top window I thought poudriere
was repeating something akin to make extract, which would overwrite
the patched file. Perhaps not.
The logfile is up to
[ 68% 32910/47953]
The failure was reported in the mid-90% range, so it'll
be another day or two for results to emerge.

Thanks for your patience!

bob prohaska
Comment 6 Bob Prohaska 2021-08-06 15:11:35 UTC
Looks like the patch worked for me. www/chromium built,installed and runs.

The are a few errors reported on startup, but they don't seem fatal.
I'll bring those up in a separate thread.

Thanks for your help!

bob prohaska
Comment 7 Mikael Urankar freebsd_committer 2021-08-17 17:10:39 UTC
@chromium: can you have a look at the patch? thanks in advance.
Comment 8 Mikael Urankar freebsd_committer 2021-08-27 12:38:54 UTC
(In reply to Mikael Urankar from comment #7)
let's try a PR in github instead:
https://github.com/freebsd/chromium/pull/4
Comment 9 commit-hook freebsd_committer 2021-09-01 10:27:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=447def6dd2c2dd4eb908b4e41ec607e34280bf6c

commit 447def6dd2c2dd4eb908b4e41ec607e34280bf6c
Author:     Bob Prohaska <fbsd@www.zefox.net>
AuthorDate: 2021-09-01 10:08:16 +0000
Commit:     Rene Ladan <rene@FreeBSD.org>
CommitDate: 2021-09-01 10:09:24 +0000

    www/chromium: fix build on aarch64 (RPI4)

    ... by respecting LTO_VARS=off and exlcuding LTO from aarch64

    PR:     257468
    MFH:    2021Q3

 www/chromium/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 10 Rene Ladan freebsd_committer 2021-09-01 10:28:11 UTC
Patch committed, thanks!
Comment 11 commit-hook freebsd_committer 2021-09-01 20:42:12 UTC
A commit in branch 2021Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=909de6c431b73f6d4c28b818506ae80f62668c21

commit 909de6c431b73f6d4c28b818506ae80f62668c21
Author:     Bob Prohaska <fbsd@www.zefox.net>
AuthorDate: 2021-09-01 10:08:16 +0000
Commit:     Rene Ladan <rene@FreeBSD.org>
CommitDate: 2021-09-01 20:35:55 +0000

    www/chromium: fix build on aarch64 (RPI4)

    ... by respecting LTO_VARS=off and exlcuding LTO from aarch64

    PR:     257468
    MFH:    2021Q3
    (cherry picked from commit 447def6dd2c2dd4eb908b4e41ec607e34280bf6c)

 www/chromium/Makefile | 2 ++
 1 file changed, 2 insertions(+)