Miroslav Lichvar
2012-Dec-03 20:04 UTC
[flac-dev] [PATCH 1/5] Remove old GNU-stack sections from nasm files.
They are not needed since the section is defined in nasm.h. --- src/libFLAC/ia32/bitreader_asm.nasm | 4 ---- src/libFLAC/ia32/cpu_asm.nasm | 4 ---- src/libFLAC/ia32/fixed_asm.nasm | 4 ---- src/libFLAC/ia32/lpc_asm.nasm | 4 ---- src/libFLAC/ia32/stream_encoder_asm.nasm | 4 ---- 5 files changed, 20 deletions(-) diff --git a/src/libFLAC/ia32/bitreader_asm.nasm b/src/libFLAC/ia32/bitreader_asm.nasm index 4cd0ea2..b0f5ed6 100644 --- a/src/libFLAC/ia32/bitreader_asm.nasm +++ b/src/libFLAC/ia32/bitreader_asm.nasm @@ -590,7 +590,3 @@ cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap ret end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/src/libFLAC/ia32/cpu_asm.nasm b/src/libFLAC/ia32/cpu_asm.nasm index a3a3b76..05a4e6f 100644 --- a/src/libFLAC/ia32/cpu_asm.nasm +++ b/src/libFLAC/ia32/cpu_asm.nasm @@ -115,7 +115,3 @@ cident FLAC__cpu_info_extended_amd_asm_ia32 ret end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/src/libFLAC/ia32/fixed_asm.nasm b/src/libFLAC/ia32/fixed_asm.nasm index 0d4fe1a..d04e036 100644 --- a/src/libFLAC/ia32/fixed_asm.nasm +++ b/src/libFLAC/ia32/fixed_asm.nasm @@ -306,7 +306,3 @@ cident FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov ret end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/src/libFLAC/ia32/lpc_asm.nasm b/src/libFLAC/ia32/lpc_asm.nasm index fe4ae88..fadd80a 100644 --- a/src/libFLAC/ia32/lpc_asm.nasm +++ b/src/libFLAC/ia32/lpc_asm.nasm @@ -1505,7 +1505,3 @@ cident FLAC__lpc_restore_signal_asm_ia32_mmx ret end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/src/libFLAC/ia32/stream_encoder_asm.nasm b/src/libFLAC/ia32/stream_encoder_asm.nasm index fef15d8..987345b 100644 --- a/src/libFLAC/ia32/stream_encoder_asm.nasm +++ b/src/libFLAC/ia32/stream_encoder_asm.nasm @@ -153,7 +153,3 @@ cident precompute_partition_info_sums_32bit_asm_ia32_ ret end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif -- 1.7.11.7
Miroslav Lichvar
2012-Dec-03 20:04 UTC
[flac-dev] [PATCH 2/5] Don't override user-specified CFLAGS.
--- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2db9035..f4a31e4 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,8 @@ AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign -Wall tar-pax no-dist-gzip dist-xz subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +user_cflags=$CFLAGS + #Prefer whatever the current ISO standard is. AC_PROG_CC_STDC AC_USE_SYSTEM_EXTENSIONS @@ -346,7 +348,9 @@ if test "x$debug" = xtrue; then else CPPFLAGS="-DNDEBUG $CPPFLAGS" if test "x$GCC" = xyes; then - CFLAGS="-O3 -funroll-loops -Wall -W -Winline $CFLAGS" + if test "x$user_cflags" = x; then + CFLAGS="-O3 -funroll-loops -Wall -W -Winline" + fi fi fi -- 1.7.11.7
With gcc >= 4 and ELF, set default visibility to hidden and make visible
only the symbols with FLAC_API or FLACPP_API.
A convenience libFLAC-static.la is created for test_libFLAC as it
depends on the hidden symbols.
---
configure.ac | 8 +++++++-
include/FLAC++/export.h | 13 +++++++++----
include/FLAC/export.h | 13 +++++++++----
src/libFLAC/Makefile.am | 10 +++++++++-
src/test_libFLAC/Makefile.am | 2 +-
5 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index f4a31e4..3899d68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,9 +360,15 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
if test x$enable_gcc_werror = "xyes" ; then
CFLAGS="-Wall -Wextra -Werror $CFLAGS"
CXXFLAGS="-Wall -Wextra -Werror $CXXFLAGS"
- fi
fi
+ if test "$GCC_MAJOR_VERSION" -ge 4 && test
"$OBJ_FORMAT" = elf; then
+ CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ fi
+fi
+
#@@@
AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" =
"no")
diff --git a/include/FLAC++/export.h b/include/FLAC++/export.h
index e3bc51f..d3bd136 100644
--- a/include/FLAC++/export.h
+++ b/include/FLAC++/export.h
@@ -55,17 +55,22 @@
* \{
*/
-#if defined(FLAC__NO_DLL) || !defined(_MSC_VER)
+#if defined(FLAC__NO_DLL)
#define FLACPP_API
-#else
-
+#elif defined(_MSC_VER)
#ifdef FLACPP_API_EXPORTS
#define FLACPP_API _declspec(dllexport)
#else
#define FLACPP_API _declspec(dllimport)
-
#endif
+
+#elif defined(FLAC__USE_VISIBILITY_ATTR)
+#define FLACPP_API __attribute__ ((visibility ("default")))
+
+#else
+#define FLACPP_API
+
#endif
/* These #defines will mirror the libtool-based library version number, see
diff --git a/include/FLAC/export.h b/include/FLAC/export.h
index d239b9b..312746d 100644
--- a/include/FLAC/export.h
+++ b/include/FLAC/export.h
@@ -55,17 +55,22 @@
* \{
*/
-#if defined(FLAC__NO_DLL) || !defined(_MSC_VER)
+#if defined(FLAC__NO_DLL)
#define FLAC_API
-#else
-
+#elif defined(_MSC_VER)
#ifdef FLAC_API_EXPORTS
#define FLAC_API _declspec(dllexport)
#else
#define FLAC_API _declspec(dllimport)
-
#endif
+
+#elif defined(FLAC__USE_VISIBILITY_ATTR)
+#define FLAC_API __attribute__ ((visibility ("default")))
+
+#else
+#define FLAC_API
+
#endif
/** These #defines will mirror the libtool-based library version number, see
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index b20e21a..a63a3d0 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -30,6 +30,7 @@
AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
lib_LTLIBRARIES = libFLAC.la
+noinst_LTLIBRARIES = libFLAC-static.la
if DEBUG
DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT
endif
@@ -106,7 +107,8 @@ extra_ogg_sources = \
endif
# see
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning'
for numbering convention
libFLAC_la_LDFLAGS = -version-info 10:0:2 $(LOCAL_EXTRA_LDFLAGS)
@LT_NO_UNDEFINED@
-libFLAC_la_SOURCES = \
+
+libFLAC_sources = \
bitmath.c \
bitreader.c \
bitwriter.c \
@@ -125,3 +127,9 @@ libFLAC_la_SOURCES = \
stream_encoder_framing.c \
window.c \
$(extra_ogg_sources)
+
+libFLAC_la_SOURCES = $(libFLAC_sources)
+
+# needed for test_libFLAC
+libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD)
+libFLAC_static_la_SOURCES = $(libFLAC_sources)
diff --git a/src/test_libFLAC/Makefile.am b/src/test_libFLAC/Makefile.am
index 91a57fb..ed9aee8 100644
--- a/src/test_libFLAC/Makefile.am
+++ b/src/test_libFLAC/Makefile.am
@@ -27,7 +27,7 @@ test_libFLAC_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/test_libs_common/libtest_libs_common.la \
- $(top_builddir)/src/libFLAC/libFLAC.la \
+ $(top_builddir)/src/libFLAC/libFLAC-static.la \
@OGG_LIBS@ \
-lm
--
1.7.11.7
Hide all cglobal symbols with nasm >= 2. --- src/libFLAC/ia32/nasm.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libFLAC/ia32/nasm.h b/src/libFLAC/ia32/nasm.h index 8455772..e58b744 100644 --- a/src/libFLAC/ia32/nasm.h +++ b/src/libFLAC/ia32/nasm.h @@ -57,7 +57,11 @@ %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE global _%1 %else - global %1 + %if __NASM_MAJOR__ >= 2 + global %1:function hidden + %else + global %1 + %endif %endif %endmacro -- 1.7.11.7
Miroslav Lichvar
2012-Dec-03 20:04 UTC
[flac-dev] [PATCH 5/5] Update library version-info.
---
include/FLAC++/export.h | 4 ++--
include/FLAC/export.h | 4 ++--
src/libFLAC++/Makefile.am | 2 +-
src/libFLAC/Makefile.am | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/FLAC++/export.h b/include/FLAC++/export.h
index d3bd136..1cb0214 100644
--- a/include/FLAC++/export.h
+++ b/include/FLAC++/export.h
@@ -76,9 +76,9 @@
/* These #defines will mirror the libtool-based library version number, see
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
*/
-#define FLACPP_API_VERSION_CURRENT 8
+#define FLACPP_API_VERSION_CURRENT 9
#define FLACPP_API_VERSION_REVISION 0
-#define FLACPP_API_VERSION_AGE 2
+#define FLACPP_API_VERSION_AGE 3
/* \} */
diff --git a/include/FLAC/export.h b/include/FLAC/export.h
index 312746d..9af01e9 100644
--- a/include/FLAC/export.h
+++ b/include/FLAC/export.h
@@ -76,9 +76,9 @@
/** These #defines will mirror the libtool-based library version number, see
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
*/
-#define FLAC_API_VERSION_CURRENT 10
+#define FLAC_API_VERSION_CURRENT 11
#define FLAC_API_VERSION_REVISION 0 /**< see above */
-#define FLAC_API_VERSION_AGE 2 /**< see above */
+#define FLAC_API_VERSION_AGE 3 /**< see above */
#ifdef __cplusplus
extern "C" {
diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am
index 03155f6..68a5628 100644
--- a/src/libFLAC++/Makefile.am
+++ b/src/libFLAC++/Makefile.am
@@ -46,7 +46,7 @@ EXTRA_DIST = \
libFLAC++.m4
# see
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning'
for numbering convention
-libFLAC___la_LDFLAGS = -version-info 8:0:3 @LT_NO_UNDEFINED@
+libFLAC___la_LDFLAGS = -version-info 9:0:3 @LT_NO_UNDEFINED@
libFLAC___la_LIBADD = ../libFLAC/libFLAC.la
libFLAC___la_SOURCES = \
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index a63a3d0..13ab593 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -106,7 +106,7 @@ extra_ogg_sources = \
ogg_mapping.c
endif
# see
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning'
for numbering convention
-libFLAC_la_LDFLAGS = -version-info 10:0:2 $(LOCAL_EXTRA_LDFLAGS)
@LT_NO_UNDEFINED@
+libFLAC_la_LDFLAGS = -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS)
@LT_NO_UNDEFINED@
libFLAC_sources = \
bitmath.c \
--
1.7.11.7