Page MenuHomeFreeBSD

clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC}
ClosedPublic

Authored by ivy on Jul 27 2025, 10:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 6:37 AM
Unknown Object (File)
Sat, Oct 11, 6:37 AM
Unknown Object (File)
Sat, Oct 11, 6:37 AM
Unknown Object (File)
Sat, Oct 11, 6:37 AM
Unknown Object (File)
Fri, Oct 10, 11:20 PM
Unknown Object (File)
Sun, Oct 5, 3:47 PM
Unknown Object (File)
Sun, Oct 5, 8:22 AM
Unknown Object (File)
Fri, Sep 26, 3:11 PM
Subscribers

Details

Summary

${.ALLSRC} can include the dependency OptParser.td, which causes
llvm-tblgen to fail since it only accepts a single input argument.

Use ${TDFILE} directly instead, which matches the other invocations
of tblgen in the LLVM Makefiles.

Fixes: d3c06bed2c16 ("clang: install clang-scan-deps")
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Jul 27 2025, 10:40 AM

noticed running buildworld on a recent main. i'm not exactly sure why this used to work and suddenly stopped working, but the change seems correct.

===> usr.bin/clang/clang-scan-deps (all)
--- Opts.inc ---
llvm-tblgen -gen-opt-parser-defs -I /home/ivy/src/bsd/main/contrib/llvm-project/llvm/include -d Opts.inc.d  -o Opts.inc /home/ivy/src/bsd/main/contrib/llvm-project/clang/tools/clang-scan-deps/Opts.td /home/ivy/src/bsd/main/contrib/llvm-project/llvm/include/llvm/Option/OptParser.td
llvm-tblgen: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: llvm-tblgen --help
*** [Opts.inc] Error code 1

make[5]: stopped making "all" in /home/ivy/src/bsd/main/usr.bin/clang/clang-scan-deps
make[5]: 1 error

Yes, this is why ${.ALLSRC} is not always a magic bullet. :)

This revision is now accepted and ready to land.Jul 27 2025, 10:46 AM

this worked on my dev worktree, but not when i built it on main since TDFILE
was set wrong. this should fix both issues!

This revision now requires review to proceed.Jul 27 2025, 11:17 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 28 2025, 12:46 PM
This revision was automatically updated to reflect the committed changes.