From 06c9c0b11c6eda0bfaf33d0ad6a7857c28bbe5c8 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Fri, 11 Jun 2021 17:18:02 +0200 Subject: [PATCH] audio/lame: patch and unbreak on riscv64 Apply a patch by the LLVM project to unbreak the build on platforms such as riscv64 with incomplete fpsetmask support. On riscv64 specifically, there are no traps for invalid floating point operations, so whatever this masking code tries to achieve is meaningless anyway. --- audio/lame/Makefile | 4 +--- audio/lame/files/patch-libmp3lame_util.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 audio/lame/files/patch-libmp3lame_util.c diff --git a/audio/lame/Makefile b/audio/lame/Makefile index 5cca6456447a..6bae97c986f9 100644 --- a/audio/lame/Makefile +++ b/audio/lame/Makefile @@ -2,7 +2,7 @@ PORTNAME= lame PORTVERSION= 3.100 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= audio MASTER_SITES= SF/${PORTNAME:tl}/${PORTNAME:tl}/3.100 @@ -12,8 +12,6 @@ COMMENT= Fast MP3 encoder kit LICENSE= LGPL20+ LICENSE_FILE= ${WRKSRC}/COPYING -BROKEN_riscv64= fails to compile: needs FP_X_INV from empty sys/riscv/include/ieeefp.h - USES= gmake iconv libtool USE_LDCONFIG= yes GNU_CONFIGURE= yes diff --git a/audio/lame/files/patch-libmp3lame_util.c b/audio/lame/files/patch-libmp3lame_util.c new file mode 100644 index 000000000000..984bf2af9976 --- /dev/null +++ b/audio/lame/files/patch-libmp3lame_util.c @@ -0,0 +1,14 @@ +--- libmp3lame/util.c.orig 2021-06-11 15:08:59 UTC ++++ libmp3lame/util.c +@@ -843,9 +843,8 @@ disable_FPE(void) + */ + + +- +- +-#if defined(__FreeBSD__) && !defined(__alpha__) ++/* https://reviews.llvm.org/D89557 */ ++#if defined(__FreeBSD__) && defined(FP_X_INV) && defined(FP_X_DZ) + { + /* seet floating point mask to the Linux default */ + fp_except_t mask; -- 2.31.1