James Carlson wrote:
> stevens writes:
>> bash-3.00$ cc -D_KERNEL -m64 -c qotd_1.c
> 
> What compiler is that?  If it's gcc, then you'll need at least
> something like this to compile 64-bit kernel modules:
> 
>       -fno-builtin -fno-asm -nodefaultlibs -m64 -mtune=opteron \
>       -fno-strict-aliasing -O2 -ffreestanding -mcmodel=kernel \
>       -mno-red-zone -gdwarf-2 -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL

Why -fno-asm?  Half the point of using gcc for me is to be able to
use inline asm, rather than the bizarre .il stuff Sun's CC
forces on you.

> If it's Sun's cc, then different options apply.  Check with the manual
> for your compiler and with the Writing Device Drivers book.

For Sun's CC, there are 2 flavors of flags required:
"old": -xarch=amd64 -Di86pc -Wu,-xmodel=kernel
"new": -m64 -xarch=sse2a -Di86pc -xmodel=kernel

Where "old" means versions < 5.9

Drew
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to