Thank you.
My build uses eglibc (Intel(R) IoT devkit Image).
But, GCC is not included with the build.
It includes the target toolchain with the build.
PREFERRED_PROVIDER_gcc = "wrl-target-toolchain"
instead of including gcc.
then I commented PREFERRED_PROVIDER_gcc = "wrl-target-toolchain"
and included the following lines in local.conf
PREFERRED_PROVIDER_gcc = "gcc"
PREFERRED_VERSION_gcc = "4.6.3"
gcc recipes for 4.6.3 is found in oe-core/meta/recipes-devtools/gcc
but, the problem is that it includes as i586-wrswrap-gcc in /usr/bin/ directory.
when i tested the hello world C code with i586-wrswrap-gcc.
It was throwing illegal instruction error.