summaryrefslogtreecommitdiff
blob: 1b258423d249aa5aa8239d4849e12d6eda094828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- Makefile	2006-03-21 15:33:21.000000000 +0100
+++ Makefile	2009-06-29 22:46:43.623289281 +0200
@@ -58,7 +58,7 @@ DUMMY := $(shell echo '${PAXCTLBIN} $$*'
 endif
 
 # for some reason the .c files need it, else GNU_STACK=RWE
-OPT_FLAGS  := -O2 $(ASFLAGS)
+OPT_FLAGS  := $(CFLAGS) $(ASFLAGS)
 PTHREAD := -lpthread
 # define stripping of binaries/libs here, or set these on make's commandline,
 # else you'll loose the chpax flags!
@@ -134,7 +134,7 @@ paxtest: $(TESTS) genpaxtest
 
 $(EXEC_TESTS) $(MPROT_TESTS): body.o
 	$(CC) $(CFLAGS) -o $@.o -c $@.c
-	$(CC) $(LDFLAGS) $(PTHREAD) -o $@ $< $@.o
+	$(CC) $(LDFLAGS) -o $@ $< $@.o $(PTHREAD)
 	
 $(RAND_TESTS): randbody.o
 	$(CC) $(CFLAGS) -o $@.o -c $@.c
@@ -180,7 +180,7 @@ getstack2: getstack.o
 	
 $(MPROTSH_TESTS): body.o shlibtest.so
 	$(CC) $(CFLAGS) -o $@.o -c $@.c
-	$(CC) $(LDFLAGS) $(PTHREAD) -o $@ $@.o $^
+	$(CC) $(LDFLAGS) -o $@ $@.o $^ $(PTHREAD)
 
 # used for RANDEXEC'd binaries
 retbody.o: body.c
@@ -189,12 +189,12 @@ retbody.o: body.c
 # build as ET_EXEC (recommended by PaX Team, not really a requirement)
 $(RET_TESTS): retbody.o
 	$(CC) $(CFLAGS) $(CC_ETEXEC) -o $@.o -c $@.c
-	$(CC) $(LDFLAGS) $(LD_ETEXEC) $(PTHREAD) -o $@ $< $@.o
+	$(CC) $(LDFLAGS) $(LD_ETEXEC) -o $@ $< $@.o $(PTHREAD)
 
 # build as ET_EXEC (not in Adamantix's Makefile)
 $(RETX_TESTS): retbody.o
 	$(CC) $(CFLAGS) $(CC_ETEXEC) -o $@.o -c $@.c
-	$(CC) $(LDFLAGS) $(LD_ETEXEC) $(PTHREAD) -o $@ $< $@.o
+	$(CC) $(LDFLAGS) $(LD_ETEXEC) -o $@ $< $@.o $(PTHREAD)
 	$(PAXBIN) -SPXM $@
 	
 # should also shlibbss.o and shlibdata.o be built w/ PIC?
@@ -206,4 +206,4 @@ shlib%.so: shlib%.o
 	$(CC) $(SHLDFLAGS) -shared -o $@ $<
 
 $(SHLIB_TESTS): body.o $(SHLIBS) shlibbss.o shlibdata.o
-	$(CC) $(LDFLAGS) $(PTHREAD) -o $@ body.o $@.o $(SHLIBS) $(DL)
+	$(CC) $(LDFLAGS) -o $@ body.o $@.o $(SHLIBS) $(DL) $(PTHREAD)