Page MenuHomeFreeBSD

atf: Fix ATF_BUILD_* values when not using the bootstrap compiler
ClosedPublic

Authored by arichardson on Jan 29 2021, 3:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 3:35 AM
Unknown Object (File)
Fri, Mar 22, 12:40 PM
Unknown Object (File)
Fri, Mar 22, 12:40 PM
Unknown Object (File)
Tue, Mar 19, 1:00 AM
Unknown Object (File)
Mar 8 2024, 8:25 AM
Unknown Object (File)
Mar 8 2024, 8:12 AM
Unknown Object (File)
Mar 7 2024, 11:37 AM
Unknown Object (File)
Mar 4 2024, 8:16 PM
Subscribers

Details

Summary

Currently, we encode the full path and compile flags for the build
compiler in libatf. However, these values are not correct when
cross-compiling: For example, when I build on macOS, CC is set to the
host path /usr/local/Cellar/llvm/11.0.0_1/bin/clang-11. This path will
not exist on the target system.
Simplify this logic and use cc/cpp/c++ since those binaries will exist
on the target system unless the compiler was explicitly disabled.
I'm not convinced ATF needs to encode these values, but this is a
minimal fix for these tests when using a non-bootstrapped compiler.

Test Plan

I noticed this while testing an atf contrib update since one of the
tests now requires ATF_BUILD_CC.

Diff Detail

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

Event Timeline

IMO these tests are extremely dubious and fragile. Embedding cc/c++/cpp seems most likely to work at all. I think I've proposed something like this in the past.

This revision is now accepted and ready to land.Feb 2 2021, 6:34 PM

I agree with @brooks ; the functionality that involves compiling as part of tests is very dubious functionality that should be removed.

In D28414#637002, @ngie wrote:

I agree with @brooks ; the functionality that involves compiling as part of tests is very dubious functionality that should be removed.

I agree, I had a look at not compiling those tests but it seems like this change needs to be done inside ATF. For now this works around the problem.