diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | configure.ac | 37 |
2 files changed, 30 insertions, 9 deletions
@@ -2,6 +2,8 @@ | |||
2 | - (djm) [openbsd-compat/setproctitle.c] Don't fail to compile if a | 2 | - (djm) [openbsd-compat/setproctitle.c] Don't fail to compile if a |
3 | platform that is expected to use the reuse-argv style setproctitle | 3 | platform that is expected to use the reuse-argv style setproctitle |
4 | hack surprises us by providing a setproctitle in libc; ok dtucker | 4 | hack surprises us by providing a setproctitle in libc; ok dtucker |
5 | - (djm) [configure.ac] Unless specifically requested, only attempt | ||
6 | to build Position Independent Executables on gcc >= 4.x; ok dtucker | ||
5 | 7 | ||
6 | 20140121 | 8 | 20140121 |
7 | - (dtucker) [configure.ac] Make PIE a configure-time option which defaults | 9 | - (dtucker) [configure.ac] Make PIE a configure-time option which defaults |
diff --git a/configure.ac b/configure.ac index e5bb68409..b738f4e60 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.556 2014/01/21 01:48:52 dtucker Exp $ | 1 | # $Id: configure.ac,v 1.557 2014/01/22 05:31:18 djm 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.556 $) | 18 | AC_REVISION($Revision: 1.557 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | AC_LANG([C]) | 20 | AC_LANG([C]) |
21 | 21 | ||
@@ -555,7 +555,7 @@ case "$host" in | |||
555 | AC_DEFINE([BROKEN_SETREGID]) | 555 | AC_DEFINE([BROKEN_SETREGID]) |
556 | ;; | 556 | ;; |
557 | *-*-darwin*) | 557 | *-*-darwin*) |
558 | use_pie=1 | 558 | use_pie=auto |
559 | AC_MSG_CHECKING([if we have working getaddrinfo]) | 559 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
560 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> | 560 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
561 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | 561 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
@@ -694,7 +694,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | |||
694 | ;; | 694 | ;; |
695 | *-*-linux*) | 695 | *-*-linux*) |
696 | no_dev_ptmx=1 | 696 | no_dev_ptmx=1 |
697 | use_pie=1 | 697 | use_pie=auto |
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,7 +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 | use_pie=auto |
795 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) | 795 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
796 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) | 796 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
797 | 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]) |
@@ -1566,15 +1566,34 @@ AC_ARG_WITH([audit], | |||
1566 | AC_ARG_WITH([pie], | 1566 | AC_ARG_WITH([pie], |
1567 | [ --with-pie Build Position Independent Executables if possible], [ | 1567 | [ --with-pie Build Position Independent Executables if possible], [ |
1568 | if test "x$withval" = "xno"; then | 1568 | if test "x$withval" = "xno"; then |
1569 | use_pie=0 | 1569 | use_pie=no |
1570 | fi | 1570 | fi |
1571 | if test "x$withval" = "xyes"; then | 1571 | if test "x$withval" = "xyes"; then |
1572 | use_pie=1 | 1572 | use_pie=yes |
1573 | fi | 1573 | fi |
1574 | ] | 1574 | ] |
1575 | ) | 1575 | ) |
1576 | 1576 | if test "x$use_pie" = "x"; then | |
1577 | if test "x$use_toolchain_hardening" = "x1" && test "x$use_pie" = "x1"; then | 1577 | use_pie=no |
1578 | fi | ||
1579 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then | ||
1580 | # Turn off automatic PIE when toolchain hardening is off. | ||
1581 | use_pie=no | ||
1582 | fi | ||
1583 | if test "x$use_pie" == "xauto"; then | ||
1584 | # Automatic PIE requires gcc >= 4.x | ||
1585 | AC_MSG_CHECKING([for gcc >= 4.x]) | ||
1586 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | ||
1587 | #if !defined(__GNUC__) || __GNUC__ < 4 | ||
1588 | #error gcc is too old | ||
1589 | #endif | ||
1590 | ]])], | ||
1591 | [ AC_MSG_RESULT([yes]) ], | ||
1592 | [ AC_MSG_RESULT([no]) | ||
1593 | use_pie=no ] | ||
1594 | ) | ||
1595 | fi | ||
1596 | if test "x$use_pie" != "xno"; then | ||
1578 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) | 1597 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
1579 | OSSH_CHECK_LDFLAG_LINK([-pie]) | 1598 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
1580 | fi | 1599 | fi |