Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 = ../../../../v8 | |
|
Jim Stichnoth
2016/04/01 01:46:43
Yikes.
Can this be specified in terms of $(NACL_R
Eric Holk
2016/04/01 19:15:01
Done.
| |
| 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 Loading... | |
| 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 ifndef WASM | |
| 262 # The WASM code inherits a lot of V8 code, which does not compile with | |
| 263 # -Werror. | |
| 264 BASE_CXXFLAGS := $(BASE_CXXFLAGS) -Werror | |
| 265 endif | |
| 266 | |
| 258 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ | 267 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ |
| 259 $(STDLIB_FLAGS) | 268 $(STDLIB_FLAGS) |
| 260 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \ | 269 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \ |
| 261 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/.. | 270 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/.. |
| 262 | 271 |
| 272 ifdef WASM | |
| 273 CXXFLAGS := $(CXXFLAGS) $(V8_CXXFLAGS) -DALLOW_WASM=1 | |
|
Jim Stichnoth
2016/04/01 01:46:43
also, something like:
OBJDIR := $(OBJDIR)+Wasm
Eric Holk
2016/04/01 19:15:01
Done.
| |
| 274 else | |
| 275 CXXFLAGS := $(CXXFLAGS) $(V8_CXXFLAGS) -DALLOW_WASM=0 | |
| 276 endif | |
| 277 | |
| 263 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ | 278 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ |
| 264 $(LD_EXTRA) $(STDLIB_FLAGS) | 279 $(LD_EXTRA) $(STDLIB_FLAGS) |
| 265 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. | 280 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. |
| 266 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) | 281 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) |
| 267 | 282 |
| 268 # List the target-specific source files first, which generally take longer to | 283 # List the target-specific source files first, which generally take longer to |
| 269 # compile, in the hope of improving parallel build time. | 284 # compile, in the hope of improving parallel build time. |
| 270 SRCS = \ | 285 SRCS = \ |
| 271 IceAssemblerARM32.cpp \ | 286 IceAssemblerARM32.cpp \ |
| 272 IceInstARM32.cpp \ | 287 IceInstARM32.cpp \ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 LinuxMallocProfiling.cpp \ | 323 LinuxMallocProfiling.cpp \ |
| 309 main.cpp \ | 324 main.cpp \ |
| 310 PNaClTranslator.cpp | 325 PNaClTranslator.cpp |
| 311 | 326 |
| 312 ifndef MINIMAL | 327 ifndef MINIMAL |
| 313 SRCS += \ | 328 SRCS += \ |
| 314 IceConverter.cpp \ | 329 IceConverter.cpp \ |
| 315 IceTypeConverter.cpp | 330 IceTypeConverter.cpp |
| 316 endif | 331 endif |
| 317 | 332 |
| 333 ifdef WASM | |
| 334 SRCS += \ | |
| 335 WasmTranslator.cpp | |
| 336 endif | |
| 337 | |
| 318 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 338 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
| 319 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS)) | 339 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS)) |
| 320 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS)) | 340 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS)) |
| 321 | 341 |
| 322 UNITTEST_SRCS = \ | 342 UNITTEST_SRCS = \ |
| 323 BitcodeMunge.cpp \ | 343 BitcodeMunge.cpp \ |
| 324 IceELFSectionTest.cpp \ | 344 IceELFSectionTest.cpp \ |
| 325 IceParseInstsTest.cpp | 345 IceParseInstsTest.cpp |
| 326 | 346 |
| 327 # The X86 assembler tests take too long to compile. Given how infrequently the | 347 # 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 Loading... | |
| 385 | 405 |
| 386 %.pexe : %.nonfinal.pexe | 406 %.pexe : %.nonfinal.pexe |
| 387 $(SB_FINALIZE) -o $@ $< | 407 $(SB_FINALIZE) -o $@ $< |
| 388 | 408 |
| 389 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ | 409 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ |
| 390 help-check-lit help-check-xtest exists-nonsfi-x8632 \ | 410 help-check-lit help-check-xtest exists-nonsfi-x8632 \ |
| 391 exists-nonsfi-arm32 exists-sbtc exists-spec | 411 exists-nonsfi-arm32 exists-sbtc exists-spec |
| 392 | 412 |
| 393 compile_only: $(OBJS) | 413 compile_only: $(OBJS) |
| 394 | 414 |
| 415 V8_LIBDIR=$(V8_DIR)/out/native/lib.target | |
| 416 | |
| 417 ifdef WASM | |
| 418 V8_LIBS := \ | |
| 419 $(V8_LIBDIR)/libv8.so \ | |
| 420 $(V8_LIBDIR)/libicuuc.so \ | |
| 421 $(V8_LIBDIR)/libicui18n.so | |
| 422 endif | |
| 423 | |
| 395 $(OBJDIR)/pnacl-sz: $(OBJS) | 424 $(OBJDIR)/pnacl-sz: $(OBJS) |
| 396 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ | 425 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
| 397 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 426 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) $(V8_LIBS) |
| 398 | 427 |
| 399 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS) | 428 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS) |
| 400 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) | 429 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) |
| 401 | 430 |
| 402 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS) | 431 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS) |
| 403 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \ | 432 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \ |
| 404 --pnacl-disable-abi-check | 433 --pnacl-disable-abi-check |
| 405 | 434 |
| 406 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe | 435 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe |
| 407 $(SB_TRANSLATE) -arch x86-32 $^ -o $@ | 436 $(SB_TRANSLATE) -arch x86-32 $^ -o $@ |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 744 | 773 |
| 745 help-check-xtest: | 774 help-check-xtest: |
| 746 @cat Makefile.standalone-help/check-xtest.txt | 775 @cat Makefile.standalone-help/check-xtest.txt |
| 747 | 776 |
| 748 clean: | 777 clean: |
| 749 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \ | 778 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \ |
| 750 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json | 779 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json |
| 751 | 780 |
| 752 clean-all: clean | 781 clean-all: clean |
| 753 rm -rf build/ crosstest/Output/ | 782 rm -rf build/ crosstest/Output/ |
| OLD | NEW |