[Bug 270922] buildworld should detect noexec on /usr/obj

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 18 Apr 2023 22:37:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270922

            Bug ID: 270922
           Summary: buildworld should detect noexec on /usr/obj
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: mg@fork.pl

When /usr/obj is mounted with noexec/exec=off (clearly user's mistake)
bootstrapped toolset is not used, build silently switches to basesystem toolset
(which is possibly not compatible).

This causes strange errors - in my case (building 12.4) it was:

[Creating nested objdir
/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/clang/libllvm/llvm/IR...]
llvm-tblgen --gen-directive-impl  -I /usr/src/contrib/llvm-project/llvm/include
-d OMP.cpp.d -o OMP.cpp 
/usr/src/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMP.td
llvm-tblgen: Unknown command line argument '--gen-directive-impl'.  Try:
'llvm-tblgen --help'
llvm-tblgen: Did you mean '--gen-intrinsic-impl'?                               
*** Error code 1    


it's because old llvm-tblgen is used instead of
/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin/llvm-tblgen

-rwxr-xr-x  1 root  wheel  5330928 Apr 19 00:22
/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin/llvm-tblgen

# /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin/llvm-tblgen
zsh: permission denied:
/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/clang/llvm-tblgen

-- 
You are receiving this mail because:
You are the assignee for the bug.