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)
Nov 19 2024, 7:31 AM
Unknown Object (File)
Nov 8 2024, 10:57 PM
Unknown Object (File)
Nov 8 2024, 10:56 PM
Unknown Object (File)
Nov 8 2024, 10:49 PM
Unknown Object (File)
Nov 6 2024, 12:47 AM
Unknown Object (File)
Nov 6 2024, 12:36 AM
Unknown Object (File)
Oct 29 2024, 10:21 AM
Unknown Object (File)
Oct 21 2024, 4:42 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 Not Applicable
Unit
Tests Not Applicable

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