git: 58dba5b8212f - main - devel/llvm19: prune build on 32-bit archs

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Tue, 27 Aug 2024 19:23:37 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=58dba5b8212fd4dc77e07f58810ae959ae29fc6e

commit 58dba5b8212fd4dc77e07f58810ae959ae29fc6e
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-08-27 19:23:23 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-08-27 19:23:23 +0000

    devel/llvm19: prune build on 32-bit archs
    
    Given trends in compiler resource use, it is incresingly implausible to
    consider cross-development from a 32-bit system.  As such, stop spending
    time building LLVM bits are are vinishingly unlikely to be used on
    32-bit systems.
    
    Default to BE_NATIVE (no cross build support) on 32-bit plaforms.
    Disable BE_AMDGPU and BE_WASM as well.  BE_AMDGPU consumes enormous
    amounts of memory.  BE_WASM is less problematic, but no one has stood up
    to say they need it so turn it off for now.
    
    Completely disable MLIR and POLLY on 32-bit.  Just building MLIR fails
    routinly on armv7 and there aren't a lot of direct users (it's used by
    FLANG, but FLANG is 64-bit only).  Polly is pretty niche and adds quite
    a bit of build time.
    
    Sponsored by:   DARPA, AFRL
    Differential Revision:  https://reviews.freebsd.org/D46239
---
 devel/llvm19/Makefile | 44 +++++++++++++++++++++++++++++---------------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/devel/llvm19/Makefile b/devel/llvm19/Makefile
index 61a8a9f89200..73d9cec01335 100644
--- a/devel/llvm19/Makefile
+++ b/devel/llvm19/Makefile
@@ -65,6 +65,7 @@ SHEBANG_FILES=	\
 
 SUB_FILES=	llvm-wrapper.sh
 SUB_LIST=	LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
+OPTIONS_SUB=	yes
 
 CMAKE_INSTALL_PREFIX=	${LLVM_PREFIX}
 CMAKE_SOURCE_PATH=	${WRKSRC}/llvm
@@ -85,33 +86,46 @@ CMAKE_ARGS+=	-DLLVM_ENABLE_TERMINFO=OFF
 CMAKE_ARGS+=	-DLLVM_VERSION_SUFFIX=
 
 OPTIONS_DEFINE=	BE_AMDGPU BE_WASM CLANG COMPILER_RT DOCS LLD STATIC_LIBS
-OPTIONS_DEFAULT=	BE_AMDGPU BE_WASM CLANG LLD
 OPTIONS_SINGLE=		BACKENDS
 OPTIONS_SINGLE_BACKENDS=BE_FREEBSD BE_NATIVE BE_STANDARD
+
+OPTIONS_DEFAULT=	CLANG LLD
+
+# BE_NATIVE for 32-bit
+OPTIONS_DEFAULT_armv6=	BE_NATIVE
+OPTIONS_DEFAULT_armv7=	BE_NATIVE
+OPTIONS_DEFAULT_i386=	BE_NATIVE
+OPTIONS_DEFAULT_power=	BE_NATIVE
+# FLAVOR-dependent BE for 64-bit
+_BE_default=	BE_STANDARD BE_AMDGPU BE_WASM
+_BE_lite=	BE_FREEBSD BE_AMDGPU BE_WASM
+OPTIONS_DEFAULT_aarch64=	${_BE_${FLAVOR}}
+OPTIONS_DEFAULT_amd64=		${_BE_${FLAVOR}}
+OPTIONS_DEFAULT_powerpc64=	${_BE_${FLAVOR}}
+OPTIONS_DEFAULT_powerpc64le=	${_BE_${FLAVOR}}
+
 OPTIONS_EXCLUDE_armv6=	COMPILER_RT
 OPTIONS_EXCLUDE_armv7=	COMPILER_RT
-OPTIONS_SUB=	yes
 
-.if ${FLAVOR:Mlite}
-OPTIONS_DEFAULT+=	BE_FREEBSD
-.else
+.if ${FLAVOR:Mdefault}
 OPTIONS_DEFINE+=	EXTRAS FLANG LIT LLDB MLIR OPENMP PYCLANG POLLY
 OPTIONS_DEFINE_amd64=	GOLD
 OPTIONS_DEFINE_powerpc=	GOLD
 OPTIONS_DEFINE_powerpc64=	GOLD
 OPTIONS_DEFINE_powerpc64le=	GOLD
 
-OPTIONS_DEFAULT+=	BE_STANDARD COMPILER_RT EXTRAS LIT LLDB MLIR OPENMP \
+OPTIONS_DEFAULT+=	COMPILER_RT EXTRAS LIT LLDB MLIR OPENMP \
 			PYCLANG POLLY STATIC_LIBS
-OPTIONS_DEFAULT_amd64=	GOLD
-OPTIONS_DEFAULT_powerpc=	GOLD
-OPTIONS_DEFAULT_powerpc64=	GOLD
-OPTIONS_DEFAULT_powerpc64le=	GOLD
-
-OPTIONS_EXCLUDE_armv6+=	FLANG OPENMP
-OPTIONS_EXCLUDE_armv7+=	FLANG OPENMP
-OPTIONS_EXCLUDE_i386=	FLANG OPENMP
-OPTIONS_EXCLUDE_powerpc=	FLANG OPENMP
+OPTIONS_DEFAULT_amd64+=	GOLD
+OPTIONS_DEFAULT_powerpc+=	GOLD
+OPTIONS_DEFAULT_powerpc64+=	GOLD
+OPTIONS_DEFAULT_powerpc64le+=	GOLD
+
+_OPTIONS_EXCLUDE_ptr32=	FLANG MLIR OPENMP POLLY
+OPTIONS_EXCLUDE_armv6+=	${_OPTIONS_EXCLUDE_ptr32}
+OPTIONS_EXCLUDE_armv7+=	${_OPTIONS_EXCLUDE_ptr32}
+OPTIONS_EXCLUDE_i386=	${_OPTIONS_EXCLUDE_ptr32}
+OPTIONS_EXCLUDE_powerpc=	${_OPTIONS_EXCLUDE_ptr32}
 OPTIONS_EXCLUDE_riscv64=	LLDB
 .endif