Hi

I was wondering if anyone has actually managed to get this working.
I'm using amd64 and when I select the ECHO_CAN_OSLEC, the compile
fails with the following error:

Warning: Object directory not changed from original 
/usr/ports/misc/zaptel/work/zaptel-bsd-1.4.11.2/zaptel
cc -O2 -pipe -march=athlon64 -fno-strict-aliasing -Wall -D_KERNEL -DKLD_MODULE 
-nostdinc  -I/usr/ports/misc/zaptel/work/zaptel-bsd-1.4.11.2/zaptel/../zaptel 
-I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 
--param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer 
-mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 
-mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables 
-ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall 
-Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes 
-Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign 
-fformat-extensions -c oslec_echo.c
oslec_echo.c: In function 'echo_can_update':
oslec_echo.c:164: error: SSE register return with SSE disabled

Now, SSE is disabled for kernel use because floating point/SSE/MMX
state is not saved on kernel entry, so it will corrupt user process
floating point.

According to Peter Wemm:
        "The error suggests you've got a function returning a double
        or a float or an SSE data type.  You cannot do that, either
        in the kernel or in a module.  You will cause corruption
        to user processes.

        We compile with -mno-sse etc for a reason on amd64 kernels.
        It isn't allowed on i386 either, but I don't think we have
        explicit safeguards there. "

>From Peter's statement, it appears that floating point may compile
(and it does on my i386 laptop) into i386 kernels and just silently
perpetrate corruption on userland.

This routine is the only point that floating point math or types
is used.  I haven't yet managed to figure out if it's really needed
or if the same can be done with integer arithmetic.  From a cursory
glance, it doesn't look like floating point is really needed.

Ian

--
Ian Freislich

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

Asterisk-BSD mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-bsd

Reply via email to