From e9cc3f4e6481cae49be58898ab20a4222939b8f8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 12 Sep 2007 21:05:16 +0000 Subject: [PATCH] - Make a few functions hidden, to try and avoid textrels - Disable optimisations on x86 for the same reason (#285961) --- flac-1.2.0-gnu-stack.patch | 35 +++++++++++++++++++++++++++++++++++ flac.spec | 12 ++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/flac-1.2.0-gnu-stack.patch b/flac-1.2.0-gnu-stack.patch index ebe1192..31b7b33 100644 --- a/flac-1.2.0-gnu-stack.patch +++ b/flac-1.2.0-gnu-stack.patch @@ -53,3 +53,38 @@ diff -upr flac-1.2.0.orig/src/libFLAC/ia32/stream_encoder_asm.nasm flac-1.2.0/sr - section .note.GNU-stack noalloc -%endif +section .note.GNU-stack progbits noalloc noexec nowrite align=1 +diff -upr flac-1.2.0/src/libFLAC/bitreader.c flac-1.2.0.new/src/libFLAC/bitreader.c +--- flac-1.2.0/src/libFLAC/bitreader.c 2007-07-23 17:14:35.000000000 +0100 ++++ flac-1.2.0.new/src/libFLAC/bitreader.c 2007-09-12 18:15:30.000000000 +0100 +@@ -203,6 +203,7 @@ static FLaC__INLINE void crc16_update_wo + } + + /* would be static except it needs to be called by asm routines */ ++ __attribute__((__visibility__("hidden"))) + FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) + { + unsigned start, end; +diff -upr flac-1.2.0/src/libFLAC/crc.c flac-1.2.0.new/src/libFLAC/crc.c +--- flac-1.2.0/src/libFLAC/crc.c 2007-02-02 06:58:22.000000000 +0000 ++++ flac-1.2.0.new/src/libFLAC/crc.c 2007-09-12 18:13:44.000000000 +0100 +@@ -73,7 +73,7 @@ FLAC__byte const FLAC__crc8_table[256] = + }; + + /* CRC-16, poly = x^16 + x^15 + x^2 + x^0, init = 0 */ +- ++__attribute__((__visibility__("hidden"))) + unsigned FLAC__crc16_table[256] = { + 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011, + 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022, +diff -upr flac-1.2.0/src/libFLAC/bitreader.c flac-1.2.0.new/src/libFLAC/bitreader.c +--- flac-1.2.0/src/libFLAC/bitreader.c 2007-09-12 18:17:56.000000000 +0100 ++++ flac-1.2.0.new/src/libFLAC/bitreader.c 2007-09-12 19:09:00.000000000 +0100 +@@ -774,6 +774,7 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_ + } + #endif + ++ __attribute__((__visibility__("hidden"))) + FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter) + { + FLAC__uint32 lsbs = 0, msbs = 0; + diff --git a/flac.spec b/flac.spec index 0b22d56..a4d947a 100644 --- a/flac.spec +++ b/flac.spec @@ -1,7 +1,7 @@ Summary: An encoder/decoder for the Free Lossless Audio Codec Name: flac Version: 1.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPL/GPL Group: Applications/Multimedia Source: http://prdownloads.sourceforge.net/flac/flac-%{version}.tar.gz @@ -36,8 +36,11 @@ will use the Free Lossless Audio Codec. %patch1 -p1 -b .gnu-stack %build -export XMMS_CONFIG=no # Disable XMMS +%ifarch %{ix86} +%configure --with-pic --disable-xmms-plugin --disable-asm-optimizations +%else %configure --with-pic --disable-xmms-plugin +%endif make %{?_smp_mflags} @@ -72,6 +75,11 @@ rm -rf %{buildroot} %{_datadir}/aclocal/*.m4 %changelog +* Wed Sep 12 2007 - Bastien Nocera - 1.2.0-3 +- Make a few functions hidden, to try and avoid textrels +- Disable optimisations on x86 for the same reason + (#285961) + * Tue Sep 11 2007 - Bastien Nocera - 1.2.0-2 - Update GNU stack patch to cover all the NASM sources used