git: 29c28cb14a6e - main - lang/perl5.32: fix build on powerpc with llvm 15

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 22 Feb 2023 20:51:44 UTC
The branch main has been updated by pkubaj:

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

commit 29c28cb14a6e51b15a451fa410d660d20d61df4d
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-02-21 00:46:42 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-02-22 20:51:39 +0000

    lang/perl5.32: fix build on powerpc with llvm 15
    
    LD_LIBRARY_PATH=/wrkdirs/usr/ports/lang/perl5.32/work/perl-5.32.1 ./miniperl -Ilib -f write_buildcustomize.pl
    Segmentation fault (core dumped)
---
 lang/perl5.32/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lang/perl5.32/Makefile b/lang/perl5.32/Makefile
index ab326d878717..14e5d6866f52 100644
--- a/lang/perl5.32/Makefile
+++ b/lang/perl5.32/Makefile
@@ -18,7 +18,7 @@ LICENSE_FILE_GPLv1+ =	${WRKSRC}/Copying
 #DEPRECATED=	Support ends three years after .0 release. Please upgrade to a more recent version of Perl
 #EXPIRATION_DATE=2023-06-20
 
-USES=		cpe tar:xz
+USES=		compiler cpe tar:xz
 
 # Give a hint of where libperl.so can be found.
 USE_LDCONFIG=	${PREFIX}/${_ARCH_LIB}/CORE
@@ -195,6 +195,12 @@ PLIST_SUB+=		BINSUFFIX=${PERL_VERSION} \
 CONFIGURE_ARGS+=	-Dversiononly
 .endif
 
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == powerpc && ${COMPILER_VERSION} == 150
+CFLAGS+=	-O1
+.endif
+
 .if !defined(IAMDEFAULTPERL)
 pre-everything::
 	@${ECHO_MSG} "##################################################"
@@ -285,4 +291,4 @@ post-install:
 		done
 	${INSTALL_DATA} ${WRKDIR}/perl-man.conf ${STAGEDIR}${PREFIX}/etc/man.d/perl${PKGNAMESUFFIX}.conf
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>