Implemented secure compile flags.
Implemented workaround for issues when D_FORITFY_SOURCE=2