From 87ff51a517c71b521c8f755f5628eeed99575f12 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 29 Aug 2023 09:23:55 -0400 Subject: [PATCH 1/3] Write down some options I'd like to experiment with in building FreeBSD. --- ansible/roles/build/files/make.conf | 3 +++ ansible/roles/build/templates/src.conf.j2 | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ansible/roles/build/files/make.conf b/ansible/roles/build/files/make.conf index 15a0a37..c3d11e4 100644 --- a/ansible/roles/build/files/make.conf +++ b/ansible/roles/build/files/make.conf @@ -1,3 +1,6 @@ KERNCONF=CUSTOM BUILD_STATIC=YES +# PORTS_MODULES= +# WITHOUT_MODULES= +# NO_SHARED= diff --git a/ansible/roles/build/templates/src.conf.j2 b/ansible/roles/build/templates/src.conf.j2 index 0f92807..79ab15d 100644 --- a/ansible/roles/build/templates/src.conf.j2 +++ b/ansible/roles/build/templates/src.conf.j2 @@ -10,6 +10,20 @@ WITH_REPRODUCIBLE_BUILD=YES # Would be fun to experiment with: # WITHOUT_SOURCELESS=YES +# WITHOUT_SHARED_TOOLCHAIN=YES +# WITHOUT_GAMES=YES +# WITHOUT_KERBEROS=YES +# WITHOUT_LEGACY_CONSOLE=YES +# WITHOUT_LIB32=YES +# WITHOUT_LOADER_GELI=YES +# WITHOUT_MLX5TOOL=YES +# WITHOUT_NDIS=YES +# WITHOUT_OFED=YES +# WITHOUT_PPP=YES +# WITH_SORT_THREADS=YES +# WITHOUT_TALK=YES +# WITHOUT_TCSH=YES + # Questionable Optimizations WITHOUT_FLOPPY=YES @@ -19,4 +33,3 @@ WITHOUT_IPFILTER=YES WITHOUT_LLVM_TARGET_ALL=YES # Commented out because maybe I want email alerts for failing disks # WITHOUT_MAIL=YES -# WITHOUT_SENDMAIL=YES From 767b925705ef685d37758844f0c1868f2cd3d868 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 25 Aug 2023 18:23:37 -0400 Subject: [PATCH 2/3] Build static binaries with link-time optimization enabled. --- .../files/poudriere.d/13amd64-default-framework-make.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf index a261c3f..fa9bfd6 100644 --- a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf +++ b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf @@ -10,4 +10,4 @@ CPUTYPE?=tigerlake OPTIMIZED_CFLAGS=YES BUILD_OPTIMIZED=YES WITH_CPUFLAGS=YES -BUILD_STATIC=YES +OPTIONS_SET+=STATIC LTO From 383894bd3fef562aba37c84ca428c9e96ad42dd6 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 29 Aug 2023 09:29:27 -0400 Subject: [PATCH 3/3] Disable static on some problem ports. --- ansible/roles/build/files/make.conf | 6 ------ ansible/roles/build/templates/src.conf.j2 | 6 +++--- .../poudriere.d/13amd64-default-framework-make.conf | 11 +++++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ansible/roles/build/files/make.conf b/ansible/roles/build/files/make.conf index c3d11e4..e69de29 100644 --- a/ansible/roles/build/files/make.conf +++ b/ansible/roles/build/files/make.conf @@ -1,6 +0,0 @@ -KERNCONF=CUSTOM - -BUILD_STATIC=YES -# PORTS_MODULES= -# WITHOUT_MODULES= -# NO_SHARED= diff --git a/ansible/roles/build/templates/src.conf.j2 b/ansible/roles/build/templates/src.conf.j2 index 79ab15d..9869264 100644 --- a/ansible/roles/build/templates/src.conf.j2 +++ b/ansible/roles/build/templates/src.conf.j2 @@ -1,12 +1,12 @@ {% if cpu_opt is defined and cpu_opt %} CPUTYPE?={{ cpu_opt }} {% endif %} -OPTIMIZED_CFLAGS=YES -BUILD_OPTIMIZED=YES -WITH_CPUFLAGS=YES +KERNCONF=CUSTOM WITH_MALLOC_PRODUCTION=YES WITHOUT_LLVM_ASSERTIONS=YES WITH_REPRODUCIBLE_BUILD=YES +PORTS_MODULES+=graphics/drm-510-kmod +NO_SHARED=YES # Would be fun to experiment with: # WITHOUT_SOURCELESS=YES diff --git a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf index fa9bfd6..d4b9a21 100644 --- a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf +++ b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf @@ -10,4 +10,15 @@ CPUTYPE?=tigerlake OPTIMIZED_CFLAGS=YES BUILD_OPTIMIZED=YES WITH_CPUFLAGS=YES +# Disable static for subversion because /usr/local/lib/libutf8proc.a not found despite utf8proc being installed +# +# Disable static for netpbm because "ld: error: undefined symbol: libdeflate_free_compressor" which is "referenced by tif_zip.o:(ZIPVSetField) in archive /usr/local/lib/libtiff.a" +# +# Disable static for libsndfile because pulseaudio and libsamplerate fails to find libsndfile.so +# +# Disable static for firefox because "ld: error: /wrkdirs/usr/ports/www/firefox/work/.build/x86_64-unknown-freebsd/release/libgkrust.a(gkrust_shared-8ce2324940b7b6ec.gkrust_shared.45f3776c712ef4bb-cgu.0.rcgu.o): Unknown attribute kind (86) (Producer: 'LLVM16.0.5-rust-1.71.0-stable' Reader: 'LLVM 13.0.1')" +# +# Disable static for zsh because histdb is throwing "failed to load module: zsh/regex" and "-regex-match not available for regex" +.if ${.CURDIR:N*/devel/subversion*} && ${.CURDIR:N*/graphics/netpbm*} && ${.CURDIR:N*/audio/libsndfile*} && ${.CURDIR:N*/www/firefox*} && ${.CURDIR:N*/shells/zsh*} OPTIONS_SET+=STATIC LTO +.endif