diff options
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/debian/rules b/debian/rules index ff83b852b..0966a2e55 100755 --- a/debian/rules +++ b/debian/rules | |||
@@ -3,6 +3,8 @@ | |||
3 | # Uncomment this to turn on verbose mode. | 3 | # Uncomment this to turn on verbose mode. |
4 | # export DH_VERBOSE=1 | 4 | # export DH_VERBOSE=1 |
5 | 5 | ||
6 | include /usr/share/hardening-includes/hardening.make | ||
7 | |||
6 | # This has to be exported to make some magic below work. | 8 | # This has to be exported to make some magic below work. |
7 | export DH_OPTIONS | 9 | export DH_OPTIONS |
8 | 10 | ||
@@ -44,12 +46,6 @@ ifneq (,$(findstring :$(DEB_HOST_ARCH_OS):,:linux:knetbsd:)) | |||
44 | PIC_CFLAGS := -fPIC | 46 | PIC_CFLAGS := -fPIC |
45 | PIC_LDFLAGS := -fPIC | 47 | PIC_LDFLAGS := -fPIC |
46 | endif | 48 | endif |
47 | ifeq (,$(findstring :$(DEB_HOST_ARCH_CPU):,:hppa:m68k:mips:mipsel:)) | ||
48 | # Use position-independent executables to take advantage of address space | ||
49 | # layout randomisation. TODO: This should be done in configure. | ||
50 | PIE_CFLAGS := -fPIE | ||
51 | PIE_LDFLAGS := -fPIE -pie | ||
52 | endif | ||
53 | endif | 49 | endif |
54 | 50 | ||
55 | # Change the version string to include the Debian version | 51 | # Change the version string to include the Debian version |
@@ -100,7 +96,7 @@ confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUS | |||
100 | confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | 96 | confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
101 | 97 | ||
102 | # Compiler flags. | 98 | # Compiler flags. |
103 | cflags := $(OPTFLAGS) $(PIC_CFLAGS) $(PIE_CFLAGS) | 99 | cflags := $(OPTFLAGS) $(PIC_CFLAGS) $(HARDENING_CFLAGS) |
104 | cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT | 100 | cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT |
105 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | 101 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" |
106 | cflags_udeb := -Os | 102 | cflags_udeb := -Os |
@@ -109,8 +105,8 @@ confflags += --with-cflags='$(cflags)' | |||
109 | confflags_udeb += --with-cflags='$(cflags_udeb)' | 105 | confflags_udeb += --with-cflags='$(cflags_udeb)' |
110 | 106 | ||
111 | # Linker flags. | 107 | # Linker flags. |
112 | ifneq ($(PIC_LDFLAGS)$(PIE_LDFLAGS),) | 108 | ifneq ($(PIC_LDFLAGS)$(HARDENING_LDFLAGS),) |
113 | confflags += --with-ldflags='$(strip $(PIC_LDFLAGS) $(PIE_LDFLAGS))' | 109 | confflags += --with-ldflags='$(strip $(PIC_LDFLAGS) $(HARDENING_LDFLAGS))' |
114 | endif | 110 | endif |
115 | 111 | ||
116 | build: build-deb build-udeb | 112 | build: build-deb build-udeb |