How to properly add -g flag to debug?

I’m building OF 0.11.0 in Ubuntu and my app is crashing with segmentation fault. (it used to work fine in OF 0.10.0)

I would like to see more details why it crashes so I just added “-g” flag into PLATFORM_LDFLAGS in the file like the following:

PLATFORM_LDFLAGS += -fuse-ld=gold -g

But it does not show any further details.

Where should I add -g flag to see the more details?

Just figured out PROJECT_OPTIMIZATION_CFLAGS_RELEASE = -Os was causing the segmentation fault. removing the opitimization fixed the problem.