Fri Jun 26 21:19:16 2020 UTC ()
ffmpeg3: Enable section_data_rel_ro on NetBSD

Seems to resolve text relocation issues on aarch64.

Thanks to an upstream commit fixing the exact problem we're having
(on Linux...) from 2014 for the hint...

Bump PKGREVISION.


(nia)
diff -r1.55 -r1.56 pkgsrc/multimedia/ffmpeg3/Makefile
diff -r1.32 -r1.33 pkgsrc/multimedia/ffmpeg3/distinfo
diff -r1.6 -r1.7 pkgsrc/multimedia/ffmpeg3/patches/patch-configure

cvs diff -r1.55 -r1.56 pkgsrc/multimedia/ffmpeg3/Makefile (expand / switch to unified diff)

--- pkgsrc/multimedia/ffmpeg3/Makefile 2020/06/26 03:11:40 1.55
+++ pkgsrc/multimedia/ffmpeg3/Makefile 2020/06/26 21:19:16 1.56
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.55 2020/06/26 03:11:40 jklos Exp $ 1# $NetBSD: Makefile,v 1.56 2020/06/26 21:19:16 nia Exp $
2 2
3PKGNAME= ${DISTNAME:S/ffmpeg/ffmpeg3/} 3PKGNAME= ${DISTNAME:S/ffmpeg/ffmpeg3/}
4PKGREVISION= 8 4PKGREVISION= 9
5MAINTAINER= pkgsrc-users@NetBSD.org 5MAINTAINER= pkgsrc-users@NetBSD.org
6HOMEPAGE= https://ffmpeg.org/ 6HOMEPAGE= https://ffmpeg.org/
7COMMENT= Decoding, encoding and streaming software (v3.x) 7COMMENT= Decoding, encoding and streaming software (v3.x)
8 8
9CONFIGURE_ARGS+= --enable-avfilter 9CONFIGURE_ARGS+= --enable-avfilter
10CONFIGURE_ARGS+= --enable-avresample 10CONFIGURE_ARGS+= --enable-avresample
11CONFIGURE_ARGS+= --enable-postproc 11CONFIGURE_ARGS+= --enable-postproc
12CONFIGURE_ARGS+= --enable-rpath 12CONFIGURE_ARGS+= --enable-rpath
13CONFIGURE_ARGS+= --disable-ffplay 13CONFIGURE_ARGS+= --disable-ffplay
14 14
15INSTALLATION_DIRS= lib/ffmpeg3 share/doc/ffmpeg3 share/examples/ffmpeg3 15INSTALLATION_DIRS= lib/ffmpeg3 share/doc/ffmpeg3 share/examples/ffmpeg3
16 16
17CONF_FILES+= ${PREFIX}/share/examples/ffmpeg3/ffserver.conf \ 17CONF_FILES+= ${PREFIX}/share/examples/ffmpeg3/ffserver.conf \
@@ -46,22 +46,18 @@ post-install: @@ -46,22 +46,18 @@ post-install:
46. if !empty(MACHINE_PLATFORM:MDarwin-*-i386) \ 46. if !empty(MACHINE_PLATFORM:MDarwin-*-i386) \
47 || !empty(MACHINE_PLATFORM:MSunOS-*-i386) \ 47 || !empty(MACHINE_PLATFORM:MSunOS-*-i386) \
48 || !empty(MACHINE_PLATFORM:MNetBSD-*-i386) \ 48 || !empty(MACHINE_PLATFORM:MNetBSD-*-i386) \
49 || !empty(CC_VERSION:Mgcc-[123]*) \ 49 || !empty(CC_VERSION:Mgcc-[123]*) \
50 || !empty(CC_VERSION:Mgcc-4.[01].*) \ 50 || !empty(CC_VERSION:Mgcc-4.[01].*) \
51 || empty(CC_VERSION:Mgcc*) 51 || empty(CC_VERSION:Mgcc*)
52CONFIGURE_ARGS+= --disable-asm 52CONFIGURE_ARGS+= --disable-asm
53. elif !empty(CC_VERSION:Mgcc-[456].*) 53. elif !empty(CC_VERSION:Mgcc-[456].*)
54CFLAGS+= -mstackrealign -mpreferred-stack-boundary=4 54CFLAGS+= -mstackrealign -mpreferred-stack-boundary=4
55. endif 55. endif
56NOT_PAX_MPROTECT_SAFE+= bin/ffmpeg4 56NOT_PAX_MPROTECT_SAFE+= bin/ffmpeg4
57.endif 57.endif
58 58
59.if ${MACHINE_ARCH} == "aarch64" 
60NOT_PAX_MPROTECT_SAFE+= bin/ffmpeg4 
61.endif 
62 
63# configure script uses uname -m to detect arch, as opposed to uname -p in 59# configure script uses uname -m to detect arch, as opposed to uname -p in
64# GNU/configure. Unable to detect NetBSD/macppc hosts correctly. 60# GNU/configure. Unable to detect NetBSD/macppc hosts correctly.
65CONFIGURE_ARGS+= --arch=${MACHINE_ARCH} 61CONFIGURE_ARGS+= --arch=${MACHINE_ARCH}
66 62
67.include "../../multimedia/ffmpeg3/Makefile.common" 63.include "../../multimedia/ffmpeg3/Makefile.common"

cvs diff -r1.32 -r1.33 pkgsrc/multimedia/ffmpeg3/distinfo (expand / switch to unified diff)

--- pkgsrc/multimedia/ffmpeg3/distinfo 2020/01/08 13:41:33 1.32
+++ pkgsrc/multimedia/ffmpeg3/distinfo 2020/06/26 21:19:16 1.33
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: distinfo,v 1.32 2020/01/08 13:41:33 wiz Exp $ 1$NetBSD: distinfo,v 1.33 2020/06/26 21:19:16 nia Exp $
2 2
3SHA1 (ffmpeg-3.4.7.tar.xz) = b9c4b52cda84b0d23c9a542beaf32a68b204c287 3SHA1 (ffmpeg-3.4.7.tar.xz) = b9c4b52cda84b0d23c9a542beaf32a68b204c287
4RMD160 (ffmpeg-3.4.7.tar.xz) = 7dfd08aac3295785034047bd73967a18ce4b8d79 4RMD160 (ffmpeg-3.4.7.tar.xz) = 7dfd08aac3295785034047bd73967a18ce4b8d79
5SHA512 (ffmpeg-3.4.7.tar.xz) = a069618e25753b2c796c4221b5ff9251fea436b11890098166273f456eb7b7832d61f1e7976bd2117f1d55450975a94403be930bb0fa27d7a98cd7c61f80b0d2 5SHA512 (ffmpeg-3.4.7.tar.xz) = a069618e25753b2c796c4221b5ff9251fea436b11890098166273f456eb7b7832d61f1e7976bd2117f1d55450975a94403be930bb0fa27d7a98cd7c61f80b0d2
6Size (ffmpeg-3.4.7.tar.xz) = 8497552 bytes 6Size (ffmpeg-3.4.7.tar.xz) = 8497552 bytes
7SHA1 (patch-Makefile) = 0c35f53878b0420aeea49d8ccb249279e705eb40 7SHA1 (patch-Makefile) = 0c35f53878b0420aeea49d8ccb249279e705eb40
8SHA1 (patch-configure) = a30c25267dec3642a010d7cb66fc98e8c5c0bdea 8SHA1 (patch-configure) = 48245369d03cb41576ab18abb4e93cfc5c2c5267
9SHA1 (patch-doc_Makefile) = 50ee7aaf74f8a5c439b11f141b5408322659543a 9SHA1 (patch-doc_Makefile) = 50ee7aaf74f8a5c439b11f141b5408322659543a
10SHA1 (patch-libavformat_sctp.c) = 22bad9c7dc152aec3c60e0009899af241f495535 10SHA1 (patch-libavformat_sctp.c) = 22bad9c7dc152aec3c60e0009899af241f495535
11SHA1 (patch-libavutil_common.h) = d0f1093bc82567807b39dde990ee347f90a082c9 11SHA1 (patch-libavutil_common.h) = d0f1093bc82567807b39dde990ee347f90a082c9
12SHA1 (patch-libavutil_x86_asm.h) = 8f48f9e8ec08b5176bb40fc0021f3bb913dbef22 12SHA1 (patch-libavutil_x86_asm.h) = 8f48f9e8ec08b5176bb40fc0021f3bb913dbef22
13SHA1 (patch-libavutil_x86_cpu.c) = 9c97e68fde0fcb19741e034a803d509040ea4487 13SHA1 (patch-libavutil_x86_cpu.c) = 9c97e68fde0fcb19741e034a803d509040ea4487

cvs diff -r1.6 -r1.7 pkgsrc/multimedia/ffmpeg3/patches/patch-configure (expand / switch to unified diff)

--- pkgsrc/multimedia/ffmpeg3/patches/patch-configure 2018/05/27 15:24:32 1.6
+++ pkgsrc/multimedia/ffmpeg3/patches/patch-configure 2020/06/26 21:19:16 1.7
@@ -1,28 +1,30 @@ @@ -1,28 +1,30 @@
1$NetBSD: patch-configure,v 1.6 2018/05/27 15:24:32 tsutsui Exp $ 1$NetBSD: patch-configure,v 1.7 2020/06/26 21:19:16 nia Exp $
2 2
3Enable PIC on NetBSD, even on i386 to avoid text relocations. 3Enable PIC and section_data_rel_ro on NetBSD, even on i386,
 4to avoid text relocations.
4 5
5--- configure.orig 2018-02-12 00:29:18.000000000 +0000 6--- configure.orig 2019-12-01 22:46:41.000000000 +0000
6+++ configure 7+++ configure
7@@ -4940,6 +4940,7 @@ case $target_os in 8@@ -4941,6 +4941,8 @@ case $target_os in
8 ;; 9 ;;
9 netbsd) 10 netbsd)
10 disable symver 11 disable symver
11+ enable pic 12+ enable pic
 13+ enable section_data_rel_ro
12 oss_indev_extralibs="-lossaudio" 14 oss_indev_extralibs="-lossaudio"
13 oss_outdev_extralibs="-lossaudio" 15 oss_outdev_extralibs="-lossaudio"
14 enabled gcc || check_ldflags -Wl,-zmuldefs 16 enabled gcc || check_ldflags -Wl,-zmuldefs
15@@ -5360,10 +5361,13 @@ check_cc <<EOF && enable attribute_may_a 17@@ -5361,10 +5363,13 @@ check_cc <<EOF && enable attribute_may_a
16 union { int x; } __attribute__((may_alias)) x; 18 union { int x; } __attribute__((may_alias)) x;
17 EOF 19 EOF
18  20
19-check_cc <<EOF || die "endian test failed" 21-check_cc <<EOF || die "endian test failed"
20-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'; 22-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
21+check_exec <<EOF || enable bigendian 23+check_exec <<EOF || enable bigendian
22+int main() 24+int main()
23+{ 25+{
24+ long one = 1; 26+ long one = 1;
25+ return !(*((char *)(&one))); 27+ return !(*((char *)(&one)));
26+} 28+}
27 EOF 29 EOF
28-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian 30-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian