This port has some infrastructure to use an optimized function that
uses a function pointer.  Not sure why for arm64 it actually uses that
infrastructure, since the only alternative is the generic C
implementation.  But adding a BTI instruction is the easiest fix.

ok?


Index: audio/mpg123/Makefile
===================================================================
RCS file: /cvs/ports/audio/mpg123/Makefile,v
retrieving revision 1.116
diff -u -p -r1.116 Makefile
--- audio/mpg123/Makefile       30 Mar 2023 12:35:39 -0000      1.116
+++ audio/mpg123/Makefile       24 Jul 2023 19:23:10 -0000
@@ -1,6 +1,7 @@
 COMMENT=       fast console MPEG audio player and decoder library
 
 DISTNAME=      mpg123-1.31.3
+REVISION=      0
 SHARED_LIBS=   mpg123          7.2     # 47.0
 SHARED_LIBS+=  out123          2.1     # 4.7
 SHARED_LIBS+=  syn123          0.1     # 1.5
Index: audio/mpg123/patches/patch-src_libmpg123_dct36_neon64_S
===================================================================
RCS file: audio/mpg123/patches/patch-src_libmpg123_dct36_neon64_S
diff -N audio/mpg123/patches/patch-src_libmpg123_dct36_neon64_S
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ audio/mpg123/patches/patch-src_libmpg123_dct36_neon64_S     24 Jul 2023 
19:23:10 -0000
@@ -0,0 +1,11 @@
+Index: src/libmpg123/dct36_neon64.S
+--- src/libmpg123/dct36_neon64.S.orig
++++ src/libmpg123/dct36_neon64.S
+@@ -49,6 +49,7 @@ dct36_aarch64_COS9:
+       .type ASM_NAME(dct36_neon64), %function
+ #endif
+ ASM_NAME(dct36_neon64):
++      bti             c
+       adrp            x5, AARCH64_PCREL_HI(dct36_aarch64_COS9)
+       add                     x5, x5, AARCH64_PCREL_LO(dct36_aarch64_COS9)
+       cmeq            v28.16b, v28.16b, v28.16b

Reply via email to