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

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

Issue 22766003: [NaCl SDK] Fix PNACL for debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
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 f765796ac3e9988732bca29d725333a2d87a362c..07ed90d17b7711d043f5696ca31f2f9db4a90f0b 100644
--- a/native_client_sdk/src/tools/nacl_llvm.mk
+++ b/native_client_sdk/src/tools/nacl_llvm.mk
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
Sam Clegg 2013/08/10 00:54:01 Was that deliberate? 3 spaces?
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -18,6 +18,9 @@ PNACL_LIB ?= $(PNACL_BIN)/pnacl-ar
PNACL_STRIP ?= $(PNACL_BIN)/pnacl-strip
PNACL_FINALIZE ?= $(PNACL_BIN)/pnacl-finalize
+# if you want to debug, do not use PEXE, use BC
Sam Clegg 2013/08/10 00:54:01 You mean "use NEXE"? This comment could be fill
noelallen1 2013/08/10 19:08:49 Done.
+PNACL_TRANSLATE ?= $(PNACL_BIN)/pnacl-translate
+
#
# Compile Macro
#
@@ -94,7 +97,16 @@ endef
# $6 = Other Linker Args
#
define LINKER_RULE
-all: $(1).pexe
+all: $(1).pexe
+$(1)_x86_32.nexe : $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) -arch x86-32 $$^ -o $$@)
+
+$(1)_x86_64.nexe : $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) -arch x86-64 $$^ -o $$@)
+
+$(1)_arm.nexe : $(1).bc
+ $(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) -arch arm $$^ -o $$@)
+
$(1).pexe: $(1).bc
$(call LOG,FINALIZE,$$@,$(PNACL_FINALIZE) -o $$@ $$^)
@@ -114,6 +126,11 @@ endef
# $6 = VC Linker Switches
#
define LINK_RULE
+ifeq ($(CONFIG),Debug)
+EXECUTABLES=$(OUTDIR)/$(1)_x86_32.nexe $(OUTDIR)/$(1)_x86_64.nexe $(OUTDIR)/$(1)_arm.nexe
+else
+EXECUTABLES=$(OUTDIR)/$(1).pexe
+endif
$(call LINKER_RULE,$(OUTDIR)/$(1),$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_pnacl)),$(filter-out pthread,$(3)),$(4),$(LIB_PATHS),$(5))
endef
@@ -136,6 +153,10 @@ $(OUTDIR)/$(1).pexe: $(OUTDIR)/$(2).pexe
endef
+
+EXECUTABLES=$(foreach arch,$(ARCH_SUFFIXES),$(OUTDIR)/$(1)$(arch))
+
Sam Clegg 2013/08/10 00:54:01 This variable seems to be specified twice. Does t
noelallen1 2013/08/10 19:08:49 Done.
+
#
# NMF Manifiest generation
#
@@ -151,7 +172,7 @@ NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py
define NMF_RULE
all: $(OUTDIR)/$(1).nmf
-$(OUTDIR)/$(1).nmf: $(OUTDIR)/$(1).pexe
+$(OUTDIR)/$(1).nmf: $(EXECUTABLES)
$(call LOG,CREATE_NMF,$$@,$(NMF) -o $$@ $$^ -s $(OUTDIR) $(2))
endef
@@ -162,6 +183,6 @@ CREATE_HTML := python $(NACL_SDK_ROOT)/tools/create_html.py
define HTML_RULE
all: $(OUTDIR)/$(1).html
-$(OUTDIR)/$(1).html: $(OUTDIR)/$(1).pexe
+$(OUTDIR)/$(1).html: $(EXECUTABLES)
$(call LOG,CREATE_HTML,$$@,$(CREATE_HTML) -o $$@ $$^)
endef
« native_client_sdk/src/tools/common.mk ('K') | « native_client_sdk/src/tools/common.mk ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698