Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: native_client_sdk/src/tools/nacl_llvm.mk

Issue 662683003: [NaCl SDK] Run PNaCl translate tests in sel_ldr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/resources/Makefile.library.template ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/nacl_llvm.mk
diff --git a/native_client_sdk/src/tools/nacl_llvm.mk b/native_client_sdk/src/tools/nacl_llvm.mk
index 96150233aca50790aece394f5631c8cf754fa941..c46b4d2828217ab61496b0fa80be0f00b6c65f33 100644
--- a/native_client_sdk/src/tools/nacl_llvm.mk
+++ b/native_client_sdk/src/tools/nacl_llvm.mk
@@ -16,6 +16,7 @@ PNACL_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=c++)
PNACL_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=ar)
PNACL_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=strip)
PNACL_FINALIZE := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=finalize)
+PNACL_TRANSLATE := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=translate)
#
# Compile Macro
@@ -100,6 +101,15 @@ $(1).pexe: $(1).bc
$(1).bc: $(2) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(call LOG,LINK,$$@,$(PNACL_LINK) -o $$@ $(2) $(PNACL_LDFLAGS) $(foreach path,$(5),-L$(path)/pnacl/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(6))
+
+$(1)_x86_32.nexe: $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch x86-32 $$^ -o $$@)
+
+$(1)_x86_64.nexe: $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch x86-64 $$^ -o $$@)
+
+$(1)_arm.nexe: $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch arm $$^ -o $$@)
endef
@@ -131,6 +141,15 @@ define STRIP_RULE
all: $(OUTDIR)/$(1).pexe
$(OUTDIR)/$(1).pexe: $(OUTDIR)/$(2).pexe
$(call LOG,STRIP,$$@,$(PNACL_STRIP) $$^ -o $$@)
+
+$(OUTDIR)/$(1)_x86_32.nexe: $(OUTDIR)/$(2)_x86_32.nexe
+ $(call LOG,STRIP,$$@,$(PNACL_STRIP) $$^ -o $$@)
+
+$(OUTDIR)/$(1)_x86_64.nexe: $(OUTDIR)/$(2)_x86_64.nexe
+ $(call LOG,STRIP,$$@,$(PNACL_STRIP) $$^ -o $$@)
+
+$(OUTDIR)/$(1)_arm.nexe: $(OUTDIR)/$(2)_arm.nexe
+ $(call LOG,STRIP,$$@,$(PNACL_STRIP) $$^ -o $$@)
endef
@@ -165,3 +184,18 @@ all: $(OUTDIR)/$(1).html
$(OUTDIR)/$(1).html: $(EXECUTABLES)
$(call LOG,CREATE_HTML,$$@,$(CREATE_HTML) -o $$@ $$^)
endef
+
+
+ifdef STANDALONE
+run: $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe
+ifndef NACL_ARCH
+ $(error Cannot run in sel_ldr unless $$NACL_ARCH is set)
+endif
+ $(SEL_LDR_PATH) $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS)
+
+debug: $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe
+ifndef NACL_ARCH
+ $(error Cannot run in sel_ldr unless $$NACL_ARCH is set)
+endif
+ $(SEL_LDR_PATH) -d $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS)
+endif
« no previous file with comments | « native_client_sdk/src/resources/Makefile.library.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698