--- Jamrules.orig	2023-05-24 05:02:11.000000000 -0400
+++ Jamrules	2023-10-27 10:55:40.736403000 -0400
@@ -684,12 +684,11 @@
 	# P4BIN is set to ../p4-bin (relative to P4)
 
 	SubDir AllP4 p4 ;	# where we are
-	SubDir AllP4 p4-bin ;	# where we want to be
+	SubDir AllP4 p4 p4-bin ;	# where we want to be
 	SubDir P4BIN ;		# name is that
 	SubDir AllP4 p4 ;	# back to where we started
 
 	EXEC_SUB_TOKENS =
-		$(OS:L)$(OSVER:EL)$(OSPLAT:EL)
 		$(BUILD)
 		$(TYPE:L) ;
 
@@ -1256,22 +1255,19 @@
 		OPTIM += -Wno-parentheses -Wno-switch -fwrapv ;
 
 		_mflags = ;
-		switch $(OSPLAT:U)
-		{
-		case X86     : _mflags = -m32 ;
-		case X86_64  : _mflags = -m64 ;
-		}
 
 		$(GENFLAGS) += $(_mflags) -pipe ;
 		LINKFLAGS   += $(_mflags) ;
 
-		# With FreeBSD 10.3 ...
-		# binutils now operates in deterministic mode by default,
-		# meaning it doesn't record timestamps in the archives. We
-		# could override that by always running 'ar U', but instead
-		# we chose to tell Jam not to scan the archives.
+	case MIDNIGHTBSD[123]* : 
+		SetCommonCompiler $(OSCOMP:E=clang) ;
 
-		NOARSCAN = true ;
+		OPTIM += -Wno-parentheses -Wno-switch -fwrapv ;
+
+		_mflags = ;
+
+		$(GENFLAGS) += $(_mflags) -pipe ;
+		LINKFLAGS   += $(_mflags) ;
 
 	case HPUX11 :
 		switch $(OSPLAT:EU)-$(OSCOMP:E)
