Subject: pkg/33889: devel/gtkmm fails to build on 64 bit platforms (+fix)
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <martijnb@atlas.ipv6.stack.nl>
List: pkgsrc-bugs
Date: 07/01/2006 17:50:00
>Number:         33889
>Category:       pkg
>Synopsis:       devel/gtkmm fails to build on 64 bit platforms (+fix)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 01 17:50:00 +0000 2006
>Originator:     martijnb@atlas.ipv6.stack.nl
>Release:        NetBSD 3.99.21
>Organization:
	
>Environment:
	
	
System: NetBSD atlas.ipv6.stack.nl 3.99.21 NetBSD 3.99.21 (ATLAS) #1: Tue Jun 20 08:12:03 CEST 2006 martijnb@atlas.ipv6.stack.nl:/usr/obj/sys/arch/amd64/compile/ATLAS amd64
Architecture: x86_64
Machine: amd64
>Description:
    devel/glibmm fails to build on amd64 - and probably on all other non-32
    bit platforms as well. It borks with an error:

In file included from date.cc:4:
../../glib/glibmm/date.h:142: error: `void Glib::Date::set_time(int)' and `void
Glib::Date::set_time(int)' cannot be overloaded

    The offending functions, found in date.h, are:
  
  void set_time(GTime time);

and

  void set_time(time_t timet);

GTime is a typedef'ed gint32 (/usr/pkg/include/glib2/gdate.h). The problem
lies with time_t, which is typedef'ed in /usr/include/time.h, as 

typedef  _BSD_TIME_T_    time_t;

On i386, _BSD_TIME_T_ is declared in /usr/include/i386/ansi.h as

#define _BSD_TIME_T_            long            /* time() */

Other 32-bit ports follow suit. However, on amd64 (and other 64 bit ports)
, _BSD_TIME_T is #defined as

#define _BSD_TIME_T_            int             /* time() */

causing the conflict above; while on i386 and others there would be two
different prototypes (set_time(int) and set_time(long)), they both resolve
to set_time(int) on amd64.

>How-To-Repeat:
  Try to compile devel/glibmm on a 64-bit platform.
>Fix:
  The GTime declaration is considered deprecated, judging by the source, and
the offending declaration is guarded by an #ifndef GLIBMM_DISABLE_DEPRECATED.
However, this disables more than just the offending set_time().

Both implementations do exactly the same, manually disabling the GTime-version
on 64-bit platforms, while keeping it in place for 32-bit platforms is 
probably quite harmless.

The attached patchkit (cvs seemed to ignore my --new-file, so no diff :(, 
contains patch-aa, patch-ab and a modified distfiles) does exactly this. 

Tested on both amd64 and i386.

begin 644 patchkit.tgz
M'XL(`,FTID0``^V56T_;,!2`^[K\BC,-H9:2U->DR30)6"N&!!.BO.PILF.[
MS48;U`2T,>V_S^D%M(Z;-+6[^5,5)_&)?5SG.U%Y6>434S36",((A8PUT)RZ
MQ1''RVO$.6]@Q#CF%%/$[7V,0V;;=2:UY*JLQ!2@,2V*ZK&XRT_#<IIM(J.-
MLO5>5P>#7@)J\2+L7@,.8B!VRSKVAQF@*.$TH2$()<;0_WP)6YXW>+>/H3F\
MR.5X[),`HX`%]H\,Y`UIP1O@.HRB+HX%85@88R*4(<TBJ@2)*9.2=+$2VD3>
MV4D/A^B1D3#AF<),2R$4CBA5*I9:A[&FF!D1=R.:&6F0\@;YC7YD'$(Y0C$!
M^:72Y2+]2U%E(U^(NC_$AK*NH':1*F,Q1UW)"9$V?Q,*3C(5$D1)*'Y\5,Y2
M9(9E&C/)#8TRS%4H%:=='F<QBJ511#`9D9AXOWNS[V&V#EVN=0Z$&(HX?]#_
M^M[2?Q+._6<\;/"U9K7@/_=_L?^=I0KKF./)^D_XZO[;#X&K_YM@4?]M1?=]
M'^KJV9F7T(X2E0ZR+"BF^?!%_3GP$?<Q!APG)$X8"V[EA3:R_5Z[W;YO`&]O
M#_P([T;0GAWMY761*^C9[B0I=95>BFFIFUDQ*2LXM,\FB=V4:3X9>@`P3.MQ
MTKNX[6$A/^JL2G?!1@59:H_-5NNU!]\\\/Q7N9DH;>#P^.C@Y"3M'0WV#X[[
M::]_>M9_NW_>[WEM&P(O;4P^T:KY8%P+MK?OPM+CTY"U[`2KR5?Y6#</S^T1
MZE,;\O5/K/,/L>*_7,<<3_I/PY_]9\CYOP&>\'^THC\"C!*$$X*?I_]H9C_&
M<:W_O+$W].1J#+V3#[7?L-.IFYE5MY+#?=5@N_:]]MSS`9ZA^2SH%T0'Z.SL
MP$!7)50C#=?BXDI#84!`O30PTV)LS^?J-VOWTZHUCPI@OK*_J1`X'`Z'P^%P
;.!P.A\/A<#@<#H?#X7`X_@F^`_R13!``*```
`
end

>Unformatted: