Page MenuHomeFreeBSD

Follow-up r320149: Enable GPL_DTC if we're using GCC as the cross-compiler.
ClosedPublic

Authored by bdrewery on Oct 28 2017, 5:52 PM.
Tags
None
Referenced Files
F106135135: D12817.diff
Wed, Dec 25, 11:45 PM
Unknown Object (File)
Thu, Dec 12, 7:32 PM
Unknown Object (File)
Wed, Dec 4, 1:14 AM
Unknown Object (File)
Tue, Dec 3, 8:22 PM
Unknown Object (File)
Nov 16 2024, 8:39 AM
Unknown Object (File)
Nov 16 2024, 5:57 AM
Unknown Object (File)
Nov 8 2024, 6:00 AM
Unknown Object (File)
Nov 6 2024, 2:00 PM
Subscribers
None

Details

Summary

This fixes object files landing in the source tree in gnu/usr.bin/dtc
for GCC platforms.

We cannot reliably detect if an external compiler is used here, and the
default YES option does include GCC_BOOTSTRAP which implies that GCC may
be used for the build.

The problem manifests when not using an external compiler, and the host
compiler is clang. When a fresh build is done (no OBJDIR yet) the
'make obj' treewalk is done before 'make cross-tools', so
COMPILER_FEATURES at this point contains 'c++11' since the host compiler
was used for COMPILER_FEATURES. Once cross-tools builds the GCC
bootstrap compiler and then descends into 'make everything',
COMPILER_FEATURES no longer contains 'c++11' and MK_GPL_DTC defaults to
enabled. Now it builds in gnu/usr.bin/dtc without an OBJDIR preset and
drops files into the source tree.

The COMPILER_FEATURES check here is useful for knowing if we can *bootstrap*
C++11 things. Indeed we do bootstrap dtc as a build tool so it is
useful for enabling the BSD dtc for the build, but we end up needing the
GPL dtc for installation anyway.

Sponsored by: Dell EMC Isilon

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12283
Build 12574: arc lint + arc unit

Event Timeline

Thanks, it's been reported to me multiple times but I've never been able to reproduce.

This revision is now accepted and ready to land.Oct 29 2017, 10:25 AM

Is it the case that the other C++11 option in this block (CLANG) works only because it is split into CLANG and CLANG_BOOTSTRAP? It would otherwise have the same problem, yes?

Is it the case that the other C++11 option in this block (CLANG) works only because it is split into CLANG and CLANG_BOOTSTRAP? It would otherwise have the same problem, yes?

I don't understand the question, but if there was a GPL_DTC_BOOTSTRAP (assuming no meant to use BSD) then we could that that to default yes (no c++11 required) as a bootstrap tool, and then set GPL_DTC to default NO (since the bootstrap compiler can then compile BSD c++11 dtc). Is that what you're asking?

I think so - I'm not suggesting we add GPL_DTC_BOOTSTRAP since it seems it would be more complexity than is warranted, but just checking that the reason we don't have this same problem with Clang is because it's split out into separate enables for the boostrap and installed cases.

This revision was automatically updated to reflect the committed changes.