Page MenuHomeFreeBSD

tools/build: Work around broken Clang FreeBSD resource dir logic pre-13
ClosedPublic

Authored by jrtc27 on Jul 31 2023, 1:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 30, 2:14 AM
Unknown Object (File)
Sun, Sep 29, 1:10 PM
Unknown Object (File)
Sat, Sep 28, 5:18 PM
Unknown Object (File)
Sat, Sep 28, 12:39 AM
Unknown Object (File)
Fri, Sep 27, 2:17 PM
Unknown Object (File)
Fri, Sep 27, 11:02 AM
Unknown Object (File)
Fri, Sep 27, 5:57 AM
Unknown Object (File)
Mon, Sep 23, 11:00 AM
Subscribers

Details

Summary

Prior to Clang 13 (e.g. in the Clang 11 present in 13.0-RELEASE), the
resource directory logic for FreeBSD was broken and would not resolve
symlinks, meaning symlinks would only work if in a directory next to the
containing lib directory. Therefore we cannot even use a symlink for
worldtmp, we have to make a wrapper script that execs the real binary
via an absolute path.

Reported by: markj
Fixes: 65f28f63a73d ("tools/build: Create toolchain symlinks for non-absolute compiler/linker")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52894
Build 49785: arc lint + arc unit

Event Timeline

Thanks, this fixes the build error for me.

The diff seems reasonable, though pushing each compiler invocation through this wrapper might have a measurable cost. Though, that only affects the first portion of the world build I think? Would it make sense to limit the workaround to clang before version 13?

This revision is now accepted and ready to land.Jul 31 2023, 1:47 AM
This revision now requires review to proceed.Jul 31 2023, 1:56 AM

Thanks, this fixes the build error for me.

The diff seems reasonable, though pushing each compiler invocation through this wrapper might have a measurable cost. Though, that only affects the first portion of the world build I think? Would it make sense to limit the workaround to clang before version 13?

Depends if you force world to be built with the system compiler or not, as I believe it'll end up using the wrappers in that case. Regardless, it's easy enough to limit it, which seems like a good thing to do for this kind of hack.

This version works for me too.

This revision is now accepted and ready to land.Jul 31 2023, 12:53 PM