<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Iyer!<br>
<br>
Replacing CC for the Linux kernel didn't worked for us.<br>
For collecting make commands we are patching kernel makefiles.<br>
For compiler command you can change file scripts/Makefile.build<br>
<br>
Somethere about line 243 you can find<br>
define rule_cc_o_c<br>
At that point you can insert a command which will do preprocessing
by gcc, and then can be passed to CIL.<br>
+ $(CC) $(c_flags) -O0 -E -o $@.i $< ; \<br>
<br>
The better way to get extracted drivers is to use LDV framework.<br>
To verify device drivers with your own static analysis tool you
need to write wrapper as described in
ldv-tools/VerifierDevelopersHowTo<br>
<br>
Best,<br>
Vadim<br>
<br>
01.07.2015 17:12, Iyer,Naveen R пишет:<br>
</div>
<blockquote
cite="mid:BLUPR08MB17130C0BC56454FFFFD94FD2B6A80@BLUPR08MB1713.namprd08.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;
color:#000000; background-color:#FFFFFF;
font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi all !</p>
<p><br>
</p>
<p>I am trying to use C Intermediate Language (CIL) to test
usbkbd.c and usbmouse.c drivers.</p>
<p>For normal .c source codes, I do the following:</p>
<p><br>
</p>
<p>From the /cil-1.7.3 location:</p>
<p>bin/cilly --dologcalls --save-temps -D HAPPY_MOOD -I
myincludes hello.c -o hello.exe</p>
<p><br>
</p>
<p>And it works.</p>
<p>However, my primary aim is to test usbkbd.c and usbmouse.c.</p>
<p>I have compiled the linux kernel and have tried to modify the
drivers by adding few comments and commenting few lines and
then "insmod"'ing them. <span style="font-size:12pt"></span></p>
<p>However, now if I want to use "cilly" to "make" these driver
files, I do the following:</p>
<p><br>
</p>
<p>From the /linux-3.13.0 location:</p>
<p>make CC=/home/naveen/cil-1.7.3/bin/cilly
SUBDIRS=drivers/hid/usbhid/ CONFIG_USB_MOUSE=m modules</p>
<p><br>
</p>
<p>And running the above command I get the following error:</p>
<p><span style="background-color:rgb(255,255,0)"><a class="moz-txt-link-abbreviated" href="mailto:root@naveen-VirtualBox:/home/naveen/linux-3.13.0#">root@naveen-VirtualBox:/home/naveen/linux-3.13.0#</a>
make CC=/home/naveen/cil-1.7.3/bin/cilly
SUBDIRS=drivers/hid/usbhid/ CONFIG_USB_MOUSE=m modules<br>
/home/naveen/linux-3.13.0/arch/x86/Makefile:98: stack
protector enabled but no compiler support<br>
/home/naveen/linux-3.13.0/arch/x86/Makefile:113:
CONFIG_X86_X32 enabled but no binutils support<br>
gcc -D_GNUCC -E -print-file-name=include<br>
CC [M] drivers/hid/usbhid/hid-core.o<br>
Warning: Unknown argument -Wframe-larger-than=1024<br>
Warning: Unknown argument -Werror=implicit-int<br>
Warning: Unknown argument -Werror=strict-prototypes<br>
gcc -D_GNUCC -E -Wp,-MD,drivers/hid/usbhid/.hid-core.o.d
-include /home/naveen/linux-3.13.0/include/linux/kconfig.h
-nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include
-I/home/naveen/linux-3.13.0/arch/x86/include
-Iarch/x86/include/generated -Iinclude
-I/home/naveen/linux-3.13.0/arch/x86/include/uapi
-Iarch/x86/include/generated/uapi
-I/home/naveen/linux-3.13.0/include/uapi
-Iinclude/generated/uapi -Iubuntu/include -D__KERNEL__
-fno-strict-aliasing -fno-common
-fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse
-mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone
-mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args
-DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1
-DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1
-DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe
-fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2
-mno-3dnow -mno-avx -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fno-var-tracking-assignments -g
-mfentry -DCC_USING_FENTRY -fno-strict-overflow
-fconserve-stack -DCC_HAVE_ASM_GOTO -I myincludes -DMODULE
-DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(hid_core)
-DKBUILD_MODNAME=KBUILD_STR(usbhid) -DCIL=1
drivers/hid/usbhid/hid-core.c -o ./hid-core.i<br>
/home/naveen/cil-1.7.3/bin/cilly.native --out
./hid-core.cil.c --warnall --envmachine --dologcalls
./hid-core.i<br>
/home/naveen/linux-3.13.0/arch/x86/include/asm/cpufeature.h[396:7-7]
: syntax error<br>
Parsing errorFatal error: exception Frontc.ParseError("Parse
error")<br>
make[1]: *** [drivers/hid/usbhid/hid-core.o] Error 2<br>
make: *** [_module_drivers/hid/usbhid] Error 2</span><br>
</p>
<p><br>
</p>
<p>Could anyone please guide me on this?</p>
<p><br>
</p>
<p>Thanks</p>
Regards
<div id="Signature">
<div name="divtagdefaultwrapper"
style="font-family:Calibri,Arial,Helvetica,sans-serif;
font-size:; margin:0">
<div name="divtagdefaultwrapper"
style="font-family:Calibri,Arial,Helvetica,sans-serif;
font-size:; margin:0">
<b><font face="Times New Roman, Times, serif">Naveen R.
Iyer</font></b></div>
<div name="divtagdefaultwrapper" style="margin:0px">
<div
style="font-family:Calibri,Arial,Helvetica,sans-serif"><font
face="Times New Roman, Times, serif">Graduate Student
(Research Division: Computer Engineering)</font></div>
<div
style="font-family:Calibri,Arial,Helvetica,sans-serif"><font
face="Times New Roman, Times, serif">Dept. of
Electrical & Computer Engineering</font></div>
<div
style="font-family:Calibri,Arial,Helvetica,sans-serif"><font
face="Times New Roman, Times, serif">University of
Florida</font></div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ldv-project mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ldv-project@linuxtesting.org">ldv-project@linuxtesting.org</a>
<a class="moz-txt-link-freetext" href="http://linuxtesting.org/cgi-bin/mailman/listinfo/ldv-project">http://linuxtesting.org/cgi-bin/mailman/listinfo/ldv-project</a>
</pre>
</blockquote>
<br>
</body>
</html>