[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Build issues with g++ 3.3 and Linux kernel headers
From:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2003-08-31 2:29:24
[Download RAW message or body]

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 <linux/cdrom.h> - 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

["byteorder.h" (text/plain)]

#ifndef _I386_BYTEORDER_H
#define _I386_BYTEORDER_H

#include <asm/types.h>

#ifdef __GNUC__

/* For avoiding bswap on i386 */
#ifdef __KERNEL__
#include <linux/config.h>
#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 <linux/byteorder/little_endian.h>

#endif /* _I386_BYTEORDER_H */


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic