Bug 52669

Summary: kaudiocreator fails building if kernel contains xfs patch
Product: [Applications] kaudiocreator Reporter: Wolfgang Scheicher <worf>
Component: generalAssignee: Gerd Fleischer <gerdfleischer>
Status: CLOSED NOT A BUG    
Severity: normal CC: aliakc, braescu_f, kdebugs, tyrerj
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch for Kernel 2.4.21

Description Wolfgang Scheicher 2003-01-06 16:38:19 UTC
Version:            (using KDE KDE 3.0.99)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.1 
OS:          Linux

kdemultimedia 3.1rc6 fails building in kaudiocreator if i use kernel 2.4.20 with xfs patch. as soon as i use 2.4.20 vanilla it works. (it's the kernel headers that matter)
Comment 1 Stephan Binner 2003-01-06 23:56:17 UTC
And why do you think this is an error of kaudiocreator? You could at least post 
the error. 
Comment 2 Wolfgang Scheicher 2003-01-07 14:34:15 UTC
sorry - here the part with the errors. 
 
I'm not sure if it's a bug in kernel or in kaudiocreator - i just think since it's only a frontend 
to things like cdparanoja, etc... and everything else builds fine (yeah, really everything 
else, i use a source based distribution) it could eventually be kaudiocreator. 
 
 
g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/include/qt -I/usr/X11R6/include  -static -Wall 
-DDATADIR=\"/usr/share/apps/kaudiocreator\" -DQT_THREAD_SUPPORT  
-D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W 
-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 
-D_BSD_SOURCE -Wcast-align -Wconversion -DNDEBUG -DNO_DEBUG -O2 
-march=i686 -O3 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE 
-DQT_NO_ASCII_CAST  -c -o kaudiocreator.all_cpp.o `test -f 'kaudiocreator.all_cpp.cpp' 
|| echo './'`kaudiocreator.all_cpp.cpp 
In file included from kaudiocreator.all_cpp.cpp:5: 
cdconfigimp.cpp:25:1: warning: "HAVE_LAME" redefined 
In file included from cddb.cpp:19, 
                 from kaudiocreator.all_cpp.cpp:2: 
../config.h:78:1: warning: this is the location of the previous definition 
In file included from cdconfigimp.cpp:27, 
                 from kaudiocreator.all_cpp.cpp:5: 
../config.h:78:1: warning: "HAVE_LAME" redefined 
In file included from kaudiocreator.all_cpp.cpp:5: 
cdconfigimp.cpp:25:1: warning: this is the location of the previous definition 
In file included from /usr/include/linux/cdrom.h:14, 
                 from cdconfigimp.cpp:62, 
                 from kaudiocreator.all_cpp.cpp:5: 
/usr/include/asm/byteorder.h:38: syntax error before `(' token 
/usr/include/asm/byteorder.h:42: '__u64' is used as a type, but is not defined 
   as a type. 
/usr/include/asm/byteorder.h:43: parse error before `}' token 
/usr/include/asm/byteorder.h:44: syntax error before `.' token 
/usr/include/asm/byteorder.h:50: syntax error before `.' token 
/usr/include/asm/byteorder.h:51: syntax error before `.' token 
/usr/include/asm/byteorder.h:52: parse error before `:' token 
In file included from /usr/include/linux/byteorder/little_endian.h:11, 
                 from /usr/include/asm/byteorder.h:65, 
                 from /usr/include/linux/cdrom.h:14, 
                 from cdconfigimp.cpp:62, 
                 from kaudiocreator.all_cpp.cpp:5: 
/usr/include/linux/byteorder/swab.h:199: syntax error before `(' token 
/usr/include/linux/byteorder/swab.h:209: syntax error before `(' token 
/usr/include/linux/byteorder/swab.h:213: `__u64' was not declared in this scope 
/usr/include/linux/byteorder/swab.h:213: `addr' was not declared in this scope 
/usr/include/linux/byteorder/swab.h:214: variable or field `__swab64s' declared 
   void 
/usr/include/linux/byteorder/swab.h:214: `__swab64s' declared as an `inline' 
   variable 
/usr/include/linux/byteorder/swab.h:214: syntax error before `{' token 
In file included from kaudiocreator.all_cpp.cpp:5: 
cdconfigimp.cpp:69: parse error before `}' token 
In file included from kaudiocreator.all_cpp.cpp:7: 
queconfigimp.cpp: In member function `void QueConfigImp::addJob(Job*, 
   QString)': 
queconfigimp.cpp:59: warning: unused variable `QueListViewItem*newItem' 
In file included from kaudiocreator.all_cpp.cpp:9: 
tracksconfigimp.cpp: In member function `void TracksConfigImp::newSong(int, 
   QString, int)': 
tracksconfigimp.cpp:241: warning: unused variable `QListViewItem*newItem' 
make[3]: *** [kaudiocreator.all_cpp.o] Fehler 1 
make[3]: Leaving directory `/usr/src/kdemultimedia-3.1rc6/kaudiocreator' 
 
Comment 3 Gareth Clay 2003-01-29 23:40:41 UTC
Just to let you know, I also have an XFS patched kernel and I exactly the same error. 
Comment 4 Thiago Macieira 2003-01-30 14:08:31 UTC
This is a bug in the XFS patch, not in KDE. 
 
My vanilla asm/byteorder.h has no reference to __u64, but it does include 
asm/types.h. And that file very clearly defines __u64 if you're using GNU C and not 
in strict ANSI mode. 
 
The XFS patch must be using an unguarded __u64. That is, one that is not 
protected by the same #ifdefs: GNU C and not in strict ANSI mode. If you will look at 
the compile line that was posted, you'll see that -ansi is there. 
 
Comment 5 Christoph Hellwig 2003-02-03 21:40:34 UTC
Userland code should never include kernel headers.  This is a KDE bug.
Comment 6 Stephan Binner 2003-04-14 23:17:39 UTC
*** Bug 57166 has been marked as a duplicate of this bug. ***
Comment 7 Chris Brien 2003-05-24 07:52:39 UTC
It also fails with 2.4.20-ck6. 
Why is the compile using -ansi? 
And why is C(++) so retarded that you must #ifdef on compile flags to 
include variable declarations? 
Comment 8 Thiago Macieira 2003-05-24 15:23:31 UTC
Your rant is pointless. You cannot use something that the compiler doesn't know 
about. 
 
I repeat what I said before: the error is in the XFS patch, which uses a type for 
which it did not guard against. The kernel only defines __u64 under certain 
conditions and, therefore, __u64 should only be used under those conditions. 
 
At the same time, I agree that userland should not include kernel headers. But 
sometimes it is necessary in cases such as this (linux/cdrom.h).  
 
You should use a set of kernel headers built alongside your glibc, not the latest 
kernel you compiled. Those are guaranteed to work. 
Comment 9 Chris Brien 2003-06-15 17:38:01 UTC
My glibc was built against linux-2.4.20-ck6. What's your point? 
 
Now that 2.4.21 has been released which doesn't include XFS, and yet still 
causes the error here, it is not possible to build kdemultimedia using vanilla 
kernel headers. And it's not due to XFS, so you can't continue to blame SGI. 
Comment 10 icefox 2003-06-17 22:01:28 UTC
Note that cvs no longer even has the class that this broke on. 
Comment 11 Wolfgang Scheicher 2003-06-17 22:55:49 UTC
Subject: Re:  kaudiocreator fails building if kernel contains xfs patch

On Tuesday 17 June 2003 22:01, you wrote:
> Note that cvs no longer even has the class that this broke on.

good to know. (i assume you mean cvs head)
But i fear i have bad news for you again:

i just tested kernel 2.4.21, and then built some kde stuff - and guess what...
tough i used vanilla kernel, kdemultimedia from KDE_3_1_BRANCH did fail

Worf

Comment 12 Ismail Donmez 2003-06-17 23:10:38 UTC
Yes someone ( some bas*** ) added __u64 in asm/types.h I guess after 2.4.20. It was in 2.5.x 
kernel tree for long because 2.5.x kernel uses it intensively. Now I do not know why 2.4.21 kernel 
uses it but KDE will need to work around this because kernel guys are very strict as you can see 
in http://bugs.kde.org/show_bug.cgi?id=52669#c5 .  
Comment 13 icefox 2003-06-24 23:43:47 UTC
*** Bug 60315 has been marked as a duplicate of this bug. ***
Comment 14 James Richard Tyrer 2003-07-10 00:20:45 UTC
1.  This can be fixed by patching the Kernel header: "cdrom.h".  Add:

typedef unsigned long long __u64;

before:

#include <asm/byteorder.h>

Thanks to: Thiago Macieira

2.  This has been fixed in HEAD

Thanks to: Benjamin Meyer

3.  This is not a KDE bug.

Therefore, I am closing it.

--
JRT
Comment 15 James Richard Tyrer 2003-07-10 01:01:18 UTC
Created attachment 1978 [details]
Patch for Kernel 2.4.21

This works for me.  YMMV.

--
JRT
Comment 16 icefox 2003-07-10 01:47:39 UTC
Just for others who run across this bug.  In diff format: 
 
diff -Naur linux-2.4.21-old/include/linux/cdrom.h linux-2.4.21/include/linux/cdrom.h 
--- linux-2.4.21-old/include/linux/cdrom.h      2001-11-22 19:47:04.000000000 +0000 
+++ linux-2.4.21/include/linux/cdrom.h  2003-07-09 10:19:14.000000000 +0000 
@@ -11,6 +11,8 @@ 
 #ifndef        _LINUX_CDROM_H 
 #define        _LINUX_CDROM_H 
  
+typedef unsigned long long __u64; 
+ 
 #include <asm/byteorder.h> 
  
 /*******************************************************