kern/83445: [PATCH] ndis won't compile with kernel profiling enabled
Wojciech A. Koszek
dunstan at freebsd.czest.pl
Thu Jul 14 11:50:14 GMT 2005
>Number: 83445
>Category: kern
>Synopsis: [PATCH] ndis won't compile with kernel profiling enabled
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jul 14 11:50:12 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Wojciech A. Koszek
>Release: FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD laptop.freebsd.czest.pl 5.4-STABLE FreeBSD 5.4-STABLE #2: Tue Jul 5 22:56:49 CEST 2005 dunstan at laptop.freebsd.czest.pl:/usr/obj/usr/src/sys/LAPTOP2 i386
>Description:
With kernel profiling enabled (-p[p] in CONFIGARGS) I'm
not able to properly compile ndis(4). Build process
stops on:
(src/sys/compat/ndis/winx32_wrap.S):
[..]
ret $0xFF
[..]
After changing this instructions to their proper op-code:
.byte 0xC2
.byte 0xFF
.byte 0x00
everything seems to be just fine (ndis compiles). Since
this change needs to be made in order to satisfy compiler,
I belive it doesn't touch typical behaviour.
>How-To-Repeat:
cd /usr/src/sys/modules/ndis
env CFLAGS=-DGPROF make
[..]
anding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-p
rototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -c
/usr/src/sys/modules/ndis/../../compat/ndis/winx32_wrap.S
/usr/src/sys/modules/ndis/../../compat/ndis/winx32_wrap.S: Assembler messages:
/usr/src/sys/modules/ndis/../../compat/ndis/winx32_wrap.S:127: Error: junk at en
d of line, first unrecognized character is `$'
/usr/src/sys/modules/ndis/../../compat/ndis/winx32_wrap.S:198: Error: junk at en
d of line, first unrecognized character is `$'
*** Error code 1
[..]
>Fix:
Patch [diff.0.winx32_wrap.S] corrects this problem.
--- ndis begins here ---
Patch against FreeBSD 5.4-STABLE, kern.osreldate: 504102.
diff -upr /usr/src/sys/compat/ndis/winx32_wrap.S src/sys/compat/ndis/winx32_wrap.S
--- /usr/src/sys/compat/ndis/winx32_wrap.S Sun May 22 20:18:13 2005
+++ src/sys/compat/ndis/winx32_wrap.S Thu Jul 14 12:43:13 2005
@@ -123,8 +123,15 @@ x86_stdcall_wrap_call:
mov %esi,%eax # restore return val
pop %edi
pop %esi
+
+/*
+ * In order to compile kernel with profiling enabled,
+ * 'ret $0xFF' needs to be placed here in binary form.
+ */
x86_stdcall_wrap_arg:
- ret $0xFF
+ .byte 0xC2
+ .byte 0xFF
+ .byte 0x00
x86_stdcall_wrap_end:
@@ -194,8 +201,15 @@ x86_fastcall_wrap_call:
pop %eax # restore return val
add $12,%esp # clean the stack
+
+/*
+ * In order to compile kernel with profiling enabled,
+ * 'ret $0xFF' needs to be placed here in binary form.
+ */
x86_fastcall_wrap_arg:
- ret $0xFF
+ .byte 0xC2
+ .byte 0xFF
+ .byte 0x00
x86_fastcall_wrap_end:
/*
--- ndis ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list