Bug 260706 - Mk/bsd.gecko.mk: LLVM_VERSION not set when LTO=OFF and DEFAULT_VERSIONS+= llvm=13 causing www/firefox build failure
Summary: Mk/bsd.gecko.mk: LLVM_VERSION not set when LTO=OFF and DEFAULT_VERSIONS+= llv...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2021-12-26 18:03 UTC by Dan Kotowski
Modified: 2023-05-01 03:49 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (gecko)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kotowski 2021-12-26 18:03:04 UTC
From poudriere build log:

```
===>   firefox-95.0.2,2 depends on file: /usr/local/llvm13/lib/clang//lib/wasi/libclang_rt.builtins-wasm32.a - not found
===>   Installing existing package /packages/All/wasi-compiler-rt13-13.0.0.pkg
[13amd64-usrports] Installing wasi-compiler-rt13-13.0.0...
[13amd64-usrports] Extracting wasi-compiler-rt13-13.0.0: .... done
===>   firefox-95.0.2,2 depends on file: /usr/local/llvm13/lib/clang//lib/wasi/libclang_rt.builtins-wasm32.a - not found
```

This occurs because of Mk/bsd.gecko.mk:L96#L99

```
  95 # Ignore Mk/bsd.default-versions.mk but respect make.conf(5) unless LTO is enabled
  96 .if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mllvm*} || ${PORT_OPTIONS:MLTO}
  97 LLVM_DEFAULT=   13 # chase bundled LLVM in lang/rust for LTO
  98 LLVM_VERSION=   13.0.0 # keep in sync with devel/wasi-compiler-rt${LLVM_DEFAULT}
  99 .endif
```

So with no LTO but llvm=13 explicitly set in make.conf DEFAULT_VERSIONS, it fails to set LLVM_VERSION and thus can't find the necessary file.

Possibly fix by checking for ${DEFAULT_VERSIONS:Mllvm13}
Comment 1 Bengt Ahlgren 2022-07-05 19:14:10 UTC
A "me too"!

An observation: since there are only a few versions of devel/wasi-compiler-rt?? (currently 11 and 13), it does not make sense to obey DEFAULT_VERSIONS=llvm=xx for xx!=11 or 13.

IMO, the easiest solution would be to always pick llvm13, regardless of DEFAULT_VERSIONS.  That is, just remove the conditional completely around LLVM_DEFAULT/LLVM_VERSION settings in Mk/bsd.gecko.mk
Comment 2 Bengt Ahlgren 2022-07-05 19:17:57 UTC
My workaround (in make.conf) while waiting for a fix:

.if ${.CURDIR:M*/www/firefox}
LLVM_VERSION= 13.0.1
.endif
Comment 3 Ghost 2022-07-05 19:27:29 UTC
See https://reviews.freebsd.org/D35289 (also stack).