Fix build issues due to updated arm-sdk

Due to recent changes made in arm-sdk,
the FORTIFY_SOURCE security flag enables optimization level 2.

The repo has a default debug level of optimization which conflicts with
FORTIFY_SOURCE flag.

In this commit the default build type is set to debugoptimized and also made sure
to disable the FORTIFY_SOURCE when we need to build without any optimization.

Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I73c3dea7e4860dc606e26cd0f6cd31e60ff8105d
diff --git a/meson.build b/meson.build
index a451571..e1b06b7 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,8 @@
         default_options: [
                           'cpp_std=c++17',
                           'warning_level=3',
-                          'werror=true'
+                          'werror=true',
+                          'buildtype=debugoptimized'
                          ],
         version: '1.0',
         license: 'Apache-2.0'
@@ -19,6 +20,12 @@
 sdbusplus = dependency('sdbusplus')
 phosphor_logging = dependency('phosphor-logging')
 
+# Disable FORTIFY_SOURCE when compiling with no optimization
+if(get_option('optimization') == '0')
+  add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c'])
+  message('Disabling FORTIFY_SOURCE as optimization is set to 0')
+endif
+
 # Configuration header file(config.h) generation
 
 conf_data = configuration_data()