git: a5c00c6cee0c - 2025Q2 - databases/kyotocabinet: Avoid -march=native to avoid SIGILL

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Mon, 05 May 2025 10:22:39 UTC
The branch 2025Q2 has been updated by mandree:

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

commit a5c00c6cee0c441ccff3a9b578f345bec62142d1
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2025-05-05 10:15:36 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-05-05 10:19:17 +0000

    databases/kyotocabinet: Avoid -march=native to avoid SIGILL
    
    which stems from our builders baking AVX512 instructions such as KMOVD
    into the kyotocabinet binary packages on amd64, or similar on other
    architectures.
    
    Since AVX512 isn't ubiquitous, these need to be removed, and we can't
    have -m64 or -march=native for packages.
    
    Patch by Daniel Engberg, Matthias Andree (mandree@) left -fPIC in.
    
    PR:             286182
    Approved by:    maintainer timeout (sunpoet@, 17 days)
    MFH:            2025Q2
    
    (cherry picked from commit 3c230784844d3d75af1c01da8f26ef2dc97494bf)
---
 databases/kyotocabinet/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/databases/kyotocabinet/Makefile b/databases/kyotocabinet/Makefile
index 55089b058f8b..540f015c6af0 100644
--- a/databases/kyotocabinet/Makefile
+++ b/databases/kyotocabinet/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	kyotocabinet
 PORTVERSION=	1.2.80
+PORTREVISION=	1
 CATEGORIES=	databases
 MASTER_SITES=	https://dbmx.net/kyotocabinet/pkg/ \
 		LOCAL/sunpoet
@@ -27,6 +28,12 @@ OPTIONS_DEFINE=	DOCS
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|-lstdc++ ||g' ${WRKSRC}/configure ${WRKSRC}/doc/spex.html ${WRKSRC}/example/Makefile ${WRKSRC}/lab/kcdict/Makefile
+	@${REINPLACE_CMD} -e 's|-g0 -O2||g' \
+	    ${PATCH_WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|-march=native||g' \
+	    ${PATCH_WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|-m64 ||g' \
+	    ${PATCH_WRKSRC}/configure
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libkyotocabinet.so