[Asterisk-bsd] OSLEC on FreeBSD - floating point in kernel (part 2)

Ian FREISLICH ianf at clue.co.za
Tue Sep 22 04:40:20 CDT 2009


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. "



More information about the Asterisk-BSD mailing list