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.diff -r1.55 -r1.56 pkgsrc/multimedia/ffmpeg3/Makefile
(nia)
@@ -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 | |||
3 | PKGNAME= ${DISTNAME:S/ffmpeg/ffmpeg3/} | 3 | PKGNAME= ${DISTNAME:S/ffmpeg/ffmpeg3/} | |
4 | PKGREVISION= 8 | 4 | PKGREVISION= 9 | |
5 | MAINTAINER= pkgsrc-users@NetBSD.org | 5 | MAINTAINER= pkgsrc-users@NetBSD.org | |
6 | HOMEPAGE= https://ffmpeg.org/ | 6 | HOMEPAGE= https://ffmpeg.org/ | |
7 | COMMENT= Decoding, encoding and streaming software (v3.x) | 7 | COMMENT= Decoding, encoding and streaming software (v3.x) | |
8 | 8 | |||
9 | CONFIGURE_ARGS+= --enable-avfilter | 9 | CONFIGURE_ARGS+= --enable-avfilter | |
10 | CONFIGURE_ARGS+= --enable-avresample | 10 | CONFIGURE_ARGS+= --enable-avresample | |
11 | CONFIGURE_ARGS+= --enable-postproc | 11 | CONFIGURE_ARGS+= --enable-postproc | |
12 | CONFIGURE_ARGS+= --enable-rpath | 12 | CONFIGURE_ARGS+= --enable-rpath | |
13 | CONFIGURE_ARGS+= --disable-ffplay | 13 | CONFIGURE_ARGS+= --disable-ffplay | |
14 | 14 | |||
15 | INSTALLATION_DIRS= lib/ffmpeg3 share/doc/ffmpeg3 share/examples/ffmpeg3 | 15 | INSTALLATION_DIRS= lib/ffmpeg3 share/doc/ffmpeg3 share/examples/ffmpeg3 | |
16 | 16 | |||
17 | CONF_FILES+= ${PREFIX}/share/examples/ffmpeg3/ffserver.conf \ | 17 | CONF_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*) | |
52 | CONFIGURE_ARGS+= --disable-asm | 52 | CONFIGURE_ARGS+= --disable-asm | |
53 | . elif !empty(CC_VERSION:Mgcc-[456].*) | 53 | . elif !empty(CC_VERSION:Mgcc-[456].*) | |
54 | CFLAGS+= -mstackrealign -mpreferred-stack-boundary=4 | 54 | CFLAGS+= -mstackrealign -mpreferred-stack-boundary=4 | |
55 | . endif | 55 | . endif | |
56 | NOT_PAX_MPROTECT_SAFE+= bin/ffmpeg4 | 56 | NOT_PAX_MPROTECT_SAFE+= bin/ffmpeg4 | |
57 | .endif | 57 | .endif | |
58 | 58 | |||
59 | .if ${MACHINE_ARCH} == "aarch64" | |||
60 | NOT_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. | |
65 | CONFIGURE_ARGS+= --arch=${MACHINE_ARCH} | 61 | CONFIGURE_ARGS+= --arch=${MACHINE_ARCH} | |
66 | 62 | |||
67 | .include "../../multimedia/ffmpeg3/Makefile.common" | 63 | .include "../../multimedia/ffmpeg3/Makefile.common" |
@@ -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 | |||
3 | SHA1 (ffmpeg-3.4.7.tar.xz) = b9c4b52cda84b0d23c9a542beaf32a68b204c287 | 3 | SHA1 (ffmpeg-3.4.7.tar.xz) = b9c4b52cda84b0d23c9a542beaf32a68b204c287 | |
4 | RMD160 (ffmpeg-3.4.7.tar.xz) = 7dfd08aac3295785034047bd73967a18ce4b8d79 | 4 | RMD160 (ffmpeg-3.4.7.tar.xz) = 7dfd08aac3295785034047bd73967a18ce4b8d79 | |
5 | SHA512 (ffmpeg-3.4.7.tar.xz) = a069618e25753b2c796c4221b5ff9251fea436b11890098166273f456eb7b7832d61f1e7976bd2117f1d55450975a94403be930bb0fa27d7a98cd7c61f80b0d2 | 5 | SHA512 (ffmpeg-3.4.7.tar.xz) = a069618e25753b2c796c4221b5ff9251fea436b11890098166273f456eb7b7832d61f1e7976bd2117f1d55450975a94403be930bb0fa27d7a98cd7c61f80b0d2 | |
6 | Size (ffmpeg-3.4.7.tar.xz) = 8497552 bytes | 6 | Size (ffmpeg-3.4.7.tar.xz) = 8497552 bytes | |
7 | SHA1 (patch-Makefile) = 0c35f53878b0420aeea49d8ccb249279e705eb40 | 7 | SHA1 (patch-Makefile) = 0c35f53878b0420aeea49d8ccb249279e705eb40 | |
8 | SHA1 (patch-configure) = a30c25267dec3642a010d7cb66fc98e8c5c0bdea | 8 | SHA1 (patch-configure) = 48245369d03cb41576ab18abb4e93cfc5c2c5267 | |
9 | SHA1 (patch-doc_Makefile) = 50ee7aaf74f8a5c439b11f141b5408322659543a | 9 | SHA1 (patch-doc_Makefile) = 50ee7aaf74f8a5c439b11f141b5408322659543a | |
10 | SHA1 (patch-libavformat_sctp.c) = 22bad9c7dc152aec3c60e0009899af241f495535 | 10 | SHA1 (patch-libavformat_sctp.c) = 22bad9c7dc152aec3c60e0009899af241f495535 | |
11 | SHA1 (patch-libavutil_common.h) = d0f1093bc82567807b39dde990ee347f90a082c9 | 11 | SHA1 (patch-libavutil_common.h) = d0f1093bc82567807b39dde990ee347f90a082c9 | |
12 | SHA1 (patch-libavutil_x86_asm.h) = 8f48f9e8ec08b5176bb40fc0021f3bb913dbef22 | 12 | SHA1 (patch-libavutil_x86_asm.h) = 8f48f9e8ec08b5176bb40fc0021f3bb913dbef22 | |
13 | SHA1 (patch-libavutil_x86_cpu.c) = 9c97e68fde0fcb19741e034a803d509040ea4487 | 13 | SHA1 (patch-libavutil_x86_cpu.c) = 9c97e68fde0fcb19741e034a803d509040ea4487 |
@@ -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 | |||
3 | Enable PIC on NetBSD, even on i386 to avoid text relocations. | 3 | Enable PIC and section_data_rel_ro on NetBSD, even on i386, | |
4 | to 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 |