Problem using gcc to compile 64 bits kernel extensions on AIX 5L

Ribeiro Gabriel gabriel@arkeia.com
Wed Sep 1 17:54:00 GMT 2004


Hello all,

I am currently working on a 64 bits kernel extension for AIX 5L.

If I use the IBM compiler (xlc) to build my driver, there is no problem.
The build commands look like:
1. cc -q64 -D_KERNEL -c mydriver.c
2. ld -o mydriver -b64 -bI:/lib/kernex.exp -lsys -lcsys -emy_entry_point 
mydriver.o

But if I try to use gcc to build mydriver.c
1. gcc -maix64 -D_KERNEL -c mydriver.c
2. ld -o mydriver -b64 -bI:/lib/kernex.exp -lsys -lcsys -emy_entry_point 
mydriver.o

then the resulting driver 'mydriver' loads without any problem into the 
kernel
but crashes on trivial operations (typically when assigning variables 
that are on the stack).

Has anybody some experience with using gcc to build kernel extensions on 
AIX ?
Is there an option to pass to gcc or ld that I have forgotten ?

Any help would be very appreciated.

Thanks,
gabriel



More information about the Gcc-help mailing list