Debug symbols not getting generated after using -d option


I am working on a legacy application and converting it to a legato app;

Legato debugger option works fine on accompanying sample apps, but on the legacy app, it does not produce the necessary .build-id file nor the .debug files. Can someone help resolve this ?