Summary: | www/firefox fails to build with LTO enabled | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Yasuhito FUTATSUKI <freebsd-bug-report-yf> | ||||
Component: | Individual Port(s) | Assignee: | freebsd-gecko (Nobody) <gecko> | ||||
Status: | Open --- | ||||||
Severity: | Affects Only Me | CC: | alster, cmt, eduardo, grahamperrin, isaac.nudelman, vishwin | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(gecko) |
||||
Version: | Latest | ||||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Yasuhito FUTATSUKI
2022-12-12 11:26:47 UTC
Your experience is in line with expectations. Because Rust 1.65.0 uses/bundles LLVM 15, whereas the WASI toolchain in our tree is still on LLVM 13, and LTO between different LLVM versions was never guaranteed to work anyway. Then it is kind that stopping build with suggession to unset LTO before starting building process, untill the WASI toolchain would get ready. I spent a few days for finding about the LTO option. Is it possible for what's represented at <https://www.freshports.org/www/firefox/#config> to gain a hint? <https://cgit.freebsd.org/ports/tree/www/firefox/Makefile.options> Not really, not least because this LTO procedure is shared amongst all gecko@ ports. The real issue at hand is the mixing-and-matching of LLVM toolchains (and libraries, in mesa's case at least), especially at the bitcode level, just Doesn't Work. I've had LLVM 14's WASI bits working locally, but now that we're on LLVM 15, I've hit a snag porting those WASI bits due to some CMake changes at least. Additionally, there is the thought of revisiting allowing the use of LLVM ports for the Rust toolchain (instead of building the bundled one), since AFAICT the issues that led to removing that option no longer apply. Created attachment 246215 [details]
Fixes LLVM mismatch error
By default Firefox does cross-language LTO, which will cause the version mismatch as Rust tracks a newer LLVM than the wasm toolchain. Disabling cross-langauge LTO fixes the issue.
firefox-126.0_2,2 is failing with LTO. Anyone experience it? Tomorrow I will take a closer look at logs but I didn't a relevant errors, only warnings: ``` In file included from /wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/layers/TextureClient.h:24: /wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/gfx/CriticalSection.h:55:3: warning: mutex 'mMutex' is still held at the end of function [-Wthread-safety-analysis] 55 | } | ^ /wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/gfx/CriticalSection.h:53:26: note: mutex acquired here 53 | DebugOnly<int> err = pthread_mutex_lock(&mMutex); | ^ /wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/gfx/CriticalSection.h:58:26: warning: releasing mutex 'mMutex' that was not held [-Wthread-safety-analysis] 58 | DebugOnly<int> err = pthread_mutex_unlock(&mMutex); | ^ 2 warnings generated. 2 warnings generated. 2 warnings generated. gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build/dom/media' 2 warnings generated. 2 warnings generated. gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build/gfx/thebes' gmake[2]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build' gmake[1]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/config/recurse.mk:34: compile] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build' gmake: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/config/rules.mk:361: all] Error 2 ===> Compilation failed unexpectedly. ``` |