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
Unknown Object (File)
Mar 7 2024, 11:49 PM
Unknown Object (File)
Dec 20 2023, 8:07 AM
Unknown Object (File)
Sep 5 2023, 7:52 PM
Unknown Object (File)
Jul 7 2023, 11:04 AM
Unknown Object (File)
Jun 26 2023, 6:16 PM
Unknown Object (File)
Jun 26 2023, 6:13 PM
Unknown Object (File)
Jun 26 2023, 6:13 PM
Unknown Object (File)
Jun 26 2023, 6:02 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.