Please refer to http://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code.
The U-Boot and Linux makefiles use the environment variables ARCH/CROSS_COMPILE to configure and call the compiler correctly. Therefore, these environment variables must be exported in any shell instance that will run configure/compile commands to build U-Boot or Linux for the target module.
You have to export these variables every time you start a new shell instance.
bad value (armv5) for -march= switch error message means that gcc for x86 was called to compile something for arm. And that means that the environment variable CROSS_COMPILE is not set or not exported in the current shell environment.