This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Build libresolv with stack protector


2011-08-15  Andreas Schwab  <schwab@redhat.com>

	* resolv/Makefile (libresolv-cflags): Define and add it to CFLAGS
	for libresolv modules.
---
 resolv/Makefile |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/resolv/Makefile b/resolv/Makefile
index 42e3505..3ab9d5a 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1994-2001,2003,2004,2007,2008 Free Software Foundation, Inc.
+# Copyright (C) 1994-2001,2003,2004,2007,2008,2011 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -76,6 +76,29 @@ CPPFLAGS += -Dgethostbyname=res_gethostbyname \
 	    -Dgetnetbyname=res_getnetbyname \
 	    -Dgetnetbyaddr=res_getnetbyaddr
 
+ifeq (yes,$(have-ssp))
+libresolv-cflags += -fstack-protector
+endif
+
+CFLAGS-gethnamaddr.c += $(libresolv-cflags)
+CFLAGS-res_comp.c += $(libresolv-cflags)
+CFLAGS-res_debug.c += $(libresolv-cflags)
+CFLAGS-res_data.c += $(libresolv-cflags)
+CFLAGS-res_mkquery.c += $(libresolv-cflags)
+CFLAGS-res_query.c += $(libresolv-cflags)
+CFLAGS-res_send.c += $(libresolv-cflags)
+CFLAGS-inet_net_ntop.c += $(libresolv-cflags)
+CFLAGS-inet_net_pton.c += $(libresolv-cflags)
+CFLAGS-inet_neta.c += $(libresolv-cflags)
+CFLAGS-base64.c += $(libresolv-cflags)
+CFLAGS-ns_parse.c += $(libresolv-cflags)
+CFLAGS-ns_name.c += $(libresolv-cflags)
+CFLAGS-ns_netint.c += $(libresolv-cflags)
+CFLAGS-ns_ttl.c += $(libresolv-cflags)
+CFLAGS-ns_print.c += $(libresolv-cflags)
+CFLAGS-ns_samedomain.c += $(libresolv-cflags)
+CFLAGS-ns_date.c += $(libresolv-cflags)
+
 CFLAGS-res_hconf.c = -fexceptions
 
 # The BIND code elicits some harmless warnings.
-- 
1.7.6


-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]