From kde-devel Sun Aug 31 02:29:24 2003 From: James Richard Tyrer Date: Sun, 31 Aug 2003 02:29:24 +0000 To: kde-devel Subject: Re: Build issues with g++ 3.3 and Linux kernel headers X-MARC-Message: https://marc.info/?l=kde-devel&m=106229768814423 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------040408040401080805070003" This is a multi-part message in MIME format. --------------040408040401080805070003 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Petter E. Stokke wrote: > There's a problem compiling certain parts of KDE using g++ 3.3 (in my > case, 3.3.2, but reportedly it's a problem with any >= 3.3). It seems > that some Linux kernel headers won't compile with g++ -ansi -pedantic, > which is what the KDE build system uses. The problem appears in > applications which #include - at least parts of > kdemultimedia and the CD burning tools in kdeextragear-2 - although the > actual compile error is in asm/byteorder.h. The problem exists in both > 2.4 and 2.6 kernel headers. > > Can something be done about that? Possibly having a KDE_OPTIONS flag or > something similar in the build system which disables -ansi -pedantic for > a given directory? My own solution of manually removing them from the > Makefiles when I come across the problem is hardly acceptable for the > KDE 3.2 release. :) I have problem only with: "kdemultimedia". If you have the problem in other modules, do the same with them. The following kludge works for me: Make a directory: kdemultimedia/asm/ Copy to it: byteorder.h from an older Kernel. Attached. -- JRT --------------040408040401080805070003 Content-Type: text/plain; name="byteorder.h" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="byteorder.h" #ifndef _I386_BYTEORDER_H #define _I386_BYTEORDER_H #include #ifdef __GNUC__ /* For avoiding bswap on i386 */ #ifdef __KERNEL__ #include #endif static __inline__ __const__ __u32 ___arch__swab32(__u32 x) { #ifdef CONFIG_X86_BSWAP __asm__("bswap %0" : "=r" (x) : "0" (x)); #else __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ "rorl $16,%0\n\t" /* swap words */ "xchgb %b0,%h0" /* swap higher bytes */ :"=q" (x) : "0" (x)); #endif return x; } static __inline__ __const__ __u16 ___arch__swab16(__u16 x) { __asm__("xchgb %b0,%h0" /* swap bytes */ \ : "=q" (x) \ : "0" (x)); \ return x; } #define __arch__swab32(x) ___arch__swab32(x) #define __arch__swab16(x) ___arch__swab16(x) #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) # define __BYTEORDER_HAS_U64__ # define __SWAB_64_THRU_32__ #endif #endif /* __GNUC__ */ #include #endif /* _I386_BYTEORDER_H */ --------------040408040401080805070003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --------------040408040401080805070003--