]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Build pt_chown as PIE.
authorUlrich Drepper <drepper@redhat.com>
Wed, 17 Jun 2009 03:46:42 +0000 (20:46 -0700)
committerAndreas Schwab <schwab@redhat.com>
Tue, 4 Aug 2009 08:58:04 +0000 (10:58 +0200)
(cherry picked from commit f051ddfe22d3db4e77d6a545d5363be8b986cb96)

ChangeLog
login/Makefile

index a714c3eb17eb06cbfe1d1a567d6fa42fbdfa0018..ec8c64aedfea9374f6aa7e8c0857b6e1cd290d89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-16  Ulrich Drepper  <drepper@redhat.com>
+
+       * login/Makefile: Build pt_chown as PIE.
+
 2009-06-16  Ulrich Drepper  <drepper@redhat.com>
 
        * login/Makefile: If necessary link pt_chown with -lcap.
index 427c050a8984d62c88c3c24dc549aa55049c287b..beb2a5c3a8a53cc57231c0aacc07ceba17e6e99b 100644 (file)
@@ -54,10 +54,23 @@ otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
             $(resolvobjdir)/libresolv.a $(common-objpfx)libc.a
 endif
 
+ifeq (yesyes,$(have-fpie)$(build-shared))
+pt_chown-cflags += $(pie-ccflag)
+endif
+ifeq (yes,$(have-ssp))
+pt_chown-cflags += -fstack-protector
+endif
 ifeq (yes,$(have-libcap))
 libcap = -lcap
 endif
+CFLAGS-pt_chown.c = $(pt_chown-cflags)
 LDLIBS-pt_chown = $(libcap)
+ifeq (yesyes,$(have-fpie)$(build-shared))
+LDFLAGS-pt_chown = -Wl,-z,now
+
+$(objpfx)pt_chown: $(objpfx)pt_chown.o
+       $(+link-pie)
+endif
 
 # pt_chown needs to be setuid root.
 $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force)