You're on the right track. I built gtkmm with the -flto compile and link
option (and gcc 9.3.0). Then Ahmet's test case does not work.
I then removed the redefiniton of G_GNUC_CONST and wrapped the call to
Gtk::TextView::get_type() in a call to g_type_ensure() in wrap_init.cc.
The test case
I believe this is caused by https://fedoraproject.org/wiki/LTOByDefault
I built the srpm and noticed that the get_type() calls were present in
wrap_init.o but was missing from the .so
I added
%define _lto_cflags %{nil}
to the gtkmm .spec file and rebuilt--this disables LTO; the get_type() were
On Tue, Nov 17, 2020 at 6:51 AM Kjell Ahlstedt
wrote:
> wrap_init.cc contains the following lines:
> #undef G_GNUC_CONST
> #define G_GNUC_CONST /* empty */
>
Oh, right. I see this in Fedora's rpm debug source. I also see the calls to
Gtk::TextView::get_type in the debug source. However, when I
wrap_init.cc contains the following lines:
// Disable the 'const' function attribute of the get_type() functions.
// GCC would optimize them out because we don't use the return value.
#undef G_GNUC_CONST
#define G_GNUC_CONST /* empty */
This has so far made sure that the compiler does not
On Tue, Nov 17, 2020 at 12:01 AM ahmet öztürk wrote:
> Is this a Gtkmm issue then? Fedora guys also think that it is an upstream
> issue. See:https://bugzilla.redhat.com/show_bug.cgi?id=1898054
>
But why does it only occur on Fedora 33?
>
Likely its due to a new optimization in gcc 10 which few
Is this a Gtkmm issue then? Fedora guys also think that it is an upstream
issue. See:https://bugzilla.redhat.com/show_bug.cgi?id=1898054
But why does it only occur on Fedora 33?
@Andrew, I do not know how I am supposed to use
g_type_ensure(TVDerived::get_type()). I am not familiar with Gtk+ or
I think the cause is the G_GNUC_CONST annotation on TextView::get_type().
When I step through the code on Fedora 33, in Gtk::wrap_init, all the
wrap_registers happen, but the function just returns, skipping the calls to
e.g. TextView::get_type()
Ahmet can use g_type_ensure(TVDerived::get_type())
Hi Kjell,
Thank you for the response. I tried your suggestion and the outputs were
exactly as you guessed. So, this seems like a Fedora specific issue. I will
be filing a bug report there.
Kjell Ahlstedt , 15 Kas 2020 Paz, 15:19 tarihinde
şunu yazdı:
> On 2020-11-14 14:56, ahmet öztürk via
Hi all,
On Fedora 33, derived widgets does not seem to be constructed properly by
Gtk::Builder::get_widget_derived(). The reason I think so is that the
overridden methods are not called for these widgets. Apart from that
everything seems normal. No error message or anything.
I attached a sample