summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--isomd5sum/Makefile3
-rw-r--r--isys/Makefile2
-rw-r--r--isys/gzlib/Makefile2
-rw-r--r--loader2/Makefile6
-rw-r--r--stubs/Makefile2
-rw-r--r--utils/Makefile16
7 files changed, 23 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index b01900b49..c1274d69f 100644
--- a/Makefile
+++ b/Makefile
@@ -29,14 +29,14 @@ locale-list:
PYTHONPATH="." $(PYTHON) scripts/genlocalelist.py > locale-list
mini-wm: mini-wm.c
- gcc -o mini-wm mini-wm.c `pkg-config gtk+-x11-2.0 --cflags --libs` -Wall -Werror
+ gcc -o mini-wm mini-wm.c `pkg-config gtk+-x11-2.0 --cflags --libs` -Wall -Werror -D_FORTIFY_SOURCE=2
xmouse.so: xmouse.c
- gcc -Wall -o xmouse.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xmouse.c -Wall -Werror
+ gcc -Wall -o xmouse.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xmouse.c -Wall -Werror -D_FORTIFY_SOURCE=2
gcc -o xmouse.so -shared xmouse.o -L/usr/X11R6/$(LIBDIR) -lXxf86misc -lX11 -lXext
xutils.so: xutils.c
- gcc -ggdb -Wall -o xutils.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xutils.c -Wall -Werror
+ gcc -ggdb -Wall -o xutils.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xutils.c -Wall -Werror -D_FORTIFY_SOURCE=2
gcc -o xutils.so -shared xutils.o -ggdb -L/usr/X11R6/$(LIBDIR) -lX11
depend:
diff --git a/isomd5sum/Makefile b/isomd5sum/Makefile
index b0b774cd2..8fdeaa114 100644
--- a/isomd5sum/Makefile
+++ b/isomd5sum/Makefile
@@ -1,6 +1,7 @@
include ../Makefile.inc
-CFLAGS = -g -fPIC -D_FILE_OFFSET_BITS=64 -I$(PYTHONINCLUDE) -O -Wall -Werror
+CFLAGS = -g -fPIC -D_FILE_OFFSET_BITS=64 -I$(PYTHONINCLUDE) -O -Wall -Werror \
+ -D_FORTIFY_SOURCE=2
OBJECTS = md5.o libimplantisomd5.o checkisomd5.o pyisomd5sum.c \
implantisomd5 checkisomd5
SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
diff --git a/isys/Makefile b/isys/Makefile
index f0b536cd0..12c4fd63b 100644
--- a/isys/Makefile
+++ b/isys/Makefile
@@ -1,6 +1,6 @@
include ../Makefile.inc
-CFLAGS = -ffunction-sections -I$(PYTHONINCLUDE) -I.. -Wall -Os -g -DHAVE_NFS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Werror
+CFLAGS = -ffunction-sections -I$(PYTHONINCLUDE) -I.. -Wall -Os -g -DHAVE_NFS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Werror -D_FORTIFY_SOURCE=2
OBJECTS = nfsmount.o nfsmount_clnt.o nfsmount_xdr.o imount.o getmacaddr.o \
smp.o devnodes.o cpio.o uncpio.o dasd.o \
diff --git a/isys/gzlib/Makefile b/isys/gzlib/Makefile
index d7eba42e2..9d081b901 100644
--- a/isys/gzlib/Makefile
+++ b/isys/gzlib/Makefile
@@ -1,6 +1,6 @@
include ../../Makefile.inc
-CFLAGS += -I . -Os -fPIC -g -Wall -Werror
+CFLAGS += -I . -Os -fPIC -g -Wall -Werror -D_FORTIFY_SOURCE=2
SOURCES = bits.c gzip.c inflate.c lzw.c trees.c unzip.c util.c zip.c binding.c \
deflate.c zip.c
OBJS = $(patsubst %.c,%.o,$(SOURCES))
diff --git a/loader2/Makefile b/loader2/Makefile
index ee15e67df..1825a51d1 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -36,8 +36,8 @@ HWLIBS += -lpci
endif
DEBUG = -ggdb
-COPTS = $(DEBUG) -Os -Wall -DUSE_LOGDEV -DVERSION='"$(VERSION)"' -Werror
-CFLAGS = $(COPTS) -ffunction-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBIO_H
+COPTS = $(DEBUG) -Os -Wall -DUSE_LOGDEV -DVERSION='"$(VERSION)"' -Werror -D_FORTIFY_SOURCE=2
+CFLAGS = $(COPTS) -ffunction-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBIO_H
STATIC = -static
REALCC=gcc
@@ -148,7 +148,7 @@ install: all
install -m 644 font.bgf.gz $(DESTDIR)/$(RUNTIMEDIR)/loader
dirbrowser: dirbrowser.c
- gcc -DSTANDALONE -Wall -Werror -ggdb -o dirbrowser dirbrowser.c -lnewt -lslang
+ gcc -DSTANDALONE -D_FORTIFY_SOURCE=2 -Wall -Werror -ggdb -o dirbrowser dirbrowser.c -lnewt -lslang
ifeq (.depend,$(wildcard .depend))
include .depend
diff --git a/stubs/Makefile b/stubs/Makefile
index 94158289a..e424e6fac 100644
--- a/stubs/Makefile
+++ b/stubs/Makefile
@@ -7,7 +7,7 @@ TARGETS= $(LIBUTF8)
all: $(TARGETS)
$(LIBUTF8): unicode-lite.c
- gcc -fPIC -shared -o $@ $< -lwlite
+ gcc -fPIC -shared -o $@ $< -lwlite -D_FORTIFY_SOURCE=2
clean:
rm -f *.so.* *.o
diff --git a/utils/Makefile b/utils/Makefile
index d8dba43ab..93e06c9ae 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -7,7 +7,7 @@ ISYSLIB=isys
LOADERDIR = ../loader2
LOADLIBES = -lpopt
-CFLAGS = -Wall -g -I.. -I$(LOADERDIR) -Werror
+CFLAGS = -Wall -g -I.. -I$(LOADERDIR) -Werror -D_FORTIFY_SOURCE=2
RPMCFLAGS = $(CFLAGS) -I/usr/include/rpm
LDFLAGS = -g
@@ -37,10 +37,18 @@ moddeps: moddeps.o moduledeps.o
$(LOADLIBES) -lresolv -lpopt -lbz2
md5.o: md5.c md5.h
- gcc -c -O -g md5.c
+ gcc -c -O -g md5.c -D_FORTIFY_SOURCE=2
-genhdlist: genhdlist.c hash.c
- $(CC) $(LDFLAGS) $(RPMCFLAGS) -o genhdlist genhdlist.c hash.c \
+hash.o : hash.c
+ $(CC) $(RPMCFLAGS) -c -o $@ $<
+
+# XXX rpm needs to be fixed not to have const functions. Until then,
+# -Wno-return-type
+genhdlist.o : genhdlist.c
+ $(CC) $(RPMCFLAGS) -Wno-return-type -c -o $@ $<
+
+genhdlist: genhdlist.o hash.o
+ $(CC) $(LDFLAGS) -o genhdlist $^ \
-lrpm -lrpmdb -lrpmio -lbz2 -lz -lpopt -lelf -lpthread -lbeecrypt
depends: