Re: buildworld failed after deleting /usr/obj

From: qroxana <qroxana_at_protonmail.com>
Date: Sun, 29 Jan 2023 15:06:12 UTC
------- Original Message -------
On Monday, January 23rd, 2023 at 1:44 PM, qroxana <qroxana@protonmail.com> wrote:


> ------- Original Message -------
> On Monday, January 23rd, 2023 at 10:02 AM, Dimitry Andric dim@FreeBSD.org wrote:
> 
> 
> 
> > On 23 Jan 2023, at 04:05, qroxana qroxana@protonmail.com wrote:
> > 
> > > It seems ${MAKEOBJDIR} was not created for usr.bin/clang/llvm-objcopy.
> > > 
> > > --- all_subdir_usr.bin ---
> > > --- objwarn ---
> > > Warning: Object directory not changed from original /usr/src/usr.bin/clang/llvm-objcopy
> > 
> > This is usually an indication that your source directory contains object
> > files, e.g. is "dirty". Run "make clean" from the top level, or clean up
> > your source checkout with something like "git clean".
> > 
> > -Dimitry
> 
> 
> I had tried it with a clean source directory and empty /usr/obj
> 
> # find /usr/src/usr.bin/clang/llvm-objcopy
> /usr/src/usr.bin/clang/llvm-objcopy
> /usr/src/usr.bin/clang/llvm-objcopy/llvm-objcopy.1
> /usr/src/usr.bin/clang/llvm-objcopy/Makefile
> 
> and "make buildworld" still ended with the same error.
> 
> In /usr/src/Makefile.inc1, the _NO_INCLUDE_COMPILERMK=t option prevents creating
> the obj directories for the stuff in usr.bin/clang/.
> 
> 1098 _obj:
> 1099 @echo
> 1100 @echo "--------------------------------------------------------------"
> 1101 @echo ">>> stage 2.2: rebuilding the object tree"
> 
> 1102 @echo "--------------------------------------------------------------"
> 1103 ${+}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj
> 
> > --- all_subdir_usr.bin ---
> > --- objwarn ---
> > Warning: Object directory not changed from original /usr/src/usr.bin/clang/llvm-objcopy
> 
> 
> This happens in stage 4.4, and there's no ${MAKEOBJDIR} directory created
> for usr.bin/clang/llvm-objcopy
> 

It appears buildworld doesn't create the obj directory for usr.bin/clang/llvm-objcopy in stage 2.2 after this commit.

commit adc3c128c6603054586a993d117e5dd808deac17
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: Fri Nov 18 20:12:28 2022 -0800
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: Fri Nov 18 20:12:28 2022 -0800

    src.opts.mk: Require C++20 for C++ support.
    
    libc++ requires C++20, so mark C++ (MK_CXX) as broken if the compiler
    does not support C++20.
    
    Reviewed by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D36893

diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index f69208f21556..5089a034350d 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -348,6 +348,11 @@ __DEFAULT_YES_OPTIONS+=OPENMP
 __DEFAULT_NO_OPTIONS+=OPENMP
 .endif
 
+# libc++ requires C++20
+.if !${COMPILER_FEATURES:Mc++20}
+BROKEN_OPTIONS+=CXX
+.endif
+
 .include <bsd.mkopt.mk>
 
 #