Mageia Bugzilla – Attachment 5350 Details for
Bug 13841
sdcc new security issue CVE-2012-3509
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
testing procedure
sdcc-test-procedure.txt (text/plain), 2.12 KB, created by
James Kerr
on 2014-08-19 20:01:27 CEST
(
hide
)
Description:
testing procedure
Filename:
MIME Type:
Creator:
James Kerr
Created:
2014-08-19 20:01:27 CEST
Size:
2.12 KB
patch
obsolete
> >Testing the SDCC Compiler > >The first thing you should do after installing your SDCC compiler is to see if >it runs. Type "sdcc --version" at the prompt, and the program should run and >output its version like: >SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006) >(UNIX) > >If it doesn't run, or gives a message about not finding sdcc program, then you >need to check over your installation. Make sure that the sdcc bin directory is >in your executable search path defined by the PATH environment setting (see >section 2.8 Install trouble-shooting for suggestions). Make sure that the sdcc >program is in the bin folder, if not perhaps something did not install >correctly. > >Make sure the compiler works on a very simple example. Type in the following >test.c program using your favorite ASCII editor: > > char test; > > void main(void) { > test=0; > } > >Compile this using the following command: "sdcc -c test.c". If all goes well, >the compiler will generate a test.asm and test.rel file. Congratulations, you've >just compiled your first program with SDCC. We used the -c option to tell SDCC >not to link the generated code, just to keep things simple for this step. > >The next step is to try it with the linker. Type in "sdcc test.c". If all goes >well the compiler will link with the libraries and produce a test.ihx output >file. If this step fails (no test.ihx, and the linker generates warnings), then >the problem is most likely that SDCC cannot find the /usr/local/share/sdcc/lib >directory > >The final test is to ensure SDCC can use the standard header files and >libraries. Edit test.c and change it to the following: > > #include <string.h> > > char str1[10]; > > void main(void) { > strcpy(str1, "testing"); > } > >Compile this by typing "sdcc test.c". This should generate a test.ihx output >file, and it should give no warnings such as not finding the string.h file. If >it cannot find the string.h file, then the problem is that SDCC cannot find the >/usr/local/share/sdcc/include directory. Use option --print-search-dirs to >find exactly where SDCC is looking for the include and lib files.
Testing the SDCC Compiler The first thing you should do after installing your SDCC compiler is to see if it runs. Type "sdcc --version" at the prompt, and the program should run and output its version like: SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006) (UNIX) If it doesn't run, or gives a message about not finding sdcc program, then you need to check over your installation. Make sure that the sdcc bin directory is in your executable search path defined by the PATH environment setting (see section 2.8 Install trouble-shooting for suggestions). Make sure that the sdcc program is in the bin folder, if not perhaps something did not install correctly. Make sure the compiler works on a very simple example. Type in the following test.c program using your favorite ASCII editor: char test; void main(void) { test=0; } Compile this using the following command: "sdcc -c test.c". If all goes well, the compiler will generate a test.asm and test.rel file. Congratulations, you've just compiled your first program with SDCC. We used the -c option to tell SDCC not to link the generated code, just to keep things simple for this step. The next step is to try it with the linker. Type in "sdcc test.c". If all goes well the compiler will link with the libraries and produce a test.ihx output file. If this step fails (no test.ihx, and the linker generates warnings), then the problem is most likely that SDCC cannot find the /usr/local/share/sdcc/lib directory The final test is to ensure SDCC can use the standard header files and libraries. Edit test.c and change it to the following: #include <string.h> char str1[10]; void main(void) { strcpy(str1, "testing"); } Compile this by typing "sdcc test.c". This should generate a test.ihx output file, and it should give no warnings such as not finding the string.h file. If it cannot find the string.h file, then the problem is that SDCC cannot find the /usr/local/share/sdcc/include directory. Use option --print-search-dirs to find exactly where SDCC is looking for the include and lib files.
View Attachment As Raw
Actions:
View
Attachments on
bug 13841
: 5350