summaryrefslogtreecommitdiff
path: root/packages/ltp/ltp-20090131/cross-compile.patch
blob: b414b6fc0fd05f474769c2612857ce07c8bbf1f3 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
---
 Makefile                                                              |    4 +++-
 lib/Makefile                                                          |    3 ---
 m4/GNUmakefile                                                        |    3 ---
 pan/Makefile                                                          |    2 --
 testcases/ballista/ballista/Makefile                                  |    2 +-
 testcases/ballista/ballista/compile/Makefile                          |    8 ++++----
 testcases/kernel/device-drivers/acpi/Makefile                         |    2 +-
 testcases/kernel/device-drivers/agp/user_space/Makefile               |    6 +++---
 testcases/kernel/device-drivers/base/user_base/Makefile               |    6 +++---
 testcases/kernel/device-drivers/dev_sim_framework/user_space/Makefile |    6 +++---
 testcases/kernel/device-drivers/drm/user_space/Makefile               |    2 +-
 testcases/kernel/device-drivers/include/Makefile                      |    2 +-
 testcases/kernel/device-drivers/nls/Makefile                          |    2 +-
 testcases/kernel/device-drivers/pci/user_tpci/Makefile                |    6 +++---
 testcases/kernel/device-drivers/tbio/user_space/Makefile              |    6 +++---
 testcases/kernel/device-drivers/usb/user_usb/Makefile                 |    6 +++---
 testcases/kernel/fs/fs-bench/Makefile                                 |    6 +++---
 testcases/kernel/fs/scsi/ltpfs/Makefile                               |    2 +-
 testcases/kernel/sched/hyperthreading/ht_affinity/Makefile            |    4 ++--
 testcases/kernel/sched/hyperthreading/ht_enabled/Makefile             |    2 +-
 testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile           |    2 +-
 21 files changed, 38 insertions(+), 44 deletions(-)

Index: ltp-full-20090131/Makefile
===================================================================
--- ltp-full-20090131.orig/Makefile
+++ ltp-full-20090131/Makefile
@@ -5,14 +5,16 @@ CROSS_COMPILER = $(CROSS_COMPILE)
 endif
 ifdef CROSS_COMPILER
 CC=$(CROSS_COMPILER)gcc
+CPP=$(CROSS_COMPILER)g++
 AR=$(CROSS_COMPILER)ar
 RANLIB=$(CROSS_COMPILER)ranlib
 endif
+PREFIX=/opt/ltp
 
 HAS_NUMA=$(shell sh tools/scripts/numa_test.sh)
 
 export CFLAGS += -Wall $(CROSS_CFLAGS)
-export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
+export CC CPP AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
 
 -include config.mk
 
Index: ltp-full-20090131/testcases/ballista/ballista/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/ballista/ballista/Makefile
+++ ltp-full-20090131/testcases/ballista/ballista/Makefile
@@ -24,7 +24,7 @@
 ########################
 
 # compiler info for the host
-CC = g++ -Wno-deprecated
+CC = $(CPP) -Wno-deprecated
 CFLAGS += -w ${TARGET_DEF}
 CLIBS = -lpthread -ldl -lnsl -rdynamic
 TEST_MAN_FILE = selfHost
Index: ltp-full-20090131/testcases/ballista/ballista/compile/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/ballista/ballista/compile/Makefile
+++ ltp-full-20090131/testcases/ballista/ballista/compile/Makefile
@@ -19,14 +19,14 @@ dFLAGS=-g -DDEBUG
 FLAGS= -O -Wall
 PFLAGS= -p -g3
 
-CPPCOMP= g++
+CPPCOMP= $(CPP)
 
 #
 # The following is "boilerplate" to set up the standard compilation
 # commands:
 .SUFFIXES:
 .SUFFIXES: .cpp .c .cc .h .o
-.c.o:  ; gcc $(FLAGS) -c $*.c
+.c.o:  ; $(CC) $(FLAGS) -c $*.c
 .cc.o:  ; $(CPPCOMP) $(FLAGS) -c $*.cc
 .cpp.o:  ; $(CPPCOMP) $(FLAGS) $(INC) -c $*.cpp
 .cxx.o:  ; $(CPPCOMP) $(FLAGS) $(INC) -c $*.cxx
@@ -41,10 +41,10 @@ all: blexer bparser
 	chmod 700 ../templates/do_parse
 
 blexer: jlist.o butil.o lex.yy.o blexer.o
-	gcc $(FLAGS)  -o blexer jlist.o butil.o lex.yy.o blexer.o 
+	$(CC) $(FLAGS)  -o blexer jlist.o butil.o lex.yy.o blexer.o 
 
 bparser: bparser.o 
-	g++ $(FLAGS) -o bparser bparser.o butil.c
+	$(CPP) $(FLAGS) -o bparser bparser.o butil.c
 
 jlist.o: jlist.c butil.h jlist.h
 
Index: ltp-full-20090131/testcases/kernel/device-drivers/acpi/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/acpi/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/acpi/Makefile
@@ -15,7 +15,7 @@ PWD	:= $(shell pwd)
 
 default:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-	gcc  $(CFLAGS) -o LtpAcpiMain  LtpAcpiMain.c
+	$(CC)  $(CFLAGS) -o LtpAcpiMain  LtpAcpiMain.c
 #	$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules
 endif
 
Index: ltp-full-20090131/testcases/kernel/device-drivers/agp/user_space/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/agp/user_space/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/agp/user_space/Makefile
@@ -1,8 +1,8 @@
 test_agp: tagp_ki.o user_tagp.o
-	gcc tagp_ki.o user_tagp.o -o test_agp 
+	$(CC) tagp_ki.o user_tagp.o -o test_agp 
 
 tagp_ki.o: tagp_ki.c
-	gcc -c tagp_ki.c
+	$(CC) -c tagp_ki.c
 
 user_tagp.o: user_tagp.c
-	gcc -c user_tagp.c
+	$(CC) -c user_tagp.c
Index: ltp-full-20090131/testcases/kernel/device-drivers/base/user_base/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/base/user_base/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/base/user_base/Makefile
@@ -1,11 +1,11 @@
 test_base: tbase_ki.o user_tbase.o
-	gcc tbase_ki.o user_tbase.o -o test_base
+	$(CC) tbase_ki.o user_tbase.o -o test_base
 
 tbase_ki.o: tbase_ki.c
-	gcc -c tbase_ki.c
+	$(CC) -c tbase_ki.c
 
 user_tbase.o: user_tbase.c
-	gcc -c user_tbase.c
+	$(CC) -c user_tbase.c
 
 clean: 
 	 rm -f *.o 2>/dev/null || true
Index: ltp-full-20090131/testcases/kernel/device-drivers/dev_sim_framework/user_space/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/dev_sim_framework/user_space/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/dev_sim_framework/user_space/Makefile
@@ -1,8 +1,8 @@
 test_mod: tmod_ki.o user_tmod.o
-	gcc tmod_ki.o user_tmod.o -o test_mod
+	$(CC) tmod_ki.o user_tmod.o -o test_mod
 
 tmod_ki.o: tmod_ki.c
-	gcc -c tmod_ki.c
+	$(CC) -c tmod_ki.c
 
 user_tmod.o: user_tmod.c
-	gcc -c user_tmod.c
+	$(CC) -c user_tmod.c
Index: ltp-full-20090131/testcases/kernel/device-drivers/drm/user_space/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/drm/user_space/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/drm/user_space/Makefile
@@ -2,4 +2,4 @@
 	KDIR := /lib/modules/$(shell uname -r)/build
 	CFLAGS := -I$(KDIR)/drivers/char/drm
 default:
-	gcc -o test_drm  user_tdrm.c $(CFLAGS)
+	$(CC) -o test_drm  user_tdrm.c $(CFLAGS)
Index: ltp-full-20090131/testcases/kernel/device-drivers/include/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/include/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/include/Makefile
@@ -14,7 +14,7 @@ PWD	:= $(shell pwd)
 
 default:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-	gcc -Wall -o userBlockInclude userBlockInclude.c
+	$(CC) -Wall -o userBlockInclude userBlockInclude.c
 #	$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules
 endif
 
Index: ltp-full-20090131/testcases/kernel/device-drivers/nls/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/nls/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/nls/Makefile
@@ -13,7 +13,7 @@ PWD	:= $(shell pwd)
 
 default:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-	gcc $(EXTRA_CFLAGS) -o userBlockNLS userBlockNLS.c
+	$(CC) $(EXTRA_CFLAGS) -o userBlockNLS userBlockNLS.c
 #	$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules
 
 clean:
Index: ltp-full-20090131/testcases/kernel/device-drivers/pci/user_tpci/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/pci/user_tpci/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/pci/user_tpci/Makefile
@@ -1,8 +1,8 @@
 test_pci: tpci_ki.o user_tpci.o
-	gcc tpci_ki.o user_tpci.o -o test_pci
+	$(CC) tpci_ki.o user_tpci.o -o test_pci
 
 tpci_ki.o: tpci_ki.c 
-	gcc -c tpci_ki.c
+	$(CC) -c tpci_ki.c
 
 user_tpci.o: user_tpci.c
-	gcc -c user_tpci.c
+	$(CC) -c user_tpci.c
Index: ltp-full-20090131/testcases/kernel/device-drivers/tbio/user_space/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/tbio/user_space/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/tbio/user_space/Makefile
@@ -1,8 +1,8 @@
 test_bio: tbio_ki.o user_tbio.o
-	gcc -g tbio_ki.o user_tbio.o -o test_bio
+	$(CC) -g tbio_ki.o user_tbio.o -o test_bio
 
 tbio_ki.o: tbio_ki.c
-	gcc -c -g  tbio_ki.c
+	$(CC) -c -g  tbio_ki.c
 
 user_tbio.o: user_tbio.c
-	gcc -c -g user_tbio.c
+	$(CC) -c -g user_tbio.c
Index: ltp-full-20090131/testcases/kernel/device-drivers/usb/user_usb/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/device-drivers/usb/user_usb/Makefile
+++ ltp-full-20090131/testcases/kernel/device-drivers/usb/user_usb/Makefile
@@ -1,8 +1,8 @@
 test_usb: tusb_ki.o user_tusb.o
-	gcc tusb_ki.o user_tusb.o -o test_usb
+	$(CC) tusb_ki.o user_tusb.o -o test_usb
 
 tusb_ki.o: tusb_ki.c 
-	gcc -c tusb_ki.c
+	$(CC) -c tusb_ki.c
 
 user_tusb.o: user_tusb.c
-	gcc -c user_tusb.c
+	$(CC) -c user_tusb.c
Index: ltp-full-20090131/testcases/kernel/fs/fs-bench/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/fs/fs-bench/Makefile
+++ ltp-full-20090131/testcases/kernel/fs/fs-bench/Makefile
@@ -6,13 +6,13 @@ all: ${EXECS}
 	@echo done
 
 cr: create-files.o ${UTILS}
-	gcc ${UTILS} create-files.o -lm -o cr
+	$(CC) ${UTILS} create-files.o -lm -o cr
 
 ra: random-access.o
-	gcc random-access.o -o ra
+	$(CC) random-access.o -o ra
 
 radc: random-del-create.o ${UTILS}
-	gcc  ${UTILS} random-del-create.o -lm -o radc
+	$(CC)  ${UTILS} random-del-create.o -lm -o radc
 
 install:
 	 @set -e; for i in $(EXECS) $(SCRIPTS); do ln -f $$i ../../../bin/$$i ; done
Index: ltp-full-20090131/testcases/kernel/fs/scsi/ltpfs/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/fs/scsi/ltpfs/Makefile
+++ ltp-full-20090131/testcases/kernel/fs/scsi/ltpfs/Makefile
@@ -15,7 +15,7 @@ PWD	:= $(shell pwd)
 
 default:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-	gcc  $(CFLAGS) -o ltpfstest -lm  main.c 
+	$(CC)  $(CFLAGS) -o ltpfstest -lm  main.c 
 #	$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules
 endif
 
Index: ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile
+++ ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile
@@ -7,9 +7,9 @@ TARGETS   := ht_affinity
 all: $(TARGETS)
 
 #ht_affinity: HTaffinity.o HTutils.o
-#	gcc -o ht_affinity HTaffinity.o HTutils.o $(CFLAGS) $(LOADLIBES)
+#	$(CC) -o ht_affinity HTaffinity.o HTutils.o $(CFLAGS) $(LOADLIBES)
 ht_affinity:
-	gcc -o ht_affinity HTaffinity.c HTutils.c $(CFLAGS) $(LOADLIBES)
+	$(CC) -o ht_affinity HTaffinity.c HTutils.c $(CFLAGS) $(LOADLIBES)
 
 install:
 	@set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done
Index: ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile
+++ ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile
@@ -7,7 +7,7 @@ TARGETS  := ht_enabled
 all: $(TARGETS)
 
 ht_enabled:
-	gcc -o ht_enabled HTenabled.c HTutils.c $(CFLAGS) $(LOADLIBES)
+	$(CC) -o ht_enabled HTenabled.c HTutils.c $(CFLAGS) $(LOADLIBES)
 
 install:
 	@set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done
Index: ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile
===================================================================
--- ltp-full-20090131.orig/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile
+++ ltp-full-20090131/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile
@@ -7,7 +7,7 @@ TARGETS = ht_interrupt
 all: $(TARGETS)
 
 ht_interrupt:
-	gcc -o ht_interrupt HTinterrupt.c HTutils.c $(CFLAGS) $(LOADLIBES) 
+	$(CC) -o ht_interrupt HTinterrupt.c HTutils.c $(CFLAGS) $(LOADLIBES) 
 
 install:
 	@set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done
Index: ltp-full-20090131/lib/Makefile
===================================================================
--- ltp-full-20090131.orig/lib/Makefile
+++ ltp-full-20090131/lib/Makefile
@@ -1,6 +1,3 @@
-
-PREFIX=/opt/ltp
-
 CFLAGS+= -Wall
 CFLAGS+= -D_USC_LIB_
 CPPFLAGS+= -I../include 
Index: ltp-full-20090131/m4/GNUmakefile
===================================================================
--- ltp-full-20090131.orig/m4/GNUmakefile
+++ ltp-full-20090131/m4/GNUmakefile
@@ -1,6 +1,3 @@
-
-
-PREFIX=/opt/ltp
 M4MACROS=$(notdir $(wildcard *.m4))
 
 all:
Index: ltp-full-20090131/pan/Makefile
===================================================================
--- ltp-full-20090131.orig/pan/Makefile
+++ ltp-full-20090131/pan/Makefile
@@ -1,8 +1,6 @@
-
 LOADLIBES += -lm
 LFLAGS += -l -w
 CFLAGS += -w 
-PREFIX = /opt/ltp
 
 all: pan bump scanner