Skip to contentSkip to conversation

Patch for stackguard compiler and 2.2.18

PATCH Greg KH 1 participant 1 message Dec 11, 2000 Kbuild

lore
Share & tools
lore

Greg KH

author
#0 lore raw

Here's an update for my patch to enable the just released 2.2.18 kernel to compile with any of the different versions of the StackGuard compiler.

If anyone has any problems with it, please let me know,

greg k-h

Signature · 2 lines
greg@(kroah|wirex).com
http://immunix.org/~greg
Makefile +6 -0
diff -Naur -X /home/greg/linux/dontdiff linux-2.2.18/Makefile linux-2.2.18-greg/Makefile
@@ -97,6 +97,12 @@
 
 CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 
+# if we have a StackGuard compiler, then we need to turn off the canary death handler stuff
+CFLAGS		+= $(shell if $(CC) -fno-canary-all-functions -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-canary-all-functions"; fi)
+HOSTCFLAGS	+= $(shell if $(CC) -fno-canary-all-functions -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-canary-all-functions"; fi)
+CFLAGS		+= $(shell if $(CC) -mno-terminator-canary -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mno-terminator-canary"; fi)
+HOSTCFLAGS	+= $(shell if $(CC) -mno-terminator-canary -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mno-terminator-canary"; fi)
+
 # use '-fno-strict-aliasing', but only if the compiler can take it
 CFLAGS += $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strict-aliasing"; fi)
 
arch/i386/boot/compressed/Makefile +5 -0
diff -Naur -X /home/greg/linux/dontdiff linux-2.2.18/arch/i386/boot/compressed/Makefile linux-2.2.18-greg/arch/i386/boot/compressed/Makefile
@@ -10,6 +10,11 @@
 OBJECTS = $(HEAD) misc.o
 
 CFLAGS = -O2 -DSTDC_HEADERS
+
+# if we have a StackGuard compiler, then we need to turn off the canary death handler stuff
+CFLAGS += $(shell if $(CC) -fno-canary-all-functions -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-canary-all-functions"; fi)
+CFLAGS += $(shell if $(CC) -mno-terminator-canary -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mno-terminator-canary"; fi)
+
 ZLDFLAGS = -e startup_32
 
 #