[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] [PATCH] GCC: Stop exporting symbols which should not be expo

From: David Henningsson
Subject: [fluid-dev] [PATCH] GCC: Stop exporting symbols which should not be exported
Date: Sat, 22 Mar 2014 18:31:51 +0100

Previously, functions that were just used internally in FluidSynth
were still visible to users of the library. No application should
ever use them anyway, as they were only visible at the ABI level,
and not listed in the public API headers.

Signed-off-by: David Henningsson <address@hidden>

The big question here is whether this requires a major library bump. I've been
trying to inform myself by looking around the Internet but I haven't come to a
conclusion. E g, the libtool manual just says "interfaces" without specifying
whether they mean API or ABI.

>From a pragmatic standpoint, I'm leaning towards *not* bumping the major 
version, because doing so is a major pain for Linux distributions: they will 
to make one "libfluidsynth1" and one "libfluidsynth2" package, and in turn 
everything using that library to depend on libfluidsynth2 instead of 

Sure, there is a risk that some software out there is using one of these hidden
symbols. But I'd say that risk is quite low. And if they are, they're broken

In short, I prefer being nice to our downstreams, over being nice to terribly
broken hacky applications that probably don't even exist.

 fluidsynth/CMakeLists.txt       |    6 +++---
 fluidsynth/include/fluidsynth.h |    2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fluidsynth/CMakeLists.txt b/fluidsynth/CMakeLists.txt
index 0232e3a..0d20a3f 100644
--- a/fluidsynth/CMakeLists.txt
+++ b/fluidsynth/CMakeLists.txt
@@ -141,9 +141,9 @@ if ( CMAKE_COMPILER_IS_GNUCC )
           "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
   endif ( NOT APPLE AND NOT OS2 )
   set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast 
-Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter 
-Wdeclaration-after-statement" )
-  set ( CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -funroll-all-loops 
-finline-functions -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
-  set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fomit-frame-pointer 
-funroll-all-loops -finline-functions -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
+  set ( CMAKE_C_FLAGS_DEBUG "-g -fvisibility=hidden -DDEBUG 
+  set ( CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -funroll-all-loops 
-finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
+  set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fomit-frame-pointer 
-funroll-all-loops -finline-functions -fvisibility=hidden -DNDEBUG 
 # Windows
diff --git a/fluidsynth/include/fluidsynth.h b/fluidsynth/include/fluidsynth.h
index 36de3a3..023f052 100644
--- a/fluidsynth/include/fluidsynth.h
+++ b/fluidsynth/include/fluidsynth.h
@@ -39,6 +39,8 @@ extern "C" {
 #elif defined(MACOS9)
 #define FLUIDSYNTH_API __declspec(export)
+#elif defined(__GNUC__)
+#define FLUIDSYNTH_API __attribute__ ((visibility ("default")))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]