GCC arm 7 compilation error for px4fmu-v4_rtps

Building px4fmu-v4_rtps with latest gcc-arm-none-eabi-7-2017-q4-major or with gcc-arm-none-eabi-6_2-2016q4 doesn’t work as it gives a compilation error.

error: ‘wcstol’ is not a member of ‘std’

But using gcc-arm-none-eabi-5_4-2016q3 works completely fine!

Am I missing something while setting up build environment? I am working on Ubuntu 18.04 LTS.