Re: incompatible unaligned.h between x86 and ppc - kernel-hackersverify please
Benjamin Herrenschmidt wrote:
> On Wed, 2004-11-03 at 09:56 +0100, Christoph Ewering wrote:
> > Hello List, hello Klaus, hello Benjamin!
> > At the moment I am fighting with an error on ppc when I want to compile
> > the new vdr-1.3.14 from Klaus Schmidinger.
> > vdr uses unaligned.h and it stops compiling with an error about
> > "get_unaligned not declared" on ppc. I tracked this down with the help
> > of Klaus to a different header-file asm/unaligned.h between x86 and
> > ppc. The asm-ppc/unaligned.h has two lines more - at the begining of
> > unaligned.h "#ifdef __KERNEL__" and at the end "#endif /* KERNEL */".
> > So I "greped" around in /usr/src/linux/include/asm-* and found that ppc
> > uses this construct, only!
> > If I remove the #ifdef-#endif-lines I get no "not declared" error any
> > more.
> > I am not a kernel-hacker (I am not a programmer at all) so I can only
> > guess that this is an obsolete declaration that could be removed. I am
> > using the kernel-source 22.214.171.124 from kernel.org.
> > So could the kernel-hackers verify this and correct me or
> > asm-ppc/unaligned.h, please. ;-)
> Functions in kernel headers shouldn't be used by userland programs. If
> glibc doesn't provide an equivalent of get_unaligned(), then it's up to
> the program to make up it's own. You can't rely on the kernel version to
> be inline, or not rely on some kernel CONFIG options etc...
> So this is definitely a bug in vdr
It's a bug in VDR to use a platform independent way of accessing unaligned
data? I don't think so...