Add C compile-time flag to avoid disabling ASLR
commite7333c4c48dc5dfb992a04a3fa9b93a85539608d
authorDouglas Katzman <dougk@google.com>
Mon, 4 Dec 2017 19:07:45 +0000 (4 14:07 -0500)
committerDouglas Katzman <dougk@google.com>
Mon, 4 Dec 2017 19:32:39 +0000 (4 14:32 -0500)
treefdd0060e90fadaa33dc8e9c8317ac5436c70837e
parent710cc90fea2d6b8c673f5b001622eb04592c2836
Add C compile-time flag to avoid disabling ASLR

Re-exec can fail depending on how dynamic libraries are found - in addition
to being generally annoying - if readlink("/proc/self/exe") is the wrong path
to use.  The right fix is to record static space in an ELF program header to
place it where expected with no further tricks needed, and to rely on
automatic relocation of other spaces.

Compile with -DDISABLE_ASLR=0 only if needed.  Default (1 if undefined) is
to disable. (It's not "-DENABLE_ASLR" because forcing ASLR isn't a thing,
but we can forgo trying to un-enable it, hence the name chosen for this)

See https://sourceforge.net/p/sbcl/mailman/message/12418054/ for history
src/runtime/linux-os.c