- fix building with gcc-4.3

- reenable some assembly optimizations
- hide private libFLAC symbols (#285961)
- update license tag
- add %%check
This commit is contained in:
Miroslav Lichvar 2008-01-29 18:10:18 +00:00
parent c85dab7a7c
commit d03de03fb9
6 changed files with 192 additions and 104 deletions

View File

@ -1,90 +0,0 @@
diff -upr flac-1.2.0.orig/src/libFLAC/ia32/bitreader_asm.nasm flac-1.2.0/src/libFLAC/ia32/bitreader_asm.nasm
--- flac-1.2.0.orig/src/libFLAC/ia32/bitreader_asm.nasm 2007-03-30 01:54:17.000000000 +0100
+++ flac-1.2.0/src/libFLAC/ia32/bitreader_asm.nasm 2007-09-11 15:21:48.000000000 +0100
@@ -563,6 +563,4 @@ cident FLAC__bitreader_read_rice_signed_
end
-%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
-%endif
+section .note.GNU-stack progbits noalloc noexec nowrite align=1
diff -upr flac-1.2.0.orig/src/libFLAC/ia32/cpu_asm.nasm flac-1.2.0/src/libFLAC/ia32/cpu_asm.nasm
--- flac-1.2.0.orig/src/libFLAC/ia32/cpu_asm.nasm 2007-03-22 03:13:11.000000000 +0000
+++ flac-1.2.0/src/libFLAC/ia32/cpu_asm.nasm 2007-09-11 15:21:59.000000000 +0100
@@ -116,6 +116,4 @@ cident FLAC__cpu_info_extended_amd_asm_i
end
-%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
-%endif
+section .note.GNU-stack progbits noalloc noexec nowrite align=1
diff -upr flac-1.2.0.orig/src/libFLAC/ia32/fixed_asm.nasm flac-1.2.0/src/libFLAC/ia32/fixed_asm.nasm
--- flac-1.2.0.orig/src/libFLAC/ia32/fixed_asm.nasm 2007-03-22 03:13:11.000000000 +0000
+++ flac-1.2.0/src/libFLAC/ia32/fixed_asm.nasm 2007-09-11 15:22:06.000000000 +0100
@@ -307,6 +307,4 @@ cident FLAC__fixed_compute_best_predicto
end
-%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
-%endif
+section .note.GNU-stack progbits noalloc noexec nowrite align=1
diff -upr flac-1.2.0.orig/src/libFLAC/ia32/lpc_asm.nasm flac-1.2.0/src/libFLAC/ia32/lpc_asm.nasm
--- flac-1.2.0.orig/src/libFLAC/ia32/lpc_asm.nasm 2007-03-22 03:13:11.000000000 +0000
+++ flac-1.2.0/src/libFLAC/ia32/lpc_asm.nasm 2007-09-11 15:22:13.000000000 +0100
@@ -1506,6 +1506,4 @@ cident FLAC__lpc_restore_signal_asm_ia32
end
-%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
-%endif
+section .note.GNU-stack progbits noalloc noexec nowrite align=1
diff -upr flac-1.2.0.orig/src/libFLAC/ia32/stream_encoder_asm.nasm flac-1.2.0/src/libFLAC/ia32/stream_encoder_asm.nasm
--- flac-1.2.0.orig/src/libFLAC/ia32/stream_encoder_asm.nasm 2007-06-20 02:23:49.000000000 +0100
+++ flac-1.2.0/src/libFLAC/ia32/stream_encoder_asm.nasm 2007-09-11 15:22:21.000000000 +0100
@@ -154,6 +154,4 @@ cident precompute_partition_info_sums_32
end
-%ifdef OBJ_FORMAT_elf
- 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;

74
flac-1.2.1-asm.patch Normal file
View File

@ -0,0 +1,74 @@
diff -up flac-1.2.1/src/libFLAC/stream_decoder.c.asm flac-1.2.1/src/libFLAC/stream_decoder.c
--- flac-1.2.1/src/libFLAC/stream_decoder.c.asm 2007-09-13 17:38:05.000000000 +0200
+++ flac-1.2.1/src/libFLAC/stream_decoder.c 2008-01-29 10:32:17.000000000 +0100
@@ -421,7 +421,7 @@ static FLAC__StreamDecoderInitStatus ini
#ifdef FLAC__CPU_IA32
FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
#ifdef FLAC__HAS_NASM
-#if 1 /*@@@@@@ OPT: not clearly faster, needs more testing */
+#if 0 /*@@@@@@ OPT: not clearly faster, needs more testing */
if(decoder->private_->cpuinfo.data.ia32.bswap)
decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap;
#endif
diff -up flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100
+++ flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm 2008-01-29 10:34:09.000000000 +0100
@@ -1507,5 +1507,5 @@ cident FLAC__lpc_restore_signal_asm_ia32
end
%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
+ section .note.GNU-stack progbits noalloc noexec nowrite align=1
%endif
diff -up flac-1.2.1/src/libFLAC/ia32/Makefile.in.asm flac-1.2.1/src/libFLAC/ia32/Makefile.in
--- flac-1.2.1/src/libFLAC/ia32/Makefile.in.asm 2007-09-16 22:05:12.000000000 +0200
+++ flac-1.2.1/src/libFLAC/ia32/Makefile.in 2008-01-29 10:32:17.000000000 +0100
@@ -254,7 +254,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES)
libFLAC_asm_la_LDFLAGS =
libFLAC_asm_la_LIBADD =
-am_libFLAC_asm_la_OBJECTS = bitreader_asm.lo cpu_asm.lo fixed_asm.lo \
+am_libFLAC_asm_la_OBJECTS = cpu_asm.lo fixed_asm.lo \
lpc_asm.lo stream_encoder_asm.lo
libFLAC_asm_la_OBJECTS = $(am_libFLAC_asm_la_OBJECTS)
diff -up flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm.asm 2007-03-30 02:54:53.000000000 +0200
+++ flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm 2008-01-29 10:32:57.000000000 +0100
@@ -564,5 +564,5 @@ cident FLAC__bitreader_read_rice_signed_
end
%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
+ section .note.GNU-stack progbits noalloc noexec nowrite align=1
%endif
diff -up flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100
+++ flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm 2008-01-29 10:33:52.000000000 +0100
@@ -308,5 +308,5 @@ cident FLAC__fixed_compute_best_predicto
end
%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
+ section .note.GNU-stack progbits noalloc noexec nowrite align=1
%endif
diff -up flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100
+++ flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm 2008-01-29 10:33:24.000000000 +0100
@@ -117,5 +117,5 @@ cident FLAC__cpu_info_extended_amd_asm_i
end
%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
+ section .note.GNU-stack progbits noalloc noexec nowrite align=1
%endif
diff -up flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.asm 2007-06-19 22:01:27.000000000 +0200
+++ flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm 2008-01-29 10:34:40.000000000 +0100
@@ -155,5 +155,5 @@ cident precompute_partition_info_sums_32
end
%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
+ section .note.GNU-stack progbits noalloc noexec nowrite align=1
%endif

11
flac-1.2.1-gcc43.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up flac-1.2.1/examples/cpp/encode/file/main.cpp.gcc43 flac-1.2.1/examples/cpp/encode/file/main.cpp
--- flac-1.2.1/examples/cpp/encode/file/main.cpp.gcc43 2007-09-13 17:58:03.000000000 +0200
+++ flac-1.2.1/examples/cpp/encode/file/main.cpp 2008-01-08 10:27:39.000000000 +0100
@@ -29,6 +29,7 @@
#endif
#include <stdio.h>
+#include <string.h>
#include <stdlib.h>
#include "FLAC++/metadata.h"
#include "FLAC++/encoder.h"

39
flac-1.2.1-hidesyms.patch Normal file
View File

@ -0,0 +1,39 @@
diff -up flac-1.2.1/src/libFLAC/include/private/ogg_helper.h.hidesyms flac-1.2.1/src/libFLAC/include/private/ogg_helper.h
--- flac-1.2.1/src/libFLAC/include/private/ogg_helper.h.hidesyms 2007-02-02 07:22:40.000000000 +0100
+++ flac-1.2.1/src/libFLAC/include/private/ogg_helper.h 2008-01-29 15:27:13.000000000 +0100
@@ -35,9 +35,13 @@
#include <ogg/ogg.h>
#include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoder */
+__attribute__((__visibility__("hidden")))
void simple_ogg_page__init(ogg_page *page);
+__attribute__((__visibility__("hidden")))
void simple_ogg_page__clear(ogg_page *page);
+__attribute__((__visibility__("hidden")))
FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data);
+__attribute__((__visibility__("hidden")))
FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data);
#endif
diff -up flac-1.2.1/src/libFLAC/include/private/bitreader.h.hidesyms flac-1.2.1/src/libFLAC/include/private/bitreader.h
--- flac-1.2.1/src/libFLAC/include/private/bitreader.h.hidesyms 2007-07-10 22:22:19.000000000 +0200
+++ flac-1.2.1/src/libFLAC/include/private/bitreader.h 2008-01-29 15:27:13.000000000 +0100
@@ -95,5 +95,6 @@ FLAC__bool FLAC__bitreader_read_golomb_u
FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen);
FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen);
+__attribute__((__visibility__("hidden")))
FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br);
#endif
diff -up flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.hidesyms flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm
--- flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.hidesyms 2008-01-29 15:27:13.000000000 +0100
+++ flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm 2008-01-29 15:28:32.000000000 +0100
@@ -34,7 +34,7 @@
data_section
-cglobal precompute_partition_info_sums_32bit_asm_ia32_
+cglobal precompute_partition_info_sums_32bit_asm_ia32_:function hidden
code_section

40
flac-1.2.1-tests.patch Normal file
View File

@ -0,0 +1,40 @@
diff -up flac-1.2.1/test/test_seeking.sh.tests flac-1.2.1/test/test_seeking.sh
--- flac-1.2.1/test/test_seeking.sh.tests 2007-09-11 09:33:04.000000000 +0200
+++ flac-1.2.1/test/test_seeking.sh 2008-01-29 13:52:03.000000000 +0100
@@ -103,7 +103,7 @@ tiny_seek_count=100
if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
small_seek_count=10000
else
- small_seek_count=100000
+ small_seek_count=100
fi
for suffix in '' '-s' ; do
diff -up flac-1.2.1/test/Makefile.in.tests flac-1.2.1/test/Makefile.in
--- flac-1.2.1/test/Makefile.in.tests 2007-09-16 22:05:27.000000000 +0200
+++ flac-1.2.1/test/Makefile.in 2008-01-29 13:51:33.000000000 +0100
@@ -231,8 +231,7 @@ TESTS = \
./test_grabbag.sh \
./test_flac.sh \
./test_metaflac.sh \
- ./test_seeking.sh \
- ./test_streams.sh
+ ./test_seeking.sh
EXTRA_DIST = \
diff -up flac-1.2.1/src/test_streams/main.c.tests flac-1.2.1/src/test_streams/main.c
--- flac-1.2.1/src/test_streams/main.c.tests 2007-08-31 07:54:49.000000000 +0200
+++ flac-1.2.1/src/test_streams/main.c 2008-01-29 13:53:46.000000000 +0100
@@ -898,9 +898,9 @@ int main(int argc, char *argv[])
if(!generate_noise("noise.raw", 65536 * 8 * 3)) return 1;
if(!generate_noise("noise8m32.raw", 32)) return 1;
if(!generate_wackywavs()) return 1;
- for(channels = 1; channels <= 8; channels++) {
+ for(channels = 1; channels <= 2; channels++) {
unsigned bits_per_sample;
- for(bits_per_sample = 4; bits_per_sample <= 24; bits_per_sample++) {
+ for(bits_per_sample = 8; bits_per_sample <= 24; bits_per_sample += 8) {
static const unsigned nsamples[] = { 1, 111, 4777 } ;
unsigned samples;
for(samples = 0; samples < sizeof(nsamples)/sizeof(nsamples[0]); samples++) {

View File

@ -1,17 +1,21 @@
Summary: An encoder/decoder for the Free Lossless Audio Codec
Name: flac
Version: 1.2.1
Release: 1%{?dist}
License: LGPL/GPL
Release: 2%{?dist}
License: BSD and GPLv2+
Group: Applications/Multimedia
Source: http://prdownloads.sourceforge.net/flac/flac-%{version}.tar.gz
Patch1: flac-1.2.0-gnu-stack.patch
Patch1: flac-1.2.1-asm.patch
Patch2: flac-1.2.1-gcc43.patch
Patch3: flac-1.2.1-hidesyms.patch
Patch4: flac-1.2.1-tests.patch
URL: http://flac.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel, libogg-devel, doxygen, nasm
BuildRequires: gettext-devel
Obsoletes: flac-libs
Provides: flac-libs
BuildRequires: libogg-devel
%ifarch %{ix86}
# 2.0 supports symbol visibility
BuildRequires: nasm >= 2.0
%endif
%description
FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
@ -22,7 +26,7 @@ a command-line metadata editor for FLAC files and input plugins for
various music players.
%package devel
Summary: Static libraries and header files from FLAC
Summary: Development libraries and header files from FLAC
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
@ -33,14 +37,14 @@ will use the Free Lossless Audio Codec.
%prep
%setup -q
%patch1 -p1 -b .gnu-stack
%patch1 -p1 -b .asm
%patch2 -p1 -b .gcc43
%patch3 -p1 -b .hidesyms
# reduce number of tests
%patch4 -p1 -b .tests
%build
%ifarch %{ix86}
%configure --with-pic --disable-xmms-plugin --disable-asm-optimizations
%else
%configure --with-pic --disable-xmms-plugin
%endif
%configure --disable-xmms-plugin
make %{?_smp_mflags}
@ -49,6 +53,9 @@ rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
find doc/ -name "Makefile*" -exec rm -f {} \;
%check
make -C test check &> /dev/null
%clean
rm -rf %{buildroot}
@ -75,6 +82,13 @@ rm -rf %{buildroot}
%{_datadir}/aclocal/*.m4
%changelog
* Tue Jan 29 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.2.1-2
- fix building with gcc-4.3
- reenable some assembly optimizations
- hide private libFLAC symbols (#285961)
- update license tag
- add %%check
* Mon Sep 17 2007 - Bastien Nocera <bnocera@redhat.com> - 1.2.1-1
- Update to 1.2.1