Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / spec2k / Makefile.common
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 ######################################################################
6 # CONFIG
7 ######################################################################
8
9 # NOTE: we assume you have a symlink "CLIENT" in this directory pointing
10 #       to your .../native_client directory
11
12 ifndef SCONS_BUILD_PLATFORM
13 SCONS_BUILD_PLATFORM="scons_build_platform_undefined"
14 endif
15
16 ifndef BUILD_ARCH_SHORT
17 BUILD_ARCH_SHORT="build_arch_short_undefined"
18 endif
19
20 TC_ROOT=../../../toolchain
21 TOOLCHAIN_BASE=$(TC_ROOT)/$(SCONS_BUILD_PLATFORM)_$(BUILD_ARCH_SHORT)
22
23 NNACL_GLIBC_ROOT=$(TOOLCHAIN_BASE)/nacl_$(BUILD_ARCH_SHORT)_glibc
24 NNACL_NEWLIB_ROOT=$(TOOLCHAIN_BASE)/nacl_$(BUILD_ARCH_SHORT)_newlib
25
26 NNACL_NEWLIB_SDK32=../../../scons-out/nacl-x86-32
27 NNACL_NEWLIB_SDK64=../../../scons-out/nacl-x86-64
28
29 PNACL_ROOT=$(TOOLCHAIN_BASE)/pnacl_newlib
30 PNACL_TRANSLATOR_ROOT=$(TOOLCHAIN_BASE)/pnacl_translator
31 ARM_ROOT=$(TOOLCHAIN_BASE)/arm_trusted
32
33 CFLAGS = $(CFLAGS_EXTRA)
34
35 ######################################################################
36 .PHONY = clean
37
38 .SUFFIXES : .c .cc .o .bc
39
40 ######################################################################
41 # Measurement tools
42
43 ######################################################################
44 # Enable timing and size measurements by invoking the makefile with:
45 # measureit=1, PERF_LOGGER=<script_path>, COMPILE_REPEATER=<script_path>
46 ######################################################################
47
48 ifeq ($(measureit),1)
49 REPETITIONS ?= 1
50 # Times how long it took to translate to a file, and repeats N times
51 # writing the result to $@.compile_time. Note $@ corresponds to $@ from
52 # whichever Make rule that this is embedded into.
53 TIME_TRANSLATE=$(COMPILE_REPEATER) $(REPETITIONS) $@
54 # Calculate user+sys time for generating executable $(1) for benchmark $(2)
55 # Assumes the following format for name of $(1):  $(2)."setup_identifier"
56 # examples of "setup_identifier": nacl.opt.x8664, pnacl_translator.x8664, ...
57 # Assumes time is logged to a file with name $(1).compile_time
58 LOG_TRANSLATE_TIME=(TIME_FILE="$(1).compile_time" && \
59          FILE_TYPE=$(subst $(2).,,$(1)) && \
60          $(PERF_LOGGER) LogRealTime $$TIME_FILE "compiletime" $(2) $$FILE_TYPE)
61 else
62 # Set the various operations to nops
63 TIME_TRANSLATE=
64 LOG_TRANSLATE_TIME=true
65 endif
66
67 ifeq ($(measureit),1)
68 # Check gzipped size of file $(1) for benchmark $(2)
69 # Assumes the following format for name of $(1):  $(2)."setup_identifier"
70 # examples of "setup_identifier": nacl.opt.x8664, opt.prelinked.bc, ...
71 LOG_ZIP_SIZE=(FILE_TYPE=$(subst $(2).,,$(1)) && \
72         $(PERF_LOGGER) LogGzippedSize $(1) "transfersize" $(2) $$FILE_TYPE)
73 else
74 LOG_ZIP_SIZE=true
75 endif
76
77 ifeq ($(measureit),1)
78 # Measure both translation time and size of resulting file.
79 LOG_TIME_AND_SIZE=$(call LOG_TRANSLATE_TIME,$(1),$(2)) && \
80         $(call LOG_ZIP_SIZE,$(1),$(2))
81 else
82 LOG_TIME_AND_SIZE=true
83 endif
84
85
86 ######################################################################
87
88 clean:
89         rm -f -- *.pexe *.bc *.o *.s *.x86 *.arm  *.c~ .h~ \
90               *.html *.data \
91               $(IT) $(IT).* *.out src/*bc $(EXTRA_CLEAN)
92
93
94 pnacl_bin: $(IT).pnacl.arm $(IT).pnacl.opt.arm \
95            $(IT).pnacl.x8632 $(IT).pnacl.opt.x8632 \
96            $(IT).pnacl.x8664 $(IT).pnacl.opt.x8664
97
98 nacl_bin: $(IT).nacl.x8632 $(IT).nacl.opt.x8632 \
99           $(IT).nacl.x8664 $(IT).nacl.opt.x8664
100
101 nosfi_bin: $(IT).gcc.x8632 $(IT).gcc.opt.x8632 \
102            $(IT).gcc.arm $(IT).gcc.opt.arm
103
104 nosfillvm_bin: $(IT).llvm.x8632 $(IT).llvm.opt.x8632 \
105                $(IT).llvm.hw.arm $(IT).llvm.opt.hw.arm
106
107 all: pnacl_bin nacl_bin nosfi_bin nosfillvm_bin
108
109
110 ######################################################################
111 ## NON-SANDBOXING GCC TOOLCHAINS
112 ######################################################################
113 LOCAL_GCC=/usr/bin/gcc
114 EMCCFLAGS=-s ASM_JS=1 -s TOTAL_MEMORY=268435456 $(CFLAGS_EXTRA)
115 # Note: emcc should be in $PATH, or LOCAL_EMCC can be set to
116 # the location of emcc.
117 LOCAL_EMCC=emcc
118
119 # straight x86-32 gcc
120 $(IT).gcc.x8632: $(SRC) $(CPPSRC)
121         $(LOCAL_GCC) -O0 -m32 $(CFLAGS) $^ -static -lstdc++ -lm  -o $@
122         @$(call LOG_ZIP_SIZE,$@,$(IT))
123
124 # optimized x86-32 gcc
125 $(IT).gcc.opt.x8632: $(SRC) $(CPPSRC)
126         $(LOCAL_GCC) -O3 -m32 $(CFLAGS) $^ -static -lstdc++ -lm  -o $@
127         @$(call LOG_ZIP_SIZE,$@,$(IT))
128
129
130 # straight x86-64 gcc
131 $(IT).gcc.x8664: $(SRC) $(CPPSRC)
132         $(LOCAL_GCC) -O0 -m64 -DSPEC_CPU2000_LP64 $(CFLAGS) \
133                 $^ -static -lstdc++ -lm  -o $@
134         @$(call LOG_ZIP_SIZE,$@,$(IT))
135
136 # optimized x86-64 gcc
137 $(IT).gcc.opt.x8664: $(SRC) $(CPPSRC)
138         $(LOCAL_GCC) -O3 -m64 -DSPEC_CPU2000_LP64 $(CFLAGS) \
139                 $^ -static -lstdc++ -lm  -o $@
140         @$(call LOG_ZIP_SIZE,$@,$(IT))
141
142 # Emscripten javascript/html generation for Asm.js
143 # Sadly, we have to build two versions -- one for "ref" and one for "train" --
144 # due to the way Emscripten packages data files.
145 # It will actually create .emcc.ref.html and .emcc.train.html files
146 $(IT).emcc.html: $(SRC) $(CPPSRC)
147         ../prepare_input.py -v --config $(SPEC_COMPONENT) train
148         $(LOCAL_EMCC) -O2 -m32 $(CFLAGS) \
149                 $(EMCCFLAGS) $(EMCCFLAGS_EXTRA_TRAIN) $^ \
150                 -static -lstdc++ -lm -o $@.train.html
151         ../fixup_asmjs.py $@.train.html
152         ../prepare_input.py -v --config $(SPEC_COMPONENT) ref
153         $(LOCAL_EMCC) -O2 -m32 $(CFLAGS) \
154                 $(EMCCFLAGS) $(EMCCFLAGS_EXTRA_REF) $^ \
155                 -static -lstdc++ -lm  -o $@.ref.html
156         ../fixup_asmjs.py $@.ref.html
157         touch $@
158
159 ######################################################################
160 ## NON-SANDBOXING LLVM TOOLCHAINS
161 ######################################################################
162 LOCAL_LLVM=clang++
163
164 # straight x86-32 llvm
165 $(IT).llvm.x8632: $(SRC) $(CPPSRC)
166         $(LOCAL_LLVM) -O0 -m32 $(CFLAGS) $^ -static -o $@
167         @$(call LOG_ZIP_SIZE,$@,$(IT))
168
169 # optimized x86-32 llvm
170 $(IT).llvm.opt.x8632: $(SRC) $(CPPSRC)
171         $(LOCAL_LLVM) -O3 -m32 $(CFLAGS) $^ -static -o $@
172         @$(call LOG_ZIP_SIZE,$@,$(IT))
173
174
175 # straight x86-64 llvm
176 $(IT).llvm.x8664: $(SRC) $(CPPSRC)
177         $(LOCAL_LLVM) -O0 -m64 -DSPEC_CPU2000_LP64 $(CFLAGS) \
178                 $^ -static -o $@
179         @$(call LOG_ZIP_SIZE,$@,$(IT))
180
181 # optimized x86-64 llvm
182 $(IT).llvm.opt.x8664: $(SRC) $(CPPSRC)
183         $(LOCAL_LLVM) -O3 -m64 -DSPEC_CPU2000_LP64 $(CFLAGS) \
184                 $^ -static -o $@
185         @$(call LOG_ZIP_SIZE,$@,$(IT))
186
187 # straight ARM llvm
188 $(IT).llvm.hw.arm: $(SRC) $(CPPSRC)
189         $(LOCAL_LLVM) -O0 $(CFLAGS) \
190                 $^ -static -o $@
191         @$(call LOG_ZIP_SIZE,$@,$(IT))
192
193 # optimized ARM llvm
194 $(IT).llvm.opt.hw.arm: $(SRC) $(CPPSRC)
195         $(LOCAL_LLVM) -O3 $(CFLAGS) \
196                 $^ -static -o $@
197         @$(call LOG_ZIP_SIZE,$@,$(IT))
198
199 ######################################################################
200 # EXPERIMENTAL
201 # this is only for testing within an artificial CrOS hook for ARM/thumb2
202 # BUG=http://code.google.com/p/chromium/issues/detail?id=61695
203 # BUG=http://code.google.com/p/chromium/issues/detail?id=38909
204 # BUG=http://code.google.com/p/nativeclient/issues/detail?id=135
205 #########################################################################
206
207 ifndef ARM_GCC
208 ARM_GCC = arm-linux-gnueabi-gcc
209 endif
210
211 ifndef ARM_ARCH_FLAGS
212 ARM_ARCH_FLAGS = -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -marm
213 endif
214
215 ifndef ARM_LINK_FLAGS
216 ARM_LINK_FLAGS = -lstdc++ -lm -static
217 endif
218
219 # straight arm gcc
220 $(IT).gcc.arm: $(SRC) $(CPPSRC)
221         $(ARM_GCC) -O0 $(CFLAGS) $^ $(ARM_ARCH_FLAGS) $(ARM_LINK_FLAGS) -o $@
222         @$(call LOG_ZIP_SIZE,$@,$(IT))
223
224 # optimized arm gcc
225 $(IT).gcc.opt.arm: $(SRC) $(CPPSRC)
226         $(ARM_GCC) -O3 $(CFLAGS) $^ $(ARM_ARCH_FLAGS) $(ARM_LINK_FLAGS) -o $@
227         @$(call LOG_ZIP_SIZE,$@,$(IT))
228
229 ######################################################################
230 ## NACL-GCC TOOLCHAINS
231 ######################################################################
232 NACL_GCC=$(NNACL_GLIBC_ROOT)/bin/x86_64-nacl-gcc
233 NACL_GCC_NEWLIB32=$(NNACL_NEWLIB_ROOT)/bin/x86_64-nacl-gcc \
234                   -B $(NNACL_NEWLIB_SDK32)/lib \
235                   -I $(NNACL_NEWLIB_SDK32)/include
236 NACL_GCC_NEWLIB64=$(NNACL_NEWLIB_ROOT)/bin/x86_64-nacl-gcc \
237                   -B $(NNACL_NEWLIB_SDK64)/lib \
238                   -I $(NNACL_NEWLIB_SDK64)/include
239
240 # nacl x86 gcc
241 $(IT).nacl.x8632: $(SRC) $(CPPSRC)
242         $(NACL_GCC_NEWLIB32) -O0 -m32 $(CFLAGS) $^ -static -lstdc++ -lm -o $@
243         @$(call LOG_ZIP_SIZE,$@,$(IT))
244
245 # nacl optimized x86 gcc
246 $(IT).nacl.opt.x8632: $(SRC) $(CPPSRC)
247         $(NACL_GCC_NEWLIB32) -O3 -m32 $(CFLAGS) $^ -static -lstdc++ -lm -o $@
248         @$(call LOG_ZIP_SIZE,$@,$(IT))
249
250 # nacl x86 gcc, dynamic
251 $(IT).nacl.dyn.x8632: $(SRC) $(CPPSRC)
252         $(NACL_GCC) -O0 -m32 $(CFLAGS) -fPIC -g $^ -lstdc++ -lm -o $@
253         @$(call LOG_ZIP_SIZE,$@,$(IT))
254
255 # nacl optimized x86 gcc, dynamic
256 $(IT).nacl.dyn.opt.x8632: $(SRC) $(CPPSRC)
257         $(NACL_GCC) -O3 -m32 $(CFLAGS) -fPIC -g $^ -lstdc++ -lm -o $@
258         @$(call LOG_ZIP_SIZE,$@,$(IT))
259
260 # nacl x86-64 gcc
261 $(IT).nacl.x8664: $(SRC) $(CPPSRC)
262         $(NACL_GCC_NEWLIB64) -O0 -m64 $(CFLAGS) $^  -static -lstdc++ -lm -o $@
263         @$(call LOG_ZIP_SIZE,$@,$(IT))
264
265 # nacl optimized x86-64 gcc
266 $(IT).nacl.opt.x8664: $(SRC) $(CPPSRC)
267         $(NACL_GCC_NEWLIB64) -O3 -m64 $(CFLAGS) $^  -static -lstdc++ -lm -o $@
268         @$(call LOG_ZIP_SIZE,$@,$(IT))
269
270 # nacl x86-64 gcc, dynamic
271 $(IT).nacl.dyn.x8664: $(SRC) $(CPPSRC)
272         $(NACL_GCC) -O0 -m64 $(CFLAGS) -fPIC -g $^ -lstdc++ -lm -o $@
273         @$(call LOG_ZIP_SIZE,$@,$(IT))
274
275 # nacl optimized x86-64 gcc, dynamic
276 $(IT).nacl.dyn.opt.x8664: $(SRC) $(CPPSRC)
277         $(NACL_GCC) -O3 -m64 $(CFLAGS) -fPIC -g $^ -lstdc++ -lm -o $@
278         @$(call LOG_ZIP_SIZE,$@,$(IT))
279
280 ######################################################################
281 ## BITCODE TOOLCHAINS
282 ######################################################################
283 # BITCODE - FRONTEND
284
285 ifdef NACL_ENABLE_INSECURE_ZERO_BASED_SANDBOX
286 EXTRA_TRANSLATOR_FLAGS=-sfi-zero-based-sandbox
287 else
288 EXTRA_TRANSLATOR_FLAGS=
289 endif
290
291 PNACL_TRANSLATOR_FLAGS_FAST=-translate-fast
292
293 PNACL_BIN=$(PNACL_ROOT)/bin
294 # Sandboxed translation uses the standalone translator install (which only
295 # supports sandboxed translation). This allows it to run on the arm hardware
296 # bots, which have no native toolchain build.
297 PNACL_TRANSLATOR=$(TIME_TRANSLATE) $(PNACL_BIN)/pnacl-translate \
298   $(EXTRA_TRANSLATOR_FLAGS)
299 PNACL_TRANSLATOR_SB=$(TIME_TRANSLATE) \
300   $(PNACL_TRANSLATOR_ROOT)/bin/pnacl-translate --pnacl-sb
301 PNACL_TRANSLATOR_SB_EMU=$(PNACL_TRANSLATOR_SB) --pnacl-use-emulator \
302   $(EXTRA_TRANSLATOR_FLAGS)
303 PNACL_CC=$(PNACL_BIN)/pnacl-clang
304 PNACL_CXX=$(PNACL_BIN)/pnacl-clang++
305 PNACL_FINALIZE=$(PNACL_BIN)/pnacl-finalize
306 PNACL_FLAGS=--pnacl-driver-verbose
307
308 PNACL_FLAGS_COMMON=$(PNACL_FLAGS) $(CFLAGS)
309
310 %.bc: %.c
311         $(PNACL_CC) -O0 $(PNACL_FLAGS_COMMON) $< -c -o $@
312 %.bc: %.cc
313         $(PNACL_CXX) -O0 $(PNACL_FLAGS_COMMON) $< -c -o $@
314
315 %.o3.bc: %.c
316         $(PNACL_CC) -O3 $(PNACL_FLAGS_COMMON) $< -c -o $@
317 %.o3.bc: %.cc
318         $(PNACL_CXX) -O3 $(PNACL_FLAGS_COMMON) $< -c -o $@
319
320 $(IT).unopt.pexe: $(SRC:%.c=%.bc) $(CPPSRC:%.cc=%.bc)
321         $(PNACL_CXX) -O0  $(PNACL_FLAGS_COMMON) $^ -static -lm -o $@
322         @$(call LOG_ZIP_SIZE,$@,$(IT))
323
324 $(IT).unopt.stripped.pexe: $(IT).unopt.pexe
325         $(PNACL_FINALIZE) $^ -o $@
326         @$(call LOG_ZIP_SIZE,$@,$(IT))
327
328 $(IT).opt.pexe: $(SRC:%.c=%.o3.bc) $(CPPSRC:%.cc=%.o3.bc)
329         $(PNACL_CXX) -O3 $(PNACL_FLAGS_COMMON) $^ -static -lm -o $@
330         @$(call LOG_ZIP_SIZE,$@,$(IT))
331
332 $(IT).opt.stripped.pexe: $(IT).opt.pexe
333         $(PNACL_FINALIZE) $^ -o $@
334         @$(call LOG_ZIP_SIZE,$@,$(IT))
335
336 ######################################################################
337 # BITCODE - BACKEND - ARM  (sandboxed and non-sandboxed translators)
338
339 $(IT).pnacl.arm: $(IT).unopt.stripped.pexe
340         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch arm
341         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
342
343 $(IT).pnacl.opt.arm: $(IT).opt.stripped.pexe
344         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch arm
345         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
346
347 $(IT).pnacl_translator.arm: $(IT).unopt.stripped.pexe
348         $(PNACL_TRANSLATOR_SB_EMU) $(PNACL_FLAGS) $^ -o $@ -arch arm
349         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
350
351 $(IT).pnacl_translator.opt.arm: $(IT).opt.stripped.pexe
352         $(PNACL_TRANSLATOR_SB_EMU) $(PNACL_FLAGS) $^ -o $@ -arch arm
353         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
354
355 $(IT).pnacl_translator_fast.opt.arm: $(IT).opt.stripped.pexe
356         $(PNACL_TRANSLATOR_SB_EMU) $(PNACL_FLAGS) \
357           $(PNACL_TRANSLATOR_FLAGS_FAST) $^ -o $@ -arch arm
358         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
359
360
361 # For arm translator testing, the pexes are built on x86 and copied to the
362 # arm boards, but the intermediate .bc files are removed to keep the transfer
363 # small. To keep make from trying to rebuild the pexe, use a phony target
364 # with no dependencies
365 $(IT).pnacl_translator.hw.arm:
366         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(IT).unopt.stripped.pexe \
367          -o $@ -arch arm
368         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
369
370 $(IT).pnacl_translator.opt.hw.arm:
371         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(IT).opt.stripped.pexe \
372          -o $@ -arch arm
373         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
374
375 $(IT).pnacl_translator_fast.opt.hw.arm:
376         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(IT).opt.stripped.pexe \
377          $(PNACL_TRANSLATOR_FLAGS_FAST) -o $@ -arch arm
378         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
379
380 $(IT).pnacl_translator_1thread.opt.hw.arm:
381         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(IT).opt.stripped.pexe \
382          -o $@ -arch arm -split-module=1
383         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
384
385 $(IT).pnacl_translator_fast_1thread.opt.hw.arm:
386         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(IT).opt.stripped.pexe \
387          $(PNACL_TRANSLATOR_FLAGS_FAST) -o $@ -arch arm -split-module=1
388         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
389
390
391 .PHONY: $(IT).pnacl_translator.hw.arm
392 .PHONY: $(IT).pnacl_translator.opt.hw.arm
393 .PHONY: $(IT).pnacl_translator_fast.opt.hw.arm
394 .PHONY: $(IT).pnacl_translator_1thread.opt.hw.arm
395 .PHONY: $(IT).pnacl_translator_fast_1thread.opt.hw.arm
396
397 ######################################################################
398 # BITCODE - BACKEND - X8632 (sandboxed and non-sandboxed translators)
399
400 $(IT).pnacl.x8632: $(IT).unopt.stripped.pexe
401         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch x86-32
402         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
403
404 $(IT).pnacl.opt.x8632: $(IT).opt.stripped.pexe
405         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch x86-32
406         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
407
408 $(IT).pnacl_translator.x8632: $(IT).unopt.stripped.pexe
409         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-32
410         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
411
412 $(IT).pnacl_translator.opt.x8632: $(IT).opt.stripped.pexe
413         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-32     
414         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
415
416 $(IT).pnacl_translator_fast.opt.x8632: $(IT).opt.stripped.pexe
417         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(PNACL_TRANSLATOR_FLAGS_FAST) \
418           $^ -o $@ -arch x86-32
419         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
420
421 $(IT).pnacl_translator_1thread.opt.x8632: $(IT).opt.stripped.pexe
422         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-32 \
423           -split-module=1
424         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
425
426 $(IT).pnacl_translator_fast_1thread.opt.x8632: $(IT).opt.stripped.pexe
427         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(PNACL_TRANSLATOR_FLAGS_FAST) \
428           $^ -o $@ -arch x86-32 -split-module=1
429         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
430
431
432 ######################################################################
433 # BITCODE - BACKEND - X8664 (sandboxed and non-sandboxed translators)
434
435 $(IT).pnacl.x8664: $(IT).unopt.stripped.pexe
436         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch x86-64
437         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
438
439 $(IT).pnacl.opt.x8664: $(IT).opt.stripped.pexe
440         $(PNACL_TRANSLATOR) $(PNACL_FLAGS) $^ -o $@ -arch x86-64
441         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
442
443 $(IT).pnacl_translator.x8664: $(IT).unopt.stripped.pexe
444         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-64
445         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
446
447 $(IT).pnacl_translator.opt.x8664: $(IT).opt.stripped.pexe
448         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-64
449         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
450
451 $(IT).pnacl_translator_fast.opt.x8664: $(IT).opt.stripped.pexe
452         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(PNACL_TRANSLATOR_FLAGS_FAST) \
453           $^ -o $@ -arch x86-64
454         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
455
456 $(IT).pnacl_translator_1thread.opt.x8664: $(IT).opt.stripped.pexe
457         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $^ -o $@ -arch x86-64 \
458           -split-module=1
459         @$(call LOG_TIME_AND_SIZE,$@,$(IT))
460
461 $(IT).pnacl_translator_fast_1thread.opt.x8664: $(IT).opt.stripped.pexe
462         $(PNACL_TRANSLATOR_SB) $(PNACL_FLAGS) $(PNACL_TRANSLATOR_FLAGS_FAST) \
463           $^ -o $@ -arch x86-64 -split-module=1
464         @$(call LOG_TIME_AND_SIZE,$@,$(IT))