[gtk/gtk-3-24: 1/2] Fix the introspection build with "-Wl, --as-needed -flto -O2". Fixes #1692



commit 55e73682cc470855cc76ee15b16049cc4f1d2384
Author: Christoph Reiter <creiter src gnome org>
Date:   Mon Mar 25 09:46:06 2019 +0100

    Fix the introspection build with "-Wl,--as-needed -flto -O2". Fixes #1692
    
    The above flags in combination with "-fvisibility=hidden" break the
    g-i build because it results in the g-i generated dumper executable not
    linking against the libraries because they are detected as unused and
    thrown out.
    
    Fix by only using -fvisibility=hidden for the library and not g-i.

 gtk/Makefile.am | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 4ee001b682..e556e9d3af 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -30,7 +30,6 @@ AM_CPPFLAGS =                                         \
        -I$(top_srcdir)/gdk                             \
        $(GMODULE_CFLAGS)                               \
        $(GTK_DEBUG_FLAGS)                              \
-       $(GDK_HIDDEN_VISIBILITY_CFLAGS)                 \
        $(GTK_DEP_CFLAGS)                               \
        $(INCLUDED_IMMODULE_DEFINE)
 
@@ -1106,7 +1105,6 @@ gtk_use_quartz_private_h_sources =        \
        gtkquartz.h
 if USE_QUARTZ
 gtk_c_sources += $(gtk_use_quartz_c_sources)
-libgtk_3_la_CFLAGS = "-xobjective-c"
 gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
 endif
 
@@ -1472,10 +1470,15 @@ gtkunixprintinclude_HEADERS = $(gtk_unix_print_public_h_sources)
 
 nodist_libgtk_3_la_SOURCES = $(nodist_gtk_c_sources)
 libgtk_3_la_SOURCES = $(gtk_c_sources)
+libgtk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
 libgtk_3_la_LDFLAGS = $(libtool_opts)
 libgtk_3_la_LIBADD = $(libadd)
 libgtk_3_la_DEPENDENCIES = $(deps)
 
+if USE_QUARTZ
+libgtk_3_la_CFLAGS += "-xobjective-c"
+endif
+
 if USE_WIN32
 libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32
 libgtk_3_la_LDFLAGS += -Wl,-luuid $(gtk_win32_res_ldflag)


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