Skip to content

Commit 16b38ad

Browse files
Enable -fvisibility-inlines-hidden
All inlined class member functions are then hidden by default, leading to potentially smaller binary sizes and shorter link times. Without the flag, libaudcore.so for example included a symbol for QEvent::setAccepted() from /usr/include/qt/QtCore/qcoreevent.h: $ nm -D libaudcore.so 0000000000035f50 W _ZN6QEvent11setAcceptedEb See also: https://gcc.gnu.org/wiki/Visibility
1 parent f694a92 commit 16b38ad

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if test "x$HAVE_MSWINDOWS" = "xyes" ; then
151151
EXPORT="__declspec(dllexport)"
152152
elif test "x$GCC" = "xyes" ; then
153153
CFLAGS="$CFLAGS -fvisibility=hidden"
154-
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
154+
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
155155
EXPORT="__attribute__((visibility(\"default\")))"
156156
else
157157
AC_MSG_ERROR([Unknown syntax for EXPORT keyword])

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ if cc.get_id() in ['gcc', 'clang']
7373

7474
cxx_flags = [
7575
'-Wno-non-virtual-dtor',
76-
'-Woverloaded-virtual'
76+
'-Woverloaded-virtual',
77+
'-fvisibility-inlines-hidden'
7778
]
7879

7980
check_cflags = common_flags

0 commit comments

Comments
 (0)