From 891f788bec3762d6f0fccb103f6e4e2c44905445 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 5 Jun 2009 09:19:11 +0000 Subject: Build with -fPIC on mips/mipsel (thanks, Luk Claes; closes: #531942). --- debian/changelog | 1 + debian/rules | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d9efdaf7..cff6920b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ openssh (1:5.1p1-6) UNRELEASED; urgency=low * Add a comment above PermitRootLogin in sshd_config pointing to README.Debian. * Check if delgroup is present in openssh-client.postrm (closes: #530501). + * Build with -fPIC on mips/mipsel (thanks, Luk Claes; closes: #531942). -- Colin Watson Wed, 14 Jan 2009 11:30:07 +0000 diff --git a/debian/rules b/debian/rules index e85ff654b..371084e3a 100755 --- a/debian/rules +++ b/debian/rules @@ -39,6 +39,11 @@ ifeq ($(DEB_HOST_ARCH_CPU),) endif ifneq (,$(findstring :$(DEB_HOST_ARCH_OS):,:linux:knetbsd:)) + ifneq (,$(findstring :$(DEB_HOST_ARCH_CPU):,:mips:mipsel:)) + # Apparently this is not implied by -fPIE, at least on the mipsen. + PIC_CFLAGS := -fPIC + PIC_LDFLAGS := -fPIC + endif ifeq (,$(findstring :$(DEB_HOST_ARCH_CPU):,:hppa:m68k:)) # Use position-independent executables to take advantage of address space # layout randomisation. TODO: This should be done in configure. @@ -95,7 +100,7 @@ confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUS 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 # Compiler flags. -cflags := $(OPTFLAGS) $(PIE_CFLAGS) +cflags := $(OPTFLAGS) $(PIC_CFLAGS) $(PIE_CFLAGS) cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" cflags_udeb := -Os @@ -104,8 +109,8 @@ confflags += --with-cflags='$(cflags)' confflags_udeb += --with-cflags='$(cflags_udeb)' # Linker flags. -ifneq ($(PIE_LDFLAGS),) -confflags += --with-ldflags='$(PIE_LDFLAGS)' +ifneq ($(PIC_LDFLAGS)$(PIE_LDFLAGS),) +confflags += --with-ldflags='$(strip $(PIC_LDFLAGS) $(PIE_LDFLAGS))' endif build: build-deb build-udeb -- cgit v1.2.3