After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 386990 - glibmm-2.12.3 does not build on NetBSD-4.99.6/amd64
glibmm-2.12.3 does not build on NetBSD-4.99.6/amd64
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: build
2.12.x
Other NetBSD
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
: 478199 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-17 23:46 UTC by Thomas Klausner
Modified: 2007-10-25 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the compilation problem (1.04 KB, patch)
2006-12-25 16:23 UTC, Thomas Klausner
none Details | Review
2.14.0 config.log (49.87 KB, text/plain)
2007-10-19 11:48 UTC, Roy Marples
  Details

Description Thomas Klausner 2006-12-17 23:46:04 UTC
glibmm-2.12.3 does not build on NetBSD-4.99.6/amd64. It fails in compiling
date.cc:
 c++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"glibmm\" -I../../glib -I/usr/obj/devel/gli
bmm/work.x86_64/.buildlink/include/sigc++-2.0 -I/usr/obj/devel/glibmm/work.x86_6
4/.buildlink/lib/sigc++-2.0/include -I/usr/obj/devel/glibmm/work.x86_64/.buildli
nk/include/glib/glib-2.0 -I/usr/obj/devel/glibmm/work.x86_64/.buildlink/lib/glib
-2.0/include -pthread -I/usr/obj/devel/glibmm/work.x86_64/.buildlink/include -O2
 -Wall -Wno-long-long -MT date.lo -MD -MP -MF .deps/date.Tpo -c date.cc  -fPIC -
DPIC -o .libs/date.o
../../glib/glibmm/date.h:144: error: 'void Glib::Date::set_time(time_t)' cannot
be overloaded
../../glib/glibmm/date.h:132: error: with 'void Glib::Date::set_time(GTime)'
date.cc:84: error: redefinition of 'void Glib::Date::set_time(time_t)'
date.cc:76: error: 'void Glib::Date::set_time(GTime)' previously defined here
date.cc: In member function 'void Glib::Date::set_time(GTime)':
date.cc:86: error: 'timet' was not declared in this scope
Comment 1 Thomas Klausner 2006-12-17 23:58:13 UTC
See also
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=34752

Note, however, that making this conditional on _LP64 does not work for me on amd64. I'm not sure why it might work on sparc64.
Comment 2 Thomas Klausner 2006-12-25 16:23:44 UTC
Created attachment 78880 [details] [review]
Fixes the compilation problem

Please confirm that this is a correct fix.
Comment 3 Murray Cumming 2006-12-26 19:35:21 UTC
Thanks, but no, deprecation doesn't work like that - it's not a way to decide to remove another function from the API. Those ifdefs are unrelated to this problem.

The problem seems to be that GTime and time_t are considered to be identical types. If this is the case on this platform, then it can be tested for in the configure stage, and the (newer) unnecessary function can then be ifdefed out.

Comment 4 Murray Cumming 2007-01-17 19:14:13 UTC
Could you maybe create a configure test? There are already several tests, though libsigc++ might also contain more similar tests.
Comment 5 Murray Cumming 2007-02-10 14:08:37 UTC
I am confused about this, because the GTime documentation
http://developer.gnome.org/doc/API/2.0/glib/glib-Date-and-Time-Functions.html#GTime
says 
"Simply a replacement for time_t. It has been deprecated since it is not equivalent to time_t on 64-bit platforms with a 64-bit time_t.
"

Which means that GTime and time_t should NOT be equivalent on your 64-bit system, so compilation should work, but they SHOULD be equivalent on 32-bit systems, meaning that it shouldn't compile for me.

Is your glib patched to fix the GTime problem? What is the definition of GTime in your glib? In my gdate.h, it is 
"
typedef gint32  GTime;
"


A test would look a bit like this:

#include <time.h>

typedef signed int gint32;

class Test
{
  void something(gint32 val)
  {}
  
  void something(time_t val)
  {}
};

int main()
{
  Test test;
  return 0;
}


That should fail for you. It compiles for me.
Comment 6 Thomas Klausner 2007-02-20 09:40:29 UTC
As you predict, this does not compile for me:
# g++ -o test test.c
ii.c:10: error: 'void Test::something(time_t)' cannot be overloaded
ii.c:7: error: with 'void Test::something(gint32)'
#
Comment 7 Murray Cumming 2007-03-03 16:37:57 UTC
I added a configure test for this:

2007-03-03  Murray Cumming  <murrayc@murrayc.com>

        * configure.in:
        * glib/glibmmconfig.h.in:
        * glib/src/date.ccg:
        * glib/src/date.hg:
        * scripts/Makefile.am:
        * scripts/c_std.m4: Added a test for the case that time_t is equivalent to 
        guint32, as seems to be the case on NetBSD-4.99.6/amd64, so we can ifdef-out 
        the (deprecated, anyway) Glib::Date::set_time(GTime) method when necessary, because 
        GTime is also equivalent to guint32.
        Bug #386990.




So it should be fixed in the tarball that I will release soon.

Please reopen this bug if it's still a problem.
Comment 8 Roy Marples 2007-10-19 09:18:11 UTC
I can't repon this bug, but it's still an issue on Gentoo/FreeBSD on x86 platform for glibmm-2.14.0
Comment 9 Murray Cumming 2007-10-19 10:03:45 UTC
I see (somewhere, I forget where) that gentoo is patching the header file to define GLIBMM_DISABLE_DEPRECATED. That's a major mistake that changes the API for other files included after that.

Please attach your config.log here, so we can see the results of that new configure check.
Comment 10 Murray Cumming 2007-10-19 10:10:48 UTC
*** Bug 478199 has been marked as a duplicate of this bug. ***
Comment 11 Roy Marples 2007-10-19 11:48:24 UTC
Created attachment 97475 [details]
2.14.0 config.log
Comment 12 Roy Marples 2007-10-19 11:53:06 UTC
(In reply to comment #9)
> I see (somewhere, I forget where) that gentoo is patching the header file to
> define GLIBMM_DISABLE_DEPRECATED.

No, some GNOME tarballs shipped defining GTK_DISABLE_DEPRECATED (I think) which meant they broke on newer gtk versions.

Looking through the code, I can't see any test for time_t or defines that would fix the issue. As such, we physically remove the deprecated declaration and function for x86-fbsd with glibmm-2.14.0 on Gentoo right now. So far this isn't an issue for us.
Comment 13 Murray Cumming 2007-10-22 12:26:15 UTC
Sorry. The check was in 2.12.x but somehow was not in 2.14.x. I have just released 2.14.2 which should fix this. Please try it and attach the new config.log here if it doesn't work.
Comment 14 Thomas Klausner 2007-10-23 12:13:29 UTC
2.14.1 didn't compile for me, but 2.14.2 does (on NetBSD-4.99.34/amd64).
Thanks for fixing it (again)!
Comment 15 Roy Marples 2007-10-25 09:41:22 UTC
Confirmed, 2.14.2 fixes things here too.
Thanks!