diff options
Diffstat (limited to 'repo/libmpeg2')
-rw-r--r-- | repo/libmpeg2/arm-private-symbols.patch | 44 | ||||
-rw-r--r-- | repo/libmpeg2/arm-textrel.patch | 101 | ||||
-rw-r--r-- | repo/libmpeg2/libmpeg2.xibuild | 37 |
3 files changed, 182 insertions, 0 deletions
diff --git a/repo/libmpeg2/arm-private-symbols.patch b/repo/libmpeg2/arm-private-symbols.patch new file mode 100644 index 0000000..222ff99 --- /dev/null +++ b/repo/libmpeg2/arm-private-symbols.patch @@ -0,0 +1,44 @@ +Set visibility of global symbols used in ARM specific assembly file to internal + +--- a/libmpeg2/motion_comp_arm_s.S ++++ b/libmpeg2/motion_comp_arm_s.S +@@ -23,7 +23,8 @@ + + @ ---------------------------------------------------------------- + .align +- .global MC_put_o_16_arm ++ .global MC_put_o_16_arm ++ .internal MC_put_o_16_arm + MC_put_o_16_arm: + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) + pld [r1] +@@ -83,7 +84,8 @@ + + @ ---------------------------------------------------------------- + .align +- .global MC_put_o_8_arm ++ .global MC_put_o_8_arm ++ .internal MC_put_o_8_arm + MC_put_o_8_arm: + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) + pld [r1] +@@ -152,7 +154,8 @@ + .endm + + .align +- .global MC_put_x_16_arm ++ .global MC_put_x_16_arm ++ .internal MC_put_x_16_arm + MC_put_x_16_arm: + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) + pld [r1] +@@ -244,7 +247,8 @@ + + @ ---------------------------------------------------------------- + .align +- .global MC_put_x_8_arm ++ .global MC_put_x_8_arm ++ .internal MC_put_x_8_arm + MC_put_x_8_arm: + @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height) + pld [r1] diff --git a/repo/libmpeg2/arm-textrel.patch b/repo/libmpeg2/arm-textrel.patch new file mode 100644 index 0000000..0a75ceb --- /dev/null +++ b/repo/libmpeg2/arm-textrel.patch @@ -0,0 +1,101 @@ +--- libmpeg2-0.5.1.orig/libmpeg2/motion_comp_arm_s.S ++++ libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S +@@ -30,8 +30,8 @@ + stmfd sp!, {r4-r11, lr} @ R14 is also called LR + and r4, r1, #3 + adr r5, MC_put_o_16_arm_align_jt +- add r5, r5, r4, lsl #2 +- ldr pc, [r5] ++ ldr r5, [r5, r4, lsl #2] ++ add pc, pc, r5 + + MC_put_o_16_arm_align0: + ldmia r1, {r4-r7} +@@ -76,10 +76,10 @@ + bne 1b + ldmfd sp!, {r4-r11, pc} @@ update PC with LR content. + MC_put_o_16_arm_align_jt: +- .word MC_put_o_16_arm_align0 +- .word MC_put_o_16_arm_align1 +- .word MC_put_o_16_arm_align2 +- .word MC_put_o_16_arm_align3 ++ .word MC_put_o_16_arm_align0-MC_put_o_16_arm_align0-8 ++ .word MC_put_o_16_arm_align1-MC_put_o_16_arm_align0-8 ++ .word MC_put_o_16_arm_align2-MC_put_o_16_arm_align0-8 ++ .word MC_put_o_16_arm_align3-MC_put_o_16_arm_align0-8 + + @ ---------------------------------------------------------------- + .align +@@ -90,8 +90,8 @@ + stmfd sp!, {r4-r10, lr} @ R14 is also called LR + and r4, r1, #3 + adr r5, MC_put_o_8_arm_align_jt +- add r5, r5, r4, lsl #2 +- ldr pc, [r5] ++ ldr r5, [r5, r4, lsl #2] ++ add pc, pc, r5 + MC_put_o_8_arm_align0: + ldmia r1, {r4-r5} + add r1, r1, r2 +@@ -134,10 +134,10 @@ + ldmfd sp!, {r4-r10, pc} @@ update PC with LR content. + + MC_put_o_8_arm_align_jt: +- .word MC_put_o_8_arm_align0 +- .word MC_put_o_8_arm_align1 +- .word MC_put_o_8_arm_align2 +- .word MC_put_o_8_arm_align3 ++ .word MC_put_o_8_arm_align0-MC_put_o_8_arm_align0-8 ++ .word MC_put_o_8_arm_align1-MC_put_o_8_arm_align0-8 ++ .word MC_put_o_8_arm_align2-MC_put_o_8_arm_align0-8 ++ .word MC_put_o_8_arm_align3-MC_put_o_8_arm_align0-8 + + @ ---------------------------------------------------------------- + .macro AVG_PW rW1, rW2 +@@ -162,7 +162,8 @@ + ldr r11, [r5] + mvn r12, r11 + add r5, r5, r4, lsl #2 +- ldr pc, [r5, #4] ++ ldr r5, [r5, #4] ++ add pc, pc, r5 + + .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4 + mov \R0, \R0, lsr #(\shift) +@@ -237,10 +238,10 @@ + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. + MC_put_x_16_arm_align_jt: + .word 0x01010101 +- .word MC_put_x_16_arm_align0 +- .word MC_put_x_16_arm_align1 +- .word MC_put_x_16_arm_align2 +- .word MC_put_x_16_arm_align3 ++ .word MC_put_x_16_arm_align0-MC_put_x_16_arm_align0-8 ++ .word MC_put_x_16_arm_align1-MC_put_x_16_arm_align0-8 ++ .word MC_put_x_16_arm_align2-MC_put_x_16_arm_align0-8 ++ .word MC_put_x_16_arm_align3-MC_put_x_16_arm_align0-8 + + @ ---------------------------------------------------------------- + .align +@@ -254,7 +255,8 @@ + ldr r11, [r5] + mvn r12, r11 + add r5, r5, r4, lsl #2 +- ldr pc, [r5, #4] ++ ldr r5, [r5, #4] ++ add pc, pc, r5 + + .macro ADJ_ALIGN_DW shift, R0, R1, R2 + mov \R0, \R0, lsr #(\shift) +@@ -317,7 +319,7 @@ + ldmfd sp!, {r4-r11,pc} @@ update PC with LR content. + MC_put_x_8_arm_align_jt: + .word 0x01010101 +- .word MC_put_x_8_arm_align0 +- .word MC_put_x_8_arm_align1 +- .word MC_put_x_8_arm_align2 +- .word MC_put_x_8_arm_align3 ++ .word MC_put_x_8_arm_align0-MC_put_x_8_arm_align0-8 ++ .word MC_put_x_8_arm_align1-MC_put_x_8_arm_align0-8 ++ .word MC_put_x_8_arm_align2-MC_put_x_8_arm_align0-8 ++ .word MC_put_x_8_arm_align3-MC_put_x_8_arm_align0-8 diff --git a/repo/libmpeg2/libmpeg2.xibuild b/repo/libmpeg2/libmpeg2.xibuild new file mode 100644 index 0000000..ec0a54a --- /dev/null +++ b/repo/libmpeg2/libmpeg2.xibuild @@ -0,0 +1,37 @@ +#!/bin/sh + +NAME="libmpeg2" +DESC="A library for decoding MPEG-1 and MPEG-2 video streams" + +MAKEDEPS="libx11 libice libsm libxext libxv" + +PKG_VER=0.5.1 +SOURCE="https://gentoo.osuosl.org/distfiles/libmpeg2-$PKG_VER.tar.gz" + +ADDITIONAL=" +arm-private-symbols.patch +arm-textrel.patch +" + +prepare() { + apply_patches +} + +build() { + ./configure \ + --prefix=/usr \ + --with-pic \ + --enable-shared \ + --disable-static + make OPT_CFLAGS="$CFLAGS" \ + MPEG2DEC_CFLAGS="$CFLAGS" \ + LIBMPEG2_CFLAGS="" +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} |