Commit 68a06338 by Jan Voung

Use the installed/downloaded objdump instead of work-dir one.

Sometimes the work dir is empty and only cached results are used. I couldn't switch the LLVM one from work-dir to install/download-dir because we prune all the .a file in the download-dir. BUG=none R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/983533003
parent 22ed4eb4
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# invocation of make, like: # invocation of make, like:
# #
# make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \
# LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \
# BINUTILS_BIN_PATH=<path> ...
# #
# LLVM_SRC_PATH is the path to the root of the checked out source code. This # LLVM_SRC_PATH is the path to the root of the checked out source code. This
...@@ -14,23 +15,30 @@ ...@@ -14,23 +15,30 @@
LLVM_SRC_PATH ?= ../llvm LLVM_SRC_PATH ?= ../llvm
# LLVM_BIN_PATH is the directory where binaries are placed by the LLVM build # LLVM_BIN_PATH is the directory where binaries are placed by the LLVM build
# process. It should contain the tools like opt, llc and clang. The default # process. It should contain the tools like clang, clang-format, llc,
# reflects a debug build with autotools (configure & make). # llvm-as, llvm-config, llvm-mc, pnacl-bcdis, and pnacl-freeze.
# It also contains developer libraries like libLLVMSupport.a.
# The default reflects a configure + make build.
LLVM_BIN_PATH ?= $(shell readlink -e \ LLVM_BIN_PATH ?= $(shell readlink -e \
../../out/llvm_x86_64_linux_work/Release+Asserts/bin) ../../out/llvm_x86_64_linux_work/Release+Asserts/bin)
# LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should # PNACL_TOOLCHAIN_ROOT is the location of the PNaCl toolchain.
# contain header files and corresponding libraries # This is used as the default root for finding binutils, libcxx, etc.
LIBCXX_INSTALL_PATH ?= $(shell readlink -e \ PNACL_TOOLCHAIN_ROOT = $(shell readlink -e \
../../../toolchain/linux_x86/pnacl_newlib) ../../../toolchain/linux_x86/pnacl_newlib)
# CLANG_PATH is the location of the clang compiler to use. # CLANG_PATH is the location of the clang compiler to use for building
# the host binaries.
CLANG_PATH ?= $(shell readlink -e \ CLANG_PATH ?= $(shell readlink -e \
../../../../third_party/llvm-build/Release+Asserts/bin) ../../../../third_party/llvm-build/Release+Asserts/bin)
# The location of binutils tools (e.g., objdump). # LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should
BINUTILS_BIN_PATH ?= $(shell readlink -e \ # contain header files and corresponding libraries. This is used for
../../out/binutils_pnacl_x86_64_linux_work/binutils) # building the host binaries in conjuction with clang.
LIBCXX_INSTALL_PATH ?= $(PNACL_TOOLCHAIN_ROOT)
# The location of binutils tools (e.g., objdump) for testing.
BINUTILS_BIN_PATH ?= $(shell readlink -e $(PNACL_TOOLCHAIN_ROOT)/bin)
HOST_ARCH ?= x86_64 HOST_ARCH ?= x86_64
ifeq ($(HOST_ARCH),x86_64) ifeq ($(HOST_ARCH),x86_64)
...@@ -82,8 +90,9 @@ endif ...@@ -82,8 +90,9 @@ endif
$(info -----------------------------------------------) $(info -----------------------------------------------)
$(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
$(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH))
$(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) $(info Using PNACL_TOOLCHAIN_ROOT = $(PNACL_TOOLCHAIN_ROOT))
$(info Using CLANG_PATH = $(CLANG_PATH)) $(info Using CLANG_PATH = $(CLANG_PATH))
$(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH))
$(info Using BINUTILS_BIN_PATH = $(BINUTILS_BIN_PATH)) $(info Using BINUTILS_BIN_PATH = $(BINUTILS_BIN_PATH))
$(info Using HOST_ARCH = $(HOST_ARCH)) $(info Using HOST_ARCH = $(HOST_ARCH))
$(info -----------------------------------------------) $(info -----------------------------------------------)
...@@ -200,7 +209,7 @@ runtime: $(RT_OBJ) ...@@ -200,7 +209,7 @@ runtime: $(RT_OBJ)
$(RT_OBJ): runtime.is.built $(RT_OBJ): runtime.is.built
runtime.is.built: $(RT_SRC) runtime.is.built: $(RT_SRC)
@echo ================ Building Subzero runtime ================ @echo ================ Building Subzero runtime ================
./pydir/build-runtime.py -v ./pydir/build-runtime.py -v --pnacl-root $(PNACL_TOOLCHAIN_ROOT)
check-lit: $(OBJDIR)/pnacl-sz make_symlink check-lit: $(OBJDIR)/pnacl-sz make_symlink
LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ LLVM_BIN_PATH=$(LLVM_BIN_PATH) \
......
...@@ -37,12 +37,12 @@ def main(): ...@@ -37,12 +37,12 @@ def main():
argparser.add_argument('--verbose', '-v', dest='verbose', argparser.add_argument('--verbose', '-v', dest='verbose',
action='store_true', action='store_true',
help='Display some extra debugging output') help='Display some extra debugging output')
argparser.add_argument('--pnacl-root', dest='pnacl_root',
help='Path to PNaCl toolchain binaries.')
args = argparser.parse_args() args = argparser.parse_args()
nacl_root = FindBaseNaCl() nacl_root = FindBaseNaCl()
os.environ['PATH'] = ( os.environ['PATH'] = ('{root}/bin{sep}{path}'
'{root}/toolchain/linux_x86/pnacl_newlib/bin{sep}' + ).format(root=args.pnacl_root, sep=os.pathsep, path=os.environ['PATH'])
'{path}'
).format(root=nacl_root, sep=os.pathsep, path=os.environ['PATH'])
srcdir = ( srcdir = (
'{root}/toolchain_build/src/subzero/runtime' '{root}/toolchain_build/src/subzero/runtime'
).format(root=nacl_root) ).format(root=nacl_root)
......
...@@ -121,7 +121,7 @@ def main(): ...@@ -121,7 +121,7 @@ def main():
cmd += ['-o', asm_temp.name] cmd += ['-o', asm_temp.name]
if args.disassemble: if args.disassemble:
# Show wide instruction encodings, diassemble, and show relocs. # Show wide instruction encodings, diassemble, and show relocs.
cmd += (['&&', os.path.join(binutils_bin_path, 'objdump')] + cmd += (['&&', os.path.join(binutils_bin_path, 'le32-nacl-objdump')] +
args.dis_flags + args.dis_flags +
['-w', '-d', '-r', '-Mintel', asm_temp.name]) ['-w', '-d', '-r', '-Mintel', asm_temp.name])
......
...@@ -129,7 +129,7 @@ for tool in llvmbintools: ...@@ -129,7 +129,7 @@ for tool in llvmbintools:
tool) tool)
config.substitutions.append((tool, substitution)) config.substitutions.append((tool, substitution))
binutilsbintools = [r"\bobjdump\b",] binutilsbintools = [r"\ble32-nacl-objdump\b",]
for tool in binutilsbintools: for tool in binutilsbintools:
# The re.sub() line is adapted from one of LLVM's lit.cfg files. # The re.sub() line is adapted from one of LLVM's lit.cfg files.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
; Add a run that shows relocations in code inline. ; Add a run that shows relocations in code inline.
; RUN: %p2i -i %s --filetype=obj --args -O2 --verbose none -o %t \ ; RUN: %p2i -i %s --filetype=obj --args -O2 --verbose none -o %t \
; RUN: && objdump -w -d -r -Mintel %t \ ; RUN: && le32-nacl-objdump -w -d -r -Mintel %t \
; RUN: | FileCheck --check-prefix=TEXT-RELOCS %s ; RUN: | FileCheck --check-prefix=TEXT-RELOCS %s
; Use intrinsics to test external calls. ; Use intrinsics to test external calls.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment