summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-12-22 21:04:52 +0000
committerEric Andersen <andersen@codepoet.org>2004-12-22 21:04:52 +0000
commit3d831a7c27e8c781bf7cfef0e36a6f27f38c0cf4 (patch)
tree19e83f3381403ba4e6c7e039e381f5d2c23f0e3e
parent98701e85730391501e100419ab3aeb7dd77055d2 (diff)
Cleaned up patch from Peter S. Mazinger adding support for
-fstack-protector and -fno-stack-protector-all security options
-rw-r--r--Rules.mak9
-rw-r--r--ldso/ldso/Makefile3
-rw-r--r--ldso/libdl/Makefile2
-rw-r--r--libcrypt/Makefile2
-rw-r--r--libintl/Makefile2
-rw-r--r--libm/Makefile2
-rw-r--r--libnsl/Makefile2
-rw-r--r--libpthread/Makefile2
-rw-r--r--libresolv/Makefile2
-rw-r--r--libutil/Makefile2
-rw-r--r--utils/Makefile2
11 files changed, 25 insertions, 5 deletions
diff --git a/Rules.mak b/Rules.mak
index 7c6b51d6b..75bf9462a 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -231,9 +231,13 @@ PIEFLAG=
LDPIEFLAG=
endif
-ifeq ($(SSP_CFLAGS),)
+SSP_DISABLE_FLAGS=$(call check_gcc,-fno-stack-protector,)
+ifeq ($(UCLIBC_PROPOLICE),y)
SSP_CFLAGS=$(call check_gcc,-fno-stack-protector-all,)
SSP_CFLAGS+=$(call check_gcc,-fstack-protector,)
+SSP_ALL_CFLAGS=$(call check_gcc,-fstack-protector-all,)
+else
+SSP_CFLAGS=$(SSP_DISABLE_FLAGS)
endif
# Some nice CFLAGS to work with
@@ -242,7 +246,8 @@ CFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) $(SSP_CFLAGS)
ifeq ($(DODEBUG),y)
#CFLAGS += -g3
- CFLAGS = $(XWARNINGS) -O0 -g3 $(CPU_CFLAGS) -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)include -I.
+ CFLAGS = $(XWARNINGS) -O0 -g3 $(CPU_CFLAGS) $(SSP_CFLAGS) \
+ -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)include -I.
LDFLAGS:= $(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc
STRIPTOOL:= true -Since_we_are_debugging
else
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile
index 1d71f3fcb..ef48e3358 100644
--- a/ldso/ldso/Makefile
+++ b/ldso/ldso/Makefile
@@ -21,11 +21,10 @@ TOPDIR=../../
include $(TOPDIR)Rules.mak
LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-SSPFLAGS=$(call check_gcc,-fno-stack-protector,)
# reset to initial (disabling predefined CFLAGS)
ASFLAGS=
-XXFLAGS=$(XWARNINGS) $(SSPFLAGS)
+XXFLAGS=$(XWARNINGS) $(SSP_DISABLE_FLAGS)
ifeq ($(DODEBUG),y)
# Not really much point in including debugging info, since gdb
# can't really debug ldso, since gdb requires help from ldso to
diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile
index 7f65128c4..37019aff3 100644
--- a/ldso/libdl/Makefile
+++ b/ldso/libdl/Makefile
@@ -21,7 +21,7 @@
TOPDIR=../../
include $(TOPDIR)Rules.mak
-XXFLAGS=$(XWARNINGS)
+XXFLAGS=$(XWARNINGS) $(SSP_CFLAGS) $(SSP_ALL_CFLAGS)
ifeq ($(DODEBUG),y)
XXFLAGS+=-O0 -g3
else
diff --git a/libcrypt/Makefile b/libcrypt/Makefile
index afe20f786..497e5307c 100644
--- a/libcrypt/Makefile
+++ b/libcrypt/Makefile
@@ -24,6 +24,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
LIBCRYPT=libcrypt.a
LIBCRYPT_SHARED=libcrypt.so
LIBCRYPT_SHARED_FULLNAME=libcrypt-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
diff --git a/libintl/Makefile b/libintl/Makefile
index d52409ed9..8dd084dc5 100644
--- a/libintl/Makefile
+++ b/libintl/Makefile
@@ -25,6 +25,8 @@ TOPDIR=../
include $(TOPDIR)Rules.mak
LIBC=$(TOPDIR)libc.a
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
LIBINTL=libintl.a
LIBINTL_SHARED=libintl.so
LIBINTL_SHARED_FULLNAME=libintl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
diff --git a/libm/Makefile b/libm/Makefile
index cdecf0991..02e632107 100644
--- a/libm/Makefile
+++ b/libm/Makefile
@@ -34,6 +34,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
DIRS =
ifeq ($(strip $(HAS_FPU)),y)
ifeq ($(TARGET_ARCH),$(wildcard $(TARGET_ARCH)))
diff --git a/libnsl/Makefile b/libnsl/Makefile
index 1d1b9a53a..915651063 100644
--- a/libnsl/Makefile
+++ b/libnsl/Makefile
@@ -19,6 +19,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
LIBNSL=libnsl.a
LIBNSL_SHARED=libnsl.so
LIBNSL_SHARED_FULLNAME=libnsl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
diff --git a/libpthread/Makefile b/libpthread/Makefile
index 709d22b49..4a763ca78 100644
--- a/libpthread/Makefile
+++ b/libpthread/Makefile
@@ -19,6 +19,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
#Adjust the soname version to avoid namespace collisions with glibc's libpthread
LIBPTHREAD=libpthread.a
LIBPTHREAD_SHARED=libpthread.so
diff --git a/libresolv/Makefile b/libresolv/Makefile
index d575363c0..510457b87 100644
--- a/libresolv/Makefile
+++ b/libresolv/Makefile
@@ -25,6 +25,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
LIBRESOLV=libresolv.a
LIBRESOLV_SHARED=libresolv.so
LIBRESOLV_SHARED_FULLNAME=libresolv-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
diff --git a/libutil/Makefile b/libutil/Makefile
index a31f1ed8f..59176c903 100644
--- a/libutil/Makefile
+++ b/libutil/Makefile
@@ -25,6 +25,8 @@ TOPDIR=../
include $(TOPDIR)Rules.mak
LIBC=$(TOPDIR)libc.a
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
LIBUTIL=libutil.a
LIBUTIL_SHARED=libutil.so
LIBUTIL_SHARED_FULLNAME=libutil-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
diff --git a/utils/Makefile b/utils/Makefile
index 168a2e920..86640055d 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -19,6 +19,8 @@
TOPDIR=../
include $(TOPDIR)Rules.mak
+CFLAGS+=$(SSP_ALL_CFLAGS)
+
TARGETS = ldd ldconfig readelf
ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)