Re: Compiling a 2.4 driver under 2.6

From: Arjan van de Ven
Date: Thu Sep 30 2004 - 16:05:59 EST


On Thu, 2004-09-30 at 22:31, Brian McGrew wrote:

> ===[ Begin Error Output ]===
>
> 119_ mk
> /usr/bin/gcc -D__SMP__

oh boy; __SMP__ doesn't exist for 2.4 let alone 2.6



> -DMODVERSIONS -DEXPORT_SYMTAB

this is very broken for 2.6


> -O1

any reason you're not using -O2

> -DCONFIG_MODVERSIONS

WTF???

> /usr/include/linux/config.h:5:2: #error Incorrectly using glibc headers for a kernel module

you are using glibc headers for kernel modules. don't do this.


This makefile is quite broken; it needs converting to kbuild

> #ifndef __KERNEL__
> #define __KERNEL__
> #endif

this shouldn't be in modules

>
> #ifndef MODULE
> #define MODULE
> #endif

this shouldn't be there either

> #if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
> # define MODVERSIONS /* force it on */
> #endif

this is broken

>
> #if defined(MODVERSIONS) && !defined(__GENKSYMS__)
> #include <linux/modversions.h>
> #include "ibb.ver"
> #endif

never include modversions.h directly
never ever include a .ver directly

>
> #ifndef EXPORT_SYMTAB
> # define EXPORT_SYMTAB /* need this one cause we export ibb_rtc_wakeup */
> #endif

dont do this

> */
> #define TYPE(dev) (MINOR(dev) >> 4) /* high nibble */
> #define NUM(dev) (MINOR(dev) & 0xf) /* low nibble */

this doesn't work with 2.7

>
> static void ibb_intr(int irq, void *dev_id, struct pt_regs *regs);

this is wrong for 2.6

I stop here because I don't want to get IP contaminated and I just had
something to eat that I don't want to see again ;)
but it's not looking good.


given that this is (really bad) proprietary code, I think you want to
contact the vendor of this code and get him to fix it up.

Attachment: signature.asc
Description: This is a digitally signed message part