Greeting,

using Sun cc (cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12), I 
compile my kernel module with -fast. This results in memset(9F) calls 
appearing as _memset calls in the object file, which can not be resolved 
on a SXCE 106 kernel.

Is this a problem with my include files and defines, the compiler 
version, usage of -fast for kernel code?

The exact call is

cc -fast -xmodel=kernel -m64 -D_KERNEL -c foo.c -o foo.o

Omitting -fast puts memset in the object code. But I'd really like to 
optimize somewhat.

A testcase is inlined below (memset.c). Compiling this like

$ cc -fast -xmodel=kernel -m64 -D_KERNEL -c memset.c -o memset.o

results in memset being inlined(?), as nm indicates:

$ nm memset.o | grep memset
memset.o:
[1]     |                   0|                   0|FILE |LOCL |0    |ABS 
    |memset.c

  Joachim

----- memset.c -----

#include <sys/ddi.h>
#include <sys/sunddi.h>

extern void *ptr;

void *foo(void)
{
         return memset(ptr, 128, 128);
}

--------------------
-- 
Joachim Worringen, Software Architect, Dolphin Interconnect Solutions
phone ++49/(0)228/324 08 17 - http://www.dolphinics.com
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to