diff --git a/INSTALL b/INSTALL index 03acc13c..a51b7fda 100644 --- a/INSTALL +++ b/INSTALL @@ -56,9 +56,8 @@ There are various library features you can leave out via --disable options (like 1a. Large file support The libmpg123 API includes the generic off_t type for file offsets and thus is subject to shape-shifting on systems that change off_t depending on build flags. -To deal with the incompatibilities that can cause, depending on your build configuration, the library name will change when large file support is enabled. - -Since version 1.12.0, a large-file-enabled libmpg123 (the default set by configure) provides a dual-mode ABI to work. Depending on _FILE_OFFSET_BITS, the mpg123.h header file selects different library symbols to use for your app. +To deal with the incompatibilities that can cause, the library needs to separate code paths for small and large off_t. +Since version 1.12.0, a large-file-enabled libmpg123 (the default set by configure) provides a dual-mode ABI. Depending on _FILE_OFFSET_BITS, the mpg123.h header file selects different library symbols to use for your app. In both large-file and normal mode, the library should just work for your app. diff --git a/NEWS b/NEWS index cec2a2db..018b134f 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ TODO: - Include dumb wrappers to provide names suffixed with _64 on 64 bit machines and _32 on 32 bit machines, respectively, to help clients that insist on defining _FILE_OFFSET_BITS where it is not needed (or with a non-large value). - Tuning of the internal buffer code for feeder mode to minimize its performance impact (works in 4K blocks now). - Workaround for compiler bugs in Open64/PathScale/SunStudio (bug 3004396, suggestion by Doug Gilmore). + Note that Sun Studio is still a tricky fellow, at least when it comes to our preprocessed assembly. + Also, x86-Open64 recently produced another segfault in layer3.c on my box... GNU and intel compilers are what one can use as something stable. - Make mpg123_getformat() return more error codes (like MPG123_NEED_MORE). - Fix handle I/O for clients with small file offset (32 bit when libmpg123 has 64 bit). - Fix 3DNow(Ext) standalone builds. diff --git a/configure.ac b/configure.ac index 327f3aa0..6f766e12 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,6 @@ AC_PREREQ(2.57) dnl ############# Initialisation -d AC_INIT([mpg123], [1.13.0], [mpg123-devel@lists.sourceforge.net]) dnl Increment API_VERSION when the API gets changes (new functions). API_VERSION=26 @@ -901,7 +900,7 @@ fi lfs_alias=enabled AC_ARG_ENABLE(lfs-alias, - [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 in addition to mpg123_seek, mpg123_seek_64 as alias onx86-64) ], + [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 in addition to mpg123_seek, mpg123_seek_64 as alias on x86-64) ], [ if test "x$enableval" = xno; then lfs_alias="disabled" @@ -1058,13 +1057,13 @@ s_i486="$s_i386 synth_i486 dct64_i486" s_i586="$s_i386 synth_i586" s_i586d="$s_i386 synth_i586_dither" s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow" -s_3dnowext="$s_i386 dct64_3dnowext dct64_mmx tabinit_mmx synth_3dnowext" +s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext" if test "x$layer3" = "xenabled"; then s_3dnow="$s_3dnow dct36_3dnow" s_3dnowext="$s_3dnowext dct36_3dnowext" fi s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx" -s_sse="$s_i386 dct64_mmx tabinit_mmx dct64_sse dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " +s_sse="$s_i386 tabinit_mmx dct64_sse dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " s_x86_64="dct64_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32" s_x86multi="getcpuflags" s_dither="dither" diff --git a/src/libmpg123/dct36_3dnow.S b/src/libmpg123/dct36_3dnow.S index 7532eb63..644204f5 100644 --- a/src/libmpg123/dct36_3dnow.S +++ b/src/libmpg123/dct36_3dnow.S @@ -502,7 +502,4 @@ ASM_NAME(dct36_3dnow): popl %ebp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct36_3dnowext.S b/src/libmpg123/dct36_3dnowext.S index 6fc9374a..6bfacc2f 100644 --- a/src/libmpg123/dct36_3dnowext.S +++ b/src/libmpg123/dct36_3dnowext.S @@ -42,7 +42,7 @@ #include "mangle.h" .text - ALIGN32,,31 + ALIGN32 .globl ASM_NAME(dct36_3dnowext) /* .type ASM_NAME(dct36_3dnowext), @function */ ASM_NAME(dct36_3dnowext): @@ -509,7 +509,4 @@ ASM_NAME(dct36_3dnowext): ret /* .size ASM_NAME(dct36_3dnowext), .-ASM_NAME(dct36_3dnowext) */ -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_3dnow.S b/src/libmpg123/dct64_3dnow.S index dcf13b68..cd6060ba 100644 --- a/src/libmpg123/dct64_3dnow.S +++ b/src/libmpg123/dct64_3dnow.S @@ -709,7 +709,4 @@ ASM_NAME(dct64_3dnow): ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_3dnowext.S b/src/libmpg123/dct64_3dnowext.S index 49f86678..1b4c5831 100644 --- a/src/libmpg123/dct64_3dnowext.S +++ b/src/libmpg123/dct64_3dnowext.S @@ -36,7 +36,7 @@ x_plus_minus_3dnow: .long -2147483648 .text - ALIGN32,,31 + ALIGN32 .globl ASM_NAME(dct64_3dnowext) /* .type ASM_NAME(dct64_3dnowext), @function */ ASM_NAME(dct64_3dnowext): @@ -711,7 +711,4 @@ ASM_NAME(dct64_3dnowext): ret /* .size ASM_NAME(dct64_3dnowext), .-ASM_NAME(dct64_3dnowext) */ -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_mmx.S b/src/libmpg123/dct64_mmx.S index 93a7bbc0..b700732f 100644 --- a/src/libmpg123/dct64_mmx.S +++ b/src/libmpg123/dct64_mmx.S @@ -808,8 +808,4 @@ ASM_NAME(dct64_MMX): popl %ebx ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif - +NONEXEC_STACK diff --git a/src/libmpg123/dct64_sse.S b/src/libmpg123/dct64_sse.S index 0fea75ea..d9abbcdc 100644 --- a/src/libmpg123/dct64_sse.S +++ b/src/libmpg123/dct64_sse.S @@ -451,7 +451,4 @@ ASM_NAME(dct64_sse): popl %ebp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_sse_float.S b/src/libmpg123/dct64_sse_float.S index e24cf03e..40a06bff 100644 --- a/src/libmpg123/dct64_sse_float.S +++ b/src/libmpg123/dct64_sse_float.S @@ -398,7 +398,4 @@ ASM_NAME(dct64_real_sse): popl %ebp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_x86_64.S b/src/libmpg123/dct64_x86_64.S index c0e345d5..01440391 100644 --- a/src/libmpg123/dct64_x86_64.S +++ b/src/libmpg123/dct64_x86_64.S @@ -461,7 +461,4 @@ ASM_NAME(dct64_x86_64): #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/dct64_x86_64_float.S b/src/libmpg123/dct64_x86_64_float.S index d94e3d92..168a3210 100644 --- a/src/libmpg123/dct64_x86_64_float.S +++ b/src/libmpg123/dct64_x86_64_float.S @@ -423,7 +423,4 @@ ASM_NAME(dct64_real_x86_64): #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/equalizer_3dnow.S b/src/libmpg123/equalizer_3dnow.S index e4eb21be..471a0ed0 100644 --- a/src/libmpg123/equalizer_3dnow.S +++ b/src/libmpg123/equalizer_3dnow.S @@ -67,7 +67,4 @@ ASM_NAME(do_equalizer_3dnow): popl %esi ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/getcpuflags.S b/src/libmpg123/getcpuflags.S index 29ab08de..89c0f456 100644 --- a/src/libmpg123/getcpuflags.S +++ b/src/libmpg123/getcpuflags.S @@ -88,7 +88,4 @@ ASM_NAME(getcpuflags): popl %ebp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/lfs_alias.c b/src/libmpg123/lfs_alias.c index fb8902b2..1a5a1fd4 100644 --- a/src/libmpg123/lfs_alias.c +++ b/src/libmpg123/lfs_alias.c @@ -8,28 +8,58 @@ Use case: Client code on Linux/x86-64 that defines _FILE_OFFSET_BITS to 64, which is the only choice on that platform anyway. It should be no-op, but prompts the platform-agnostic header of mpg123 to define API calls with the corresponding suffix. This file provides the names for this case. It's cruft, but glibc does it, too -- so people rely on it. Oh, and it also caters for the lunatics that define _FILE_OFFSET_BITS=32 on 32 bit platforms. + + There is also the strange case that the mpg123 build itself is configured for unnecessary _FILE_OFFSET_BITS == LFS_ALIAS_BITS =^ sizeof(long). In that case, the "native" function will have the suffix and the alias shall be provided without the suffix. + + So, two basic cases: + 1. mpg123_bla_32 alias for mpg123_bla + 2. mpg123_bla alias for mpg123_bla_32 + Confusing, I know. It sucks. */ #include "config.h" +/* Hack for Solaris: Some system headers included from compat.h might force _FILE_OFFSET_BITS. Need to follow that here. */ +#include "compat.h" + #ifndef LFS_ALIAS_BITS #error "I need the count of alias bits here." #endif -/* Use the plain function names. */ +#define MACROCAT_REALLY(a, b) a ## b +#define MACROCAT(a, b) MACROCAT_REALLY(a, b) + +/* This is wicked switchery: Decide which way the aliases are facing. */ + +#if _FILE_OFFSET_BITS+0 == LFS_ALIAS_BITS + +/* The native functions are actually _with_ suffix, so let the mpg123 header use large file hackery to define the correct interfaces. */ +#include "mpg123.h" +/* Don't forget to undef the function symbols before usage... */ + +/* The native functions have suffix, the aliases not. */ +#define NATIVE_SUFFIX MACROCAT(_, _FILE_OFFSET_BITS) +#define NATIVE_NAME(func) MACROCAT(func, NATIVE_SUFFIX) +#define ALIAS_NAME(func) func + +#else + +/* Native functions are without suffix... */ #define MPG123_NO_LARGENAME #include "mpg123.h" +/* The alias functions have suffix, the native ones not. */ +#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS) +#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX) +#define NATIVE_NAME(func) func + +#endif + /* Now get the rest of the infrastructure on speed, namely attribute_align_arg, to stay safe. */ #include "mpg123lib_intern.h" -#define MACROCAT_REALLY(a, b) a ## b -#define MACROCAT(a, b) MACROCAT_REALLY(a, b) -#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS) -#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX) - /* - Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases: + Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases (inline script for nedit): perl -ne ' if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) { @@ -49,14 +79,19 @@ if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) $nargs = "Human: figure me out." if($nargs =~ /\(/); print <>>>>>> .merge-rechts.r2735 int attribute_align_arg ALIAS_NAME(mpg123_decode_frame)(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) { - return mpg123_decode_frame(mh, num, audio, bytes); + return NATIVE_NAME(mpg123_decode_frame)(mh, num, audio, bytes); } +#ifdef mpg123_framebyframe_decode +#undef mpg123_framebyframe_decode +#endif int attribute_align_arg ALIAS_NAME(mpg123_framebyframe_decode)(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) { - return mpg123_framebyframe_decode(mh, num, audio, bytes); + return NATIVE_NAME(mpg123_framebyframe_decode)(mh, num, audio, bytes); } +#ifdef mpg123_tell +#undef mpg123_tell +#endif long attribute_align_arg ALIAS_NAME(mpg123_tell)(mpg123_handle *mh) { - return mpg123_tell(mh); + return NATIVE_NAME(mpg123_tell)(mh); } +#ifdef mpg123_tellframe +#undef mpg123_tellframe +#endif long attribute_align_arg ALIAS_NAME(mpg123_tellframe)(mpg123_handle *mh) { - return mpg123_tellframe(mh); + return NATIVE_NAME(mpg123_tellframe)(mh); } +#ifdef mpg123_tell_stream +#undef mpg123_tell_stream +#endif long attribute_align_arg ALIAS_NAME(mpg123_tell_stream)(mpg123_handle *mh) { - return mpg123_tell_stream(mh); + return NATIVE_NAME(mpg123_tell_stream)(mh); } +#ifdef mpg123_seek +#undef mpg123_seek +#endif long attribute_align_arg ALIAS_NAME(mpg123_seek)(mpg123_handle *mh, long sampleoff, int whence) { - return mpg123_seek(mh, sampleoff, whence); + return NATIVE_NAME(mpg123_seek)(mh, sampleoff, whence); } +#ifdef mpg123_feedseek +#undef mpg123_feedseek +#endif long attribute_align_arg ALIAS_NAME(mpg123_feedseek)(mpg123_handle *mh, long sampleoff, int whence, long *input_offset) { - return mpg123_feedseek(mh, sampleoff, whence, input_offset); + return NATIVE_NAME(mpg123_feedseek)(mh, sampleoff, whence, input_offset); } +#ifdef mpg123_seek_frame +#undef mpg123_seek_frame +#endif long attribute_align_arg ALIAS_NAME(mpg123_seek_frame)(mpg123_handle *mh, long frameoff, int whence) { - return mpg123_seek_frame(mh, frameoff, whence); + return NATIVE_NAME(mpg123_seek_frame)(mh, frameoff, whence); } +#ifdef mpg123_timeframe +#undef mpg123_timeframe +#endif long attribute_align_arg ALIAS_NAME(mpg123_timeframe)(mpg123_handle *mh, double sec) { - return mpg123_timeframe(mh, sec); + return NATIVE_NAME(mpg123_timeframe)(mh, sec); } +#ifdef mpg123_index +#undef mpg123_index +#endif int attribute_align_arg ALIAS_NAME(mpg123_index)(mpg123_handle *mh, long **offsets, long *step, size_t *fill) { - return mpg123_index(mh, offsets, step, fill); + return NATIVE_NAME(mpg123_index)(mh, offsets, step, fill); } +#ifdef mpg123_set_index +#undef mpg123_set_index +#endif int attribute_align_arg ALIAS_NAME(mpg123_set_index)(mpg123_handle *mh, long *offsets, long step, size_t fill) { - return mpg123_set_index(mh, offsets, step, fill); + return NATIVE_NAME(mpg123_set_index)(mh, offsets, step, fill); } +#ifdef mpg123_position +#undef mpg123_position +#endif int attribute_align_arg ALIAS_NAME(mpg123_position)( mpg123_handle *mh, long frame_offset, long buffered_bytes, long *current_frame, long *frames_left, double *current_seconds, double *seconds_left) { - return mpg123_position(mh, frame_offset, buffered_bytes, current_frame, frames_left, current_seconds, seconds_left); + return NATIVE_NAME(mpg123_position)(mh, frame_offset, buffered_bytes, current_frame, frames_left, current_seconds, seconds_left); } +#ifdef mpg123_length +#undef mpg123_length +#endif long attribute_align_arg ALIAS_NAME(mpg123_length)(mpg123_handle *mh) { - return mpg123_length(mh); + return NATIVE_NAME(mpg123_length)(mh); } +#ifdef mpg123_set_filesize +#undef mpg123_set_filesize +#endif int attribute_align_arg ALIAS_NAME(mpg123_set_filesize)(mpg123_handle *mh, long size) { - return mpg123_set_filesize(mh, size); + return NATIVE_NAME(mpg123_set_filesize)(mh, size); } +#ifdef mpg123_replace_reader +#undef mpg123_replace_reader +#endif int attribute_align_arg ALIAS_NAME(mpg123_replace_reader)(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), long (*r_lseek)(int, long, int)) { - return mpg123_replace_reader(mh, r_read, r_lseek); + return NATIVE_NAME(mpg123_replace_reader)(mh, r_read, r_lseek); } +#ifdef mpg123_replace_reader_handle +#undef mpg123_replace_reader_handle +#endif int attribute_align_arg ALIAS_NAME(mpg123_replace_reader_handle)(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), long (*r_lseek)(void *, long, int), void (*cleanup)(void*)) { - return mpg123_replace_reader_handle(mh, r_read, r_lseek, cleanup); + return NATIVE_NAME(mpg123_replace_reader_handle)(mh, r_read, r_lseek, cleanup); } diff --git a/src/libmpg123/mangle.h b/src/libmpg123/mangle.h index 5bc97efc..75c0c369 100644 --- a/src/libmpg123/mangle.h +++ b/src/libmpg123/mangle.h @@ -57,5 +57,14 @@ #else #define BSS .bss #endif + +/* Mark non-executable stack. + It's mainly for GNU on Linux... who else does (not) like this? */ +#if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__) +#define NONEXEC_STACK .section .note.GNU-stack,"",%progbits +#else +#define NONEXEC_STACK +#endif + #endif /* !__MANGLE_H */ diff --git a/src/libmpg123/mpg123lib_intern.h b/src/libmpg123/mpg123lib_intern.h index e2f482cd..9e8b5756 100644 --- a/src/libmpg123/mpg123lib_intern.h +++ b/src/libmpg123/mpg123lib_intern.h @@ -25,8 +25,14 @@ # define attribute_align_arg __attribute__((force_align_arg_pointer)) /* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */ #else + # define attribute_align_arg -# define NEED_ALIGNCHECK /* Other compilers get code to catch misaligned stack. */ +/* Other compilers get code to catch misaligned stack. + Well, except Sun Studio, which accepts the aligned attribute but does not honor it. */ +#if !defined(__SUNPRO_C) +# define NEED_ALIGNCHECK +#endif + #endif #endif #else diff --git a/src/libmpg123/synth_3dnow.S b/src/libmpg123/synth_3dnow.S index 408c31b3..70324399 100644 --- a/src/libmpg123/synth_3dnow.S +++ b/src/libmpg123/synth_3dnow.S @@ -315,7 +315,4 @@ ASM_NAME(synth_1to1_3dnow_asm): addl $24,%esp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_3dnowext.S b/src/libmpg123/synth_3dnowext.S index 8c820a51..3dab8e85 100644 --- a/src/libmpg123/synth_3dnowext.S +++ b/src/libmpg123/synth_3dnowext.S @@ -3,7 +3,4 @@ #define SYNTH_NAME ASM_NAME(synth_1to1_3dnowext_asm) #include "synth_sse3d.h" -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_i586.S b/src/libmpg123/synth_i586.S index 2b9cc732..4f125f03 100644 --- a/src/libmpg123/synth_i586.S +++ b/src/libmpg123/synth_i586.S @@ -333,7 +333,4 @@ ASM_NAME(synth_1to1_i586_asm): addl $12,%esp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_i586_dither.S b/src/libmpg123/synth_i586_dither.S index 6c00cdb3..831e604e 100644 --- a/src/libmpg123/synth_i586_dither.S +++ b/src/libmpg123/synth_i586_dither.S @@ -372,7 +372,4 @@ ASM_NAME(synth_1to1_i586_asm_dither): /* The stack must be now: 0=back 4=bandptr 8=channel 12=out 16=buffs 20=bo */ ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_mmx.S b/src/libmpg123/synth_mmx.S index d8125297..fda44649 100644 --- a/src/libmpg123/synth_mmx.S +++ b/src/libmpg123/synth_mmx.S @@ -122,8 +122,4 @@ ASM_NAME(synth_1to1_MMX): popl %ebp ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif - +NONEXEC_STACK diff --git a/src/libmpg123/synth_sse.S b/src/libmpg123/synth_sse.S index c5fc10e0..a438413b 100644 --- a/src/libmpg123/synth_sse.S +++ b/src/libmpg123/synth_sse.S @@ -3,7 +3,4 @@ #define SYNTH_NAME ASM_NAME(synth_1to1_sse_asm) #include "synth_sse3d.h" -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_sse3d.h b/src/libmpg123/synth_sse3d.h index 6dd1f41b..47a1ba9c 100644 --- a/src/libmpg123/synth_sse3d.h +++ b/src/libmpg123/synth_sse3d.h @@ -41,7 +41,7 @@ null_one: .long 65535 .text - ALIGN16,,15 + ALIGN16 /* void SYNTH_NAME(real *bandPtr, int channel, short *samples, short *buffs, int *bo, float *decwins) */ .globl SYNTH_NAME SYNTH_NAME: diff --git a/src/libmpg123/synth_sse_accurate.S b/src/libmpg123/synth_sse_accurate.S index 34d76c1d..43ad9b9d 100644 --- a/src/libmpg123/synth_sse_accurate.S +++ b/src/libmpg123/synth_sse_accurate.S @@ -291,7 +291,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_sse_float.S b/src/libmpg123/synth_sse_float.S index 301fb5ba..c1068b32 100644 --- a/src/libmpg123/synth_sse_float.S +++ b/src/libmpg123/synth_sse_float.S @@ -238,7 +238,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_sse_s32.S b/src/libmpg123/synth_sse_s32.S index 87659f95..5fe3dd9f 100644 --- a/src/libmpg123/synth_sse_s32.S +++ b/src/libmpg123/synth_sse_s32.S @@ -303,7 +303,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_sse_accurate.S b/src/libmpg123/synth_stereo_sse_accurate.S index d73a2ccf..617fbe90 100644 --- a/src/libmpg123/synth_stereo_sse_accurate.S +++ b/src/libmpg123/synth_stereo_sse_accurate.S @@ -505,7 +505,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_sse_float.S b/src/libmpg123/synth_stereo_sse_float.S index c10076bc..f63aede9 100644 --- a/src/libmpg123/synth_stereo_sse_float.S +++ b/src/libmpg123/synth_stereo_sse_float.S @@ -413,7 +413,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_sse_s32.S b/src/libmpg123/synth_stereo_sse_s32.S index 25a70639..664e70a3 100644 --- a/src/libmpg123/synth_stereo_sse_s32.S +++ b/src/libmpg123/synth_stereo_sse_s32.S @@ -537,7 +537,4 @@ Loop_start_2: ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_x86_64.S b/src/libmpg123/synth_stereo_x86_64.S index 7f8f91b4..c959b02d 100644 --- a/src/libmpg123/synth_stereo_x86_64.S +++ b/src/libmpg123/synth_stereo_x86_64.S @@ -332,7 +332,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_x86_64_accurate.S b/src/libmpg123/synth_stereo_x86_64_accurate.S index c3e575ab..c55143b1 100644 --- a/src/libmpg123/synth_stereo_x86_64_accurate.S +++ b/src/libmpg123/synth_stereo_x86_64_accurate.S @@ -451,7 +451,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_x86_64_float.S b/src/libmpg123/synth_stereo_x86_64_float.S index 849ca10f..b19cccb5 100644 --- a/src/libmpg123/synth_stereo_x86_64_float.S +++ b/src/libmpg123/synth_stereo_x86_64_float.S @@ -393,7 +393,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_stereo_x86_64_s32.S b/src/libmpg123/synth_stereo_x86_64_s32.S index d2849bea..8ffcc042 100644 --- a/src/libmpg123/synth_stereo_x86_64_s32.S +++ b/src/libmpg123/synth_stereo_x86_64_s32.S @@ -470,7 +470,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_x86_64.S b/src/libmpg123/synth_x86_64.S index 29061b1e..94931dff 100644 --- a/src/libmpg123/synth_x86_64.S +++ b/src/libmpg123/synth_x86_64.S @@ -241,7 +241,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_x86_64_accurate.S b/src/libmpg123/synth_x86_64_accurate.S index 442b9290..50c5b178 100644 --- a/src/libmpg123/synth_x86_64_accurate.S +++ b/src/libmpg123/synth_x86_64_accurate.S @@ -298,7 +298,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_x86_64_float.S b/src/libmpg123/synth_x86_64_float.S index 095f4749..36f2e32c 100644 --- a/src/libmpg123/synth_x86_64_float.S +++ b/src/libmpg123/synth_x86_64_float.S @@ -256,7 +256,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/synth_x86_64_s32.S b/src/libmpg123/synth_x86_64_s32.S index 483a365f..c445c9d5 100644 --- a/src/libmpg123/synth_x86_64_s32.S +++ b/src/libmpg123/synth_x86_64_s32.S @@ -309,7 +309,4 @@ Loop_start_2: #endif ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/libmpg123/tabinit_mmx.S b/src/libmpg123/tabinit_mmx.S index 355d5d89..2e996830 100644 --- a/src/libmpg123/tabinit_mmx.S +++ b/src/libmpg123/tabinit_mmx.S @@ -207,7 +207,4 @@ ASM_NAME(make_decode_tables_mmx_asm): popl %edi ret -/* Mark non-executable stack. */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif +NONEXEC_STACK diff --git a/src/output/alsa.c b/src/output/alsa.c index d3aaac08..a18e7688 100644 --- a/src/output/alsa.c +++ b/src/output/alsa.c @@ -151,7 +151,8 @@ static int open_alsa(audio_output_t *ao) snd_pcm_t *pcm=NULL; debug1("open_alsa with %p", ao->userptr); - snd_lib_error_set_handler(AOQUIET ? error_ignorer : NULL); + if(AOQUIET) snd_lib_error_set_handler(error_ignorer); + pcm_name = ao->device ? ao->device : "default"; if (snd_pcm_open(&pcm, pcm_name, SND_PCM_STREAM_PLAYBACK, 0) < 0) { if(!AOQUIET) error1("cannot open device %s", pcm_name);