Commit f9aa996f authored by kgardas's avatar kgardas
Browse files

pass -z wxneeded or -Wl,-zwxneeded for linking on OpenBSD

This patch fixes issue with abort in GHCi on OpenBSD current
as of Aug 12 2016. The OpenBSD is more and more strict about usage
of writable and executable memory. Programs/applications which
requires such functionality need to be linked with -z wxneeded linker
flag and need to be run from the file-system mounted with wxallowed
mount option. If either of those options in not met, then problematic
program/application usually fail on some mmap/mprotect call which fail.

Reviewers: bgamari, austin, hvr

Subscribers: thomie, erikd

Differential Revision:
parent 0d3bf620
......@@ -653,6 +653,13 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$5="$$5 -D_THREAD_SAFE"
# We need -z wxneeded at least to link ghc-stage2 to workaround
# W^X issue in GHCi on OpenBSD current (as of Aug 2016)
$3="$$3 -Wl,-zwxneeded"
$4="$$4 -z wxneeded"
# If gcc knows about the stack protector, turn it off.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment