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)
Wed, Oct 30, 12:08 AM
Unknown Object (File)
Tue, Oct 29, 8:45 PM
Unknown Object (File)
Oct 2 2024, 3:11 PM
Unknown Object (File)
Sep 5 2024, 12:19 PM
Unknown Object (File)
Sep 3 2024, 11:11 PM
Unknown Object (File)
Aug 19 2024, 1:09 PM
Unknown Object (File)
Aug 17 2024, 6:39 PM
Unknown Object (File)
Aug 17 2024, 8:52 AM
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.