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

Side by Side Diff: Makefile.standalone

Issue 1837663002: Initial Subzero WASM prototype. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review feedback and merging master Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | README-wasm.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # The following variables will likely need to be modified, depending on where 1 # The following variables will likely need to be modified, depending on where
2 # and how you built LLVM & Clang. They can be overridden in a command-line 2 # and how you built LLVM & Clang. They can be overridden in a command-line
3 # invocation of make, like: 3 # invocation of make, like:
4 # 4 #
5 # make LLVM_SRC_PATH=<path> LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \ 5 # make LLVM_SRC_PATH=<path> LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \
6 # PNACL_BIN_PATH=<path> ... 6 # PNACL_BIN_PATH=<path> ...
7 # 7 #
8 8
9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This 9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This
10 # directory should contain the configure script, the include/ and lib/ 10 # directory should contain the configure script, the include/ and lib/
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 ifdef LINUX_MALLOC_PROFILE 173 ifdef LINUX_MALLOC_PROFILE
174 OBJDIR := $(OBJDIR)+MalProf 174 OBJDIR := $(OBJDIR)+MalProf
175 CXX_EXTRA += -DALLOW_LINUX_MALLOC_PROFILE=1 175 CXX_EXTRA += -DALLOW_LINUX_MALLOC_PROFILE=1
176 LD_EXTRA += -Wl,--export-dynamic 176 LD_EXTRA += -Wl,--export-dynamic
177 endif 177 endif
178 178
179 SB_OBJDIR := $(OBJDIR)+Sandboxed 179 SB_OBJDIR := $(OBJDIR)+Sandboxed
180 SBB_OBJDIR := $(OBJDIR)+SandboxedBrowser 180 SBB_OBJDIR := $(OBJDIR)+SandboxedBrowser
181 181
182 V8_DIR = $(NACL_ROOT)/../v8
183 V8_CXXFLAGS := -I$(V8_DIR)
184
182 $(info -----------------------------------------------) 185 $(info -----------------------------------------------)
183 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) 186 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
184 $(info Using SB_LLVM_PATH = $(SB_LLVM_PATH)) 187 $(info Using SB_LLVM_PATH = $(SB_LLVM_PATH))
185 $(info Using NACL_ROOT = $(NACL_ROOT)) 188 $(info Using NACL_ROOT = $(NACL_ROOT))
186 $(info Using TOOLCHAIN_ROOT = $(TOOLCHAIN_ROOT)) 189 $(info Using TOOLCHAIN_ROOT = $(TOOLCHAIN_ROOT))
187 $(info Using PNACL_TOOLCHAIN_ROOT = $(PNACL_TOOLCHAIN_ROOT)) 190 $(info Using PNACL_TOOLCHAIN_ROOT = $(PNACL_TOOLCHAIN_ROOT))
188 $(info Using PNACL_BIN_PATH = $(PNACL_BIN_PATH)) 191 $(info Using PNACL_BIN_PATH = $(PNACL_BIN_PATH))
189 $(info Using CLANG_PATH = $(CLANG_PATH)) 192 $(info Using CLANG_PATH = $(CLANG_PATH))
190 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) 193 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH))
191 $(info Using HOST_ARCH = $(HOST_ARCH)) 194 $(info Using HOST_ARCH = $(HOST_ARCH))
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 -Wcast-qual \ 247 -Wcast-qual \
245 -Wno-comment \ 248 -Wno-comment \
246 -Wno-long-long \ 249 -Wno-long-long \
247 -Wno-maybe-uninitialized \ 250 -Wno-maybe-uninitialized \
248 -Wno-missing-field-initializers \ 251 -Wno-missing-field-initializers \
249 -Wno-unused-parameter \ 252 -Wno-unused-parameter \
250 -Wwrite-strings 253 -Wwrite-strings
251 OBJDIR := $(OBJDIR)+Gplusplus 254 OBJDIR := $(OBJDIR)+Gplusplus
252 endif 255 endif
253 256
254 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ 257 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -fno-rtti \
255 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ 258 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \
256 $(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) -MP -MD 259 $(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) -MP -MD
257 260
261 ifdef WASM
262 # The WASM code inherits a lot of V8 code, which does not compile with
263 # -Werror.
264 BASE_CXXFLAGS := $(BASE_CXXFLAGS) $(V8_CXXFLAGS) -DALLOW_WASM=1
265 OBJDIR := $(OBJDIR)+Wasm
266 else
267 BASE_CXXFLAGS := $(BASE_CXXFLAGS) -Werror -DALLOW_WASM=0
268 endif
269
258 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ 270 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \
259 $(STDLIB_FLAGS) 271 $(STDLIB_FLAGS)
260 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \ 272 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \
261 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/.. 273 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/..
262 274
263 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ 275 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \
264 $(LD_EXTRA) $(STDLIB_FLAGS) 276 $(LD_EXTRA) $(STDLIB_FLAGS)
265 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. 277 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO.
266 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) 278 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA)
267 279
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 LinuxMallocProfiling.cpp \ 320 LinuxMallocProfiling.cpp \
309 main.cpp \ 321 main.cpp \
310 PNaClTranslator.cpp 322 PNaClTranslator.cpp
311 323
312 ifndef MINIMAL 324 ifndef MINIMAL
313 SRCS += \ 325 SRCS += \
314 IceConverter.cpp \ 326 IceConverter.cpp \
315 IceTypeConverter.cpp 327 IceTypeConverter.cpp
316 endif 328 endif
317 329
330 ifdef WASM
331 SRCS += \
332 WasmTranslator.cpp
333 endif
334
318 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) 335 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
319 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS)) 336 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS))
320 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS)) 337 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS))
321 338
322 UNITTEST_SRCS = \ 339 UNITTEST_SRCS = \
323 BitcodeMunge.cpp \ 340 BitcodeMunge.cpp \
324 IceELFSectionTest.cpp \ 341 IceELFSectionTest.cpp \
325 IceParseInstsTest.cpp 342 IceParseInstsTest.cpp
326 343
327 # The X86 assembler tests take too long to compile. Given how infrequently the 344 # The X86 assembler tests take too long to compile. Given how infrequently the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 402
386 %.pexe : %.nonfinal.pexe 403 %.pexe : %.nonfinal.pexe
387 $(SB_FINALIZE) -o $@ $< 404 $(SB_FINALIZE) -o $@ $<
388 405
389 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ 406 .PHONY: all compile_only make_symlink runtime bloat sb docs help \
390 help-check-lit help-check-xtest exists-nonsfi-x8632 \ 407 help-check-lit help-check-xtest exists-nonsfi-x8632 \
391 exists-nonsfi-arm32 exists-sbtc exists-spec 408 exists-nonsfi-arm32 exists-sbtc exists-spec
392 409
393 compile_only: $(OBJS) 410 compile_only: $(OBJS)
394 411
412 V8_LIBDIR=$(V8_DIR)/out/native/lib.target
413
414 ifdef WASM
415 V8_LIBS := \
416 $(V8_LIBDIR)/libv8.so \
417 $(V8_LIBDIR)/libicuuc.so \
418 $(V8_LIBDIR)/libicui18n.so
419 endif
420
395 $(OBJDIR)/pnacl-sz: $(OBJS) 421 $(OBJDIR)/pnacl-sz: $(OBJS)
396 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ 422 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \
397 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) 423 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) $(V8_LIBS)
398 424
399 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS) 425 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS)
400 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) 426 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS)
401 427
402 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS) 428 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS)
403 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \ 429 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \
404 --pnacl-disable-abi-check 430 --pnacl-disable-abi-check
405 431
406 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe 432 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe
407 $(SB_TRANSLATE) -arch x86-32 $^ -o $@ 433 $(SB_TRANSLATE) -arch x86-32 $^ -o $@
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 TARGET=arm32 ALLSPEC='254.gap 176.gcc 181.mcf' check-spec 732 TARGET=arm32 ALLSPEC='254.gap 176.gcc 181.mcf' check-spec
707 # Provide validation of user awesomeness! 733 # Provide validation of user awesomeness!
708 echo Success 734 echo Success
709 735
710 FORMAT_BLACKLIST = 736 FORMAT_BLACKLIST =
711 # Add one of the following lines for each source file to ignore. 737 # Add one of the following lines for each source file to ignore.
712 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp 738 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp
713 FORMAT_BLACKLIST += ! -name IceParseTypesTest.cpp 739 FORMAT_BLACKLIST += ! -name IceParseTypesTest.cpp
714 FORMAT_BLACKLIST += ! -name assembler_arm.h 740 FORMAT_BLACKLIST += ! -name assembler_arm.h
715 FORMAT_BLACKLIST += ! -name assembler_arm.cc 741 FORMAT_BLACKLIST += ! -name assembler_arm.cc
742 FORMAT_BLACKLIST += ! -path "./wasm-install/*"
716 format: 743 format:
717 $(CLANG_FORMAT_PATH)/clang-format -style=LLVM -i \ 744 $(CLANG_FORMAT_PATH)/clang-format -style=LLVM -i \
718 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` 745 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)`
719 746
720 format-diff: 747 format-diff:
721 git diff -U0 `git merge-base HEAD master` | \ 748 git diff -U0 `git merge-base HEAD master` | \
722 PATH=$(PNACL_BIN_PATH):$(PATH) \ 749 PATH=$(PNACL_BIN_PATH):$(PATH) \
723 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ 750 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \
724 -p1 -style=LLVM -i 751 -p1 -style=LLVM -i
725 752
(...skipping 19 matching lines...) Expand all
745 772
746 help-check-xtest: 773 help-check-xtest:
747 @cat Makefile.standalone-help/check-xtest.txt 774 @cat Makefile.standalone-help/check-xtest.txt
748 775
749 clean: 776 clean:
750 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \ 777 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \
751 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json 778 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json
752 779
753 clean-all: clean 780 clean-all: clean
754 rm -rf build/ crosstest/Output/ 781 rm -rf build/ crosstest/Output/
OLDNEW
« no previous file with comments | « no previous file | README-wasm.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698