I was looking for a way to enable stack canaries for my ios application in swift but then i found that recent version of xcodes have the flag required to enable stack canaries is enabled by default. So then i was looking for a way to ensure the stack canaries are enabled and as the other sites say i tried with the otool command in terminal($ otool -Iv appName |grep stack_chk) to ensure it and expecting it to return 'stack_chk_guard and stack_chk_fail' flags but it did not return any value/flags. So I then tried setting manually the flag '-fstack-protector-all' under 'other C flags', still I could see no flags with otool command.
What am I missing here ? or am I misinterpreting something ? how can I assure myself that stack canaries are enabled for my application ?
Looks like you are doing everything correctly. Please double check:
-fstack-protector-all
flag for main target "Other C Flags". Or you are setting it for project settings and has$(inherited)
in target build settings.AppName.app
packagecd path-to-package/AppName.app
otool
on binary file:otool -Iv AppName| grep stack