Bug 64832 - kopete fails to build on several archs
Summary: kopete fails to build on several archs
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Auto-Away Plugin (show other bugs)
Version: 0.7.2
Platform: Debian testing Linux
: LO normal
Target Milestone: ---
Assignee: Duncan Mac-Vicar Prett
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-23 21:36 UTC by Matias Fernandez
Modified: 2003-11-09 16:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matias Fernandez 2003-09-23 21:36:28 UTC
Version:           0.7.2 (using KDE KDE 3.1.3)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 3.3 
OS:          Linux

Kopete fails to build on some architectures, please see http://buildd.debian.org/build.php?&pkg=kopete for the build logs.
Comment 1 Andy Goossens 2003-09-23 22:33:48 UTC
Compile error: (I took the alpha build) 
 
/bin/sh ../../../libtool --silent --mode=compile --tag=CXX g++ 
-DHAVE_CONFIG_H -I. -I. -I../../..  -I../../../kopete/libkopete 
-I../../../kopete/libkopete/ui -I../../../kopete/libkopete/ui -I/usr/include/kde 
-I/usr/include/qt3/ -I.  -DQT_THREAD_SUPPORT  -D_REENTRANT  
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -mieee -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  
-I/usr/lib/perl/5.8.0/CORE   -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall 
-pedantic -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 
-D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions 
-fno-check-new  -c -o motionawayplugin.lo `test -f 'motionawayplugin.cpp' || 
echo './'`motionawayplugin.cpp 
In file included from /usr/include/linux/types.h:16, 
                 from /usr/include/linux/videodev.h:4, 
                 from motionawayplugin.cpp:63: 
/usr/include/asm/types.h:28: error: conflicting types for `typedef long int  
   __s64' 
motionawayplugin.cpp:56: error: previous declaration as `typedef long long int  
   __s64' 
/usr/include/asm/types.h:29: error: conflicting types for `typedef long  
   unsigned int __u64' 
motionawayplugin.cpp:52: error: previous declaration as `typedef long long  
   unsigned int __u64' 
 
 
 
Code: (written and tested by Zack Rusin on my machine, almost a year ago) 
 
/* The following is a mandrake 9 hack. Mandrake 9 
 * doesn't define this 64 bit types (we need GNU C lib 
 * because we use long long and warning - gcc extensions. 
 */ 
#if !defined(__u64) && defined(__GNUC__) 
//#warning "defining __u64" 
typedef unsigned long long __u64; 
#endif 
#if !defined(__s64) && defined(__GNUC__) 
//#warning "defining __s64" 
typedef __signed__ long long __s64; 
#endif 
 
 
 
/usr/include/asm/types.h file: 
 
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 
typedef __signed__ long long __s64; 
typedef unsigned long long __u64; 
#endif 
 
 
My guess: 
 
Mandrake defined __STRICT_ANSI__ and this caused trouble with V4L's files 
which need __s64 and __u64. IIRC Mandrake patched their kernel since 
Mandrake 9.0 with V4L2. Linux kernel 2.6 will include V4L2 by default. So I 
guess more distros might get this problem too in the near future when they 
define __STRICT_ANSI__ too. 
 
For some reason this __STRICT_ANSI__ hack works fine for e.g. s390, arm, 
powerpc, m68k and sparc, but failed for e.g. hppa, ia64, mipsel, alpha and 
mips. (64 bits machines?) 
Comment 2 Thiago Macieira 2003-09-24 01:05:50 UTC
Reassigning since it's the only truly failed compilation. The other two "maybe-failed" errors were due to 
Qt packages being messed up somehow. 
 
Anyways, your guess seems right. In 64-bit platforms, long is already 64-bit, so that's how __s64 gets 
defined. And gcc complains that long and long long aren't the same. 
Comment 3 Andy Goossens 2003-10-02 14:37:13 UTC
Subject: kopete_0_7_branch: kdenonbeta/kopete/plugins/motionautoaway

CVS commit by goossens: 

fix compile for few people (with 64bits archs)
and meanwhile break compile for some:
patched 2.4 kernels (e.g. Mandrake), 2.5/2.6(?), where __STRICT_ANSI__ is
defined

* this makes at least the Debian's and SuSE's build systems for 64bits happy
* stops some developers complaining about broken distros (guess who? :-))
* without a doubt, new bugreports will come in from people with "broken distros"

CCMAIL: 64832@bugs.kde.org
CCMAIL: kopete-devel@kde.org

Yeah, this isn't a good fix. I'll be happy when someone steps forward with a
patch that works in all cases. I'm even thinking about disabling motionaway
from compilation right now until a good patch is made. Oh, and we could use
skilled testers who run Linux 2.5/2.6 and/or 64bits archs...

For more info, see http://bugs.kde.org/show_bug.cgi?id=64832


Zack: Does the code look familiar? :-)


  M +15 -3     motionawayplugin.cpp   1.19.2.2


--- kdenonbeta/kopete/plugins/motionautoaway/motionawayplugin.cpp  #1.19.2.1:1.19.2.2
@@ -44,7 +44,15 @@
 #include <sys/poll.h>
 
-/* The following is a mandrake 9 hack. Mandrake 9
- * doesn't define this 64 bit types (we need GNU C lib
- * because we use long long and warning - gcc extensions.
+#if 0
+/* The following is a hack:
+ * e.g. Mandrake 9.x ships with a patched
+ * kernel which doesn't define this 64 bit types (we need GNU C lib
+ * because we use long long and warning - gcc extensions.)
+ *
+ * This is caused by the !defined(__STRICT_ANSI__) check in
+ * /usr/include/asm/types.h
+ *
+ * Warning: enabling this code breaks 64bits archs!
+ * If compilation fails for you, change the "#if 0" above to "#if 1"
  */
 #if !defined(__u64) && defined(__GNUC__)
@@ -55,4 +63,8 @@ typedef unsigned long long __u64;
 //#warning "defining __s64"
 typedef __signed__ long long __s64;
+#endif
+/*
+ * End hack
+ */
 #endif
 


Comment 4 Matias Fernandez 2003-10-22 23:25:11 UTC
Kopete 0.7.3 fails to build on hppa
more information can be found on
http://buildd.debian.org/fetch.php?&pkg=kopete&ver=0.7.3-1&arch=hppa&stamp=1066253814&file=log&as=raw
Comment 5 Matt Rogers 2003-10-24 22:19:04 UTC
the error from comment 4 obviously stems from a bad installation of some sort since it can't read the symbols from libxss.a. 

I'd like opinions from everybody on whether or not to disable the motion auto-away plugin for 0.8. I don't think it's been touched for quite sometime (minus the commit referenced in this plugin)
Comment 6 Martijn Klingens 2003-11-09 16:23:37 UTC
Subject: kdenetwork/kopete/plugins/motionautoaway

CVS commit by mklingens: 

Detect 64bit architectures and adjust the typedef accordingly.

CCMAIL: 64832-done@bugs.kde.org


  M +23 -20    motionawayplugin.cpp   1.27


--- kdenetwork/kopete/plugins/motionautoaway/motionawayplugin.cpp  #1.26:1.27
@@ -23,26 +23,26 @@
 */
 
-#include <kdebug.h>
-#include <kgenericfactory.h>
-
-#include <qtimer.h>
+#include "config.h"
 
 #include "motionawayplugin.h"
-#include "kopeteaway.h"
-#include "kopeteaccountmanager.h"
-#include <kconfig.h>
 
-// motion.c includes
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <fcntl.h>
-#include <time.h>
 #include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <sys/ioctl.h>
-#include <sys/types.h>
 #include <sys/poll.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
 
-#if 0
+#include <qtimer.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kgenericfactory.h>
+
+#include "kopeteaccountmanager.h"
+#include "kopeteaway.h"
 /* The following is a hack:
  * e.g. Mandrake 9.x ships with a patched
@@ -52,20 +52,23 @@
  * This is caused by the !defined(__STRICT_ANSI__) check in
  * /usr/include/asm/types.h
- *
- * Warning: enabling this code breaks 64bits archs!
- * If compilation fails for you, change the "#if 0" above to "#if 1"
  */
 #if !defined(__u64) && defined(__GNUC__)
-//#warning "defining __u64"
+#if SIZEOF_UNSIGNED_LONG >= 8
+typedef unsigned long __u64;
+#else
 typedef unsigned long long __u64;
 #endif
+#endif
+
 #if !defined(__s64) && defined(__GNUC__)
-//#warning "defining __s64"
+#if SIZEOF_LONG >= 8
+typedef signed long __s64;
+#else
 typedef __signed__ long long __s64;
 #endif
+#endif
 /*
  * End hack
  */
-#endif
 
 #include <linux/version.h>