diff options
author | Darren Tucker <dtucker@zip.com.au> | 2014-01-21 12:48:51 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2014-01-21 12:48:51 +1100 |
commit | 096118dc73ab14810b3c12785c0b5acb01ad6123 (patch) | |
tree | 349bdd2d94cd3f15500c8391caaa573872d1c39f /configure.ac | |
parent | f9df7f6f477792254eab33cdef71a6d66488cb88 (diff) |
- (dtucker) [configure.ac] Make PIE a configure-time option which defaults
to on platforms where it's known to be reliably detected and off elsewhere.
Works around platforms such as FreeBSD 9.1 where it does not interop with
-ftrapv (it seems to work but fails when trying to link ssh). ok djm@
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 76784c52c..e5bb68409 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.555 2014/01/18 10:12:43 dtucker Exp $ | 1 | # $Id: configure.ac,v 1.556 2014/01/21 01:48:52 dtucker Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -15,7 +15,7 @@ | |||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | ||
17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
18 | AC_REVISION($Revision: 1.555 $) | 18 | AC_REVISION($Revision: 1.556 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | AC_LANG([C]) | 20 | AC_LANG([C]) |
21 | 21 | ||
@@ -165,8 +165,6 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | |||
165 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) | 165 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
166 | if test "x$use_toolchain_hardening" = "x1"; then | 166 | if test "x$use_toolchain_hardening" = "x1"; then |
167 | OSSH_CHECK_CFLAG_COMPILE([-ftrapv]) | 167 | OSSH_CHECK_CFLAG_COMPILE([-ftrapv]) |
168 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) | ||
169 | OSSH_CHECK_LDFLAG_LINK([-pie]) | ||
170 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) | 168 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
171 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) | 169 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
172 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) | 170 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
@@ -557,6 +555,7 @@ case "$host" in | |||
557 | AC_DEFINE([BROKEN_SETREGID]) | 555 | AC_DEFINE([BROKEN_SETREGID]) |
558 | ;; | 556 | ;; |
559 | *-*-darwin*) | 557 | *-*-darwin*) |
558 | use_pie=1 | ||
560 | AC_MSG_CHECKING([if we have working getaddrinfo]) | 559 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
561 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> | 560 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
562 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | 561 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
@@ -695,6 +694,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | |||
695 | ;; | 694 | ;; |
696 | *-*-linux*) | 695 | *-*-linux*) |
697 | no_dev_ptmx=1 | 696 | no_dev_ptmx=1 |
697 | use_pie=1 | ||
698 | check_for_libcrypt_later=1 | 698 | check_for_libcrypt_later=1 |
699 | check_for_openpty_ctty_bug=1 | 699 | check_for_openpty_ctty_bug=1 |
700 | AC_DEFINE([PAM_TTY_KLUDGE], [1], | 700 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
@@ -791,6 +791,7 @@ mips-sony-bsd|mips-sony-newsos4) | |||
791 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) | 791 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
792 | ;; | 792 | ;; |
793 | *-*-openbsd*) | 793 | *-*-openbsd*) |
794 | use_pie=1 | ||
794 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) | 795 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
795 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) | 796 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
796 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) | 797 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
@@ -1562,6 +1563,22 @@ AC_ARG_WITH([audit], | |||
1562 | esac ] | 1563 | esac ] |
1563 | ) | 1564 | ) |
1564 | 1565 | ||
1566 | AC_ARG_WITH([pie], | ||
1567 | [ --with-pie Build Position Independent Executables if possible], [ | ||
1568 | if test "x$withval" = "xno"; then | ||
1569 | use_pie=0 | ||
1570 | fi | ||
1571 | if test "x$withval" = "xyes"; then | ||
1572 | use_pie=1 | ||
1573 | fi | ||
1574 | ] | ||
1575 | ) | ||
1576 | |||
1577 | if test "x$use_toolchain_hardening" = "x1" && test "x$use_pie" = "x1"; then | ||
1578 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) | ||
1579 | OSSH_CHECK_LDFLAG_LINK([-pie]) | ||
1580 | fi | ||
1581 | |||
1565 | dnl Checks for library functions. Please keep in alphabetical order | 1582 | dnl Checks for library functions. Please keep in alphabetical order |
1566 | AC_CHECK_FUNCS([ \ | 1583 | AC_CHECK_FUNCS([ \ |
1567 | Blowfish_initstate \ | 1584 | Blowfish_initstate \ |