GNU Tools for KungFu32 Embedded Processors
Version: gcc4.7 + binutils2.24 + gdb7.8

Table of Contents
* Installing executables on Linux
* Installing executables on Windows 
* Invoking GCC
* Architecture options usage
* C Libraries usage
* Linker scripts & startup code

* Installing executables on Linux *
Unpack the tarball to the install directory, like this:
$ cd $install_dir && tar xjf ChipONCC32-ccr1_issue-yyyymmdd-linux.tar.bz2

* Installing executables on Windows *
Run the installer (ChipONCC32-ccr1_issue-yyyymmdd-win32.exe) and follow the
instructions.

The toolchain in windows zip package is a backup to windows installer for
those who cannot run installer.  We need decompress the zip package
in a proper place and then invoke it following instructions in next section.

* Invoking GCC *
On Linux and Mac OS X, either invoke with the complete path like this:
$ $install_dir/ChipONCC32/ccr1_issue/bin/kf32-gcc

Or set path like this:
$ export PATH=$PATH:$install_dir/ChipONCC32/ccr1_issue/bin
$ kf32-gcc

On Windows (although the above approaches also work), it can be more
convenient to either have the installer register environment variables, or run
INSTALL_DIR\bin\kf32chaintoolenv.bat to set environment variables for the current cmd.

For windows zip package, after decompression we can invoke toolchain either with
complete path like this:
TOOLCHAIN_UNZIP_DIR\bin\kf32-gcc
or run TOOLCHAIN_UNZIP_DIR\bin\kf32chaintoolenv.bat to set environment variables for the
current cmd.

* Architecture options usage *

This toolchain is built and optimized for KungFu32 ReduceISA bare metal development.
the following table shows how to invoke GCC/G++ with correct command line
options for variants of KungFu32 ReduceISA architectures. 

--------------------------------------------------------------------
| KF32 Core  | Command Line Options                      | multilib |
|-------------|------------------------------------------|----------|
|A140-1        |                                                              |                |
|A150-1        |                                                              |                |
|A146-2        |                                                              |                |
|A156-2        |                                                              |                |
|A158-3        |                                                              |                |
|-------------|------------------------------------------|----------|

* C Libraries usage *

This toolchain is released with two prebuilt C libraries based on newlib or mini_c_code_build:
one is the standard newlib and the other is mini use for compiler c.
not add $install_dir/ChipONCC32/ccr1_issue/kf32/include and $install_dir/ChipONCC32/ccr1_issue/kf32/lib for std search. add -L for command line.

For compile example:
$ kf32-gcc src.c  -L$install_dir/ChipONCC32/include/Sys $(OTHER_OPTIONS)
or
$ kf32-gcc src.c  -L$install_dir/ChipONCC32/ccr1_issue/kf32/include/Std $(OTHER_OPTIONS)

For link example:
$ kf32-gcc src.c  -L$install_dir/ChipONCC32/ccr1_issue/lib --start-group -lcrtv -lio -lstdlib -lstring -lctype -lmath --end-group $(OTHER_OPTIONS)
or
$ kf32-gcc src.c  -L$install_dir/ChipONCC32/ccr1_issue/lib --start-group -lgcc -lc -lm --end-group $(OTHER_OPTIONS)

Differences in librariesr
mini : Simple printing to usart ; Software Floating Point Library ; Common C standard language libraries, such as memset, memcpy, and strlen
newlib:Printing using file system, provided with methods under newlib, standard header file organization,Complete GCC runtime library output

* Linker scripts & startup code *

Examples Linker scripts under  -L$install_dir/ChipONCC32/ccr1_issue/Scripting/*.ld
More information can be found in the document introduction 

--------------------------------------------------------------------
ccr1_issue                                               Current release version, the number is r1
ccr1_issue\lib                                          For chip algorithm library and system-related library, such as libmath.a
					or
				            Based on the standard newlibs and libstd c++- v3 libraries libc libm libstd c++libsupc++
ccr1_issue\scripting                               For linker script files of this version
ccr1_issue\bin                                         Basic tool path, such as kf32-gcc.exe and kf32-ar.exe
ccr1_issue\kf32\bin                                 Tools of the tool chain (assembler, linker, etc.),	such as kf32-gcc.exe and kf32-ar.exe

chipregister                                            Set of files that describe chip register, used for IDE software

include                                                     Header files of chip register operations written in C or assembly language
include\Sys                                              Header files related to minimum adaptive system, such as math, malloc, etc.
include\Std_Sys                                      C header files based on the standard newlibs organization
include\Std_Sys\c++\4.7.0                     C++header files based on standard libstd c++- v3

common                                                  General tool path, such as gmake, rm, etc.
--------------------------------------------------------------------