From 9b5660ee0e507852a02ba5281b571f3e55dffc18 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 19 Nov 2012 11:22:14 +0000 Subject: flac: fix text relocations The recent sanity checks were flagging: ELF binary '.../libFLAC.so.8.2.0' has relocations in .text This is caused by hand-written assembler being invoked badly. Apply a patch from upstream git that uses PIC instead of relocations. [ YOCTO: #3461 ] Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- .../flac/flac-1.2.1/asm-pic.patch | 99 ++++++++++++++++++++++ meta/recipes-multimedia/flac/flac_1.2.1.bb | 5 +- 2 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-multimedia/flac/flac-1.2.1/asm-pic.patch (limited to 'meta/recipes-multimedia/flac') diff --git a/meta/recipes-multimedia/flac/flac-1.2.1/asm-pic.patch b/meta/recipes-multimedia/flac/flac-1.2.1/asm-pic.patch new file mode 100644 index 0000000000..43f29cf1ee --- /dev/null +++ b/meta/recipes-multimedia/flac/flac-1.2.1/asm-pic.patch @@ -0,0 +1,99 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 12022d90dd3adc9f37dc2b16358cbecfe3c5be1c Mon Sep 17 00:00:00 2001 +From: Samuli Suominen +Date: Sun, 15 Jul 2012 15:45:10 +1000 +Subject: [PATCH] Fix assembler code to make it PIC so the dynamic linker does + not have to do text relocations on-the-fly. Patch from Gentoo + via Jaren Stangret + +Signed-off-by: Erik de Castro Lopo +--- + src/libFLAC/ia32/bitreader_asm.nasm | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +diff --git a/src/libFLAC/ia32/bitreader_asm.nasm b/src/libFLAC/ia32/bitreader_asm.nasm +index c6bb8c2..4cd0ea2 100644 +--- a/src/libFLAC/ia32/bitreader_asm.nasm ++++ b/src/libFLAC/ia32/bitreader_asm.nasm +@@ -140,8 +140,13 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap + %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE + mov edi, _FLAC__crc16_table + %else ++%ifdef OBJ_FORMAT_elf ++ mov edi, [esp + 16] ; saved ebx (GOT base) ++ lea edi, [edi + FLAC__crc16_table wrt ..gotoff] ++%else + mov edi, FLAC__crc16_table + %endif ++%endif + ;; eax (ax) crc a.k.a. br->read_crc + ;; ebx (bl) intermediate result index into FLAC__crc16_table[] + ;; ecx br->crc16_align +@@ -216,8 +221,13 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap + %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE + mov edi, _FLAC__crc16_table + %else ++%ifdef OBJ_FORMAT_elf ++ mov edi, [esp + 16] ; saved ebx (GOT base) ++ lea edi, [edi + FLAC__crc16_table wrt ..gotoff] ++%else + mov edi, FLAC__crc16_table + %endif ++%endif + ;; eax (ax) crc a.k.a. br->read_crc + ;; ebx (bl) intermediate result index into FLAC__crc16_table[] + ;; ecx br->crc16_align +@@ -316,8 +326,13 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap + %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE + call _bitreader_read_from_client_ + %else ++%ifdef OBJ_FORMAT_elf ++ mov ebx, [esp + 20] ; saved ebx (GOT base) ++ call bitreader_read_from_client_ wrt ..plt ++%else + call bitreader_read_from_client_ + %endif ++%endif + pop edx ; /* discard, unused */ + pop ecx ; /* restore */ + mov esi, [ebp + 16] ; cwords = br->consumed_words; +@@ -363,13 +378,20 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap + mov [ebp + 16], esi ; br->consumed_words = cwords; + mov [ebp + 20], ecx ; br->consumed_bits = cbits; + push ecx ; /* save */ ++ push ebx ; /* save */ + push ebp ; /* push br argument */ + %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE + call _bitreader_read_from_client_ + %else ++%ifdef OBJ_FORMAT_elf ++ mov ebx, [esp + 24] ; saved ebx (GOT base) ++ call bitreader_read_from_client_ wrt ..plt ++%else + call bitreader_read_from_client_ + %endif ++%endif + pop edx ; /* discard, unused */ ++ pop ebx ; /* restore */ + pop ecx ; /* restore */ + mov esi, [ebp + 16] ; cwords = br->consumed_words; + ; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; +@@ -438,8 +460,13 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap + %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE + mov edi, _FLAC__crc16_table + %else ++%ifdef OBJ_FORMAT_elf ++ mov edi, [esp + 24] ; saved ebx (GOT base) ++ lea edi, [edi + FLAC__crc16_table wrt ..gotoff] ++%else + mov edi, FLAC__crc16_table + %endif ++%endif + ;; eax (ax) crc a.k.a. br->read_crc + ;; ebx (bl) intermediate result index into FLAC__crc16_table[] + ;; ecx br->crc16_align +-- +1.7.2.5 + diff --git a/meta/recipes-multimedia/flac/flac_1.2.1.bb b/meta/recipes-multimedia/flac/flac_1.2.1.bb index 6520b714d8..903de6dc9a 100644 --- a/meta/recipes-multimedia/flac/flac_1.2.1.bb +++ b/meta/recipes-multimedia/flac/flac_1.2.1.bb @@ -14,13 +14,14 @@ LIC_FILES_CHKSUM = "file://COPYING.FDL;md5=ad1419ecc56e060eccf8184a87c4285f \ file://include/FLAC/all.h;beginline=64;endline=69;md5=64474f2b22e9e77b28d8b8b25c983a48" DEPENDS = "libogg" -PR = "r2" +PR = "r3" SRC_URI = "${SOURCEFORGE_MIRROR}/flac/flac-${PV}.tar.gz \ file://disable-xmms-plugin.patch \ file://flac-gcc43-fixes.patch \ file://xmms.m4 \ - file://0001-No-AltiVec-on-SPE.patch" + file://0001-No-AltiVec-on-SPE.patch \ + file://asm-pic.patch" SRC_URI[md5sum] = "153c8b15a54da428d1f0fadc756c22c7" SRC_URI[sha256sum] = "9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf" -- cgit v1.2.3