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)
And why do you think this is an error of kaudiocreator? You could at least post the error.
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'
Just to let you know, I also have an XFS patched kernel and I exactly the same error.
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.
Userland code should never include kernel headers. This is a KDE bug.
*** Bug 57166 has been marked as a duplicate of this bug. ***
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?
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.
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.
Note that cvs no longer even has the class that this broke on.
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
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 .
*** Bug 60315 has been marked as a duplicate of this bug. ***
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
Created attachment 1978 [details] Patch for Kernel 2.4.21 This works for me. YMMV. -- JRT
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> /*******************************************************