Just now I realised that you are facing this issue with PSoC5 GCC Compiler and not with PSoC3 Keil Compiler. I have created a seperate project to test this and then I found out that it is because of math library not being included in GCC compiler.
Please refer to the KB article written by me for more details - http://www.cypress.com/?rID=42838
That was it, man.... what a relief. Why aren't things like this better documented?
I scoured the web for this. Now the log() function works just fine. Thanks for the pointer.