From 55e73682cc470855cc76ee15b16049cc4f1d2384 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 25 Mar 2019 09:46:06 +0100 Subject: [PATCH] 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)