src: only disable PIE on OS X when -prof is passed
This is a follow-up to commit a5012a04 ("build: unbreak -prof, disable PIE on OS X") that disabled PIE (and therefore ASLR) completely on OS X.
We now scan the command line options and re-exec the process with the
_POSIX_SPAWN_DISABLE_ASLR flag set when -prof
is specified.
The options parser is smart enough to understand any combination of
-prof
and -noprof
, including alternative spellings like --no_prof
.
Fixes: #6466 (closed)