5

There is an option in XCode Build Settings called "Don't Create Position Independent Executables". This is straight-forward to enable here.

However, I'm using MonoDevelop and MonoTouch to develop my application, and I cannot find the equivalent setting there. I've tried passing the -fpie flag to the compiler, but doesn't seem to work. When I examine the compiled binary using otool, it does not have the PIE flag set.

Please help.

Dale Smith
  • 88
  • 3
  • Out of curiosity: why do you need to create a PIE executable anyway? – Rolf Bjarne Kvinge Nov 28 '12 at 17:33
  • Just one additional security measure.PIE enabled seems to be the default when building from XCode. I just cannot seem to figure out why its not default from MonoTouch. Or how to enable it in MonoTouch – Dale Smith Nov 28 '12 at 17:35

1 Answers1

7

MonoTouch doesn't currently support position independent code, when we AOT the managed code we generate position dependent code.

We may fix this in the future, but right now it's not a priority.

Update

Apple has just started warning about non-PIE enabled executables when publishing to the App Store. This will obviously shift our priorities.

Update 2

We have a potential fix which is going through testing / QA (but no firm release date yet).

Update 3 (2015/03/21)

This was fixed a long time ago.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86
  • Yep I just got a warning on an app submission. From the tone of the email it looks like Apple may require PIE executables in the near future :/ @Rolf Any ideas what kind of effort this will involve for Xamarin and when PIE capability will be available? – Paul DB May 08 '13 at 00:47
  • @PaulDB: Apple started warning about it yesterday, and we have just started looking at it, so we do not have a timeline yet. – Rolf Bjarne Kvinge May 08 '13 at 07:24
  • Is there anything on the roadmap for this yet for Xamarin Studio and Xamarin.iOS? – Dale Smith May 31 '13 at 21:23
  • @DaleSmith: we have a potential fix which is going through testing/QA (but no firm release date yet). – Rolf Bjarne Kvinge May 31 '13 at 22:43