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> LLVM_BIN_PATH=<path> \ | 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \ | 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \ |
7 # PNACL_BIN_PATH=<path> ... | 7 # PNACL_BIN_PATH=<path> ... |
8 # | 8 # |
9 | 9 |
10 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 10 # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
11 # directory should contain the configure script, the include/ and lib/ | 11 # directory should contain the configure script, the include/ and lib/ |
12 # directories of LLVM, Clang in tools/clang/, etc. | 12 # directories of LLVM, Clang in tools/clang/, etc. |
13 # Alternatively, if you're building vs. a binary download of LLVM, then | 13 # Alternatively, if you're building vs. a binary download of LLVM, then |
14 # LLVM_SRC_PATH can point to the main untarred directory. | 14 # LLVM_SRC_PATH can point to the main untarred directory. |
15 LLVM_SRC_PATH ?= ../llvm | 15 LLVM_SRC_PATH ?= ../llvm |
16 | 16 |
17 # LLVM_BIN_PATH is the directory where binaries are placed by the LLVM build | 17 # LLVM_BIN_PATH is the directory where binaries are placed by the LLVM build |
18 # process. It should contain the tools like clang, clang-format, llc, | 18 # process. It should contain the tools like clang, clang-format, llc, |
19 # llvm-as, llvm-config, llvm-mc, pnacl-bcdis, and pnacl-freeze. | 19 # llvm-as, llvm-config, llvm-mc, pnacl-bcdis, and pnacl-freeze. |
20 # It also contains developer libraries like libLLVMSupport.a. | 20 ifdef CMAKE |
21 # The default reflects a configure + make build. | 21 # LLVM cmake build |
22 LLVM_BIN_PATH ?= $(shell readlink -e \ | 22 LLVM_BIN_PATH ?= ../../out/llvm_x86_64_linux_work/bin |
23 » ../../out/llvm_x86_64_linux_work/Release+Asserts/bin) | 23 STDLIB_FLAGS = |
| 24 else |
| 25 # LLVM autoconf build |
| 26 LLVM_BIN_PATH ?= ../../out/llvm_x86_64_linux_work/Release+Asserts/bin |
| 27 STDLIB_FLAGS = -stdlib=libc++ -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
| 28 endif |
24 | 29 |
25 # The x86-32-specific sandboxed translator directory. | 30 # The x86-32-specific sandboxed translator directory. |
26 # It holds sandboxed versions of libraries and binaries. | 31 # It holds sandboxed versions of libraries and binaries. |
27 SB_LLVM_PATH ?= $(shell readlink -e \ | 32 SB_LLVM_PATH ?= $(shell readlink -e \ |
28 ../../out/sandboxed_translators_work/translator-i686/llvm-sb/Release) | 33 ../../out/sandboxed_translators_work/translator-i686/llvm-sb/Release) |
29 | 34 |
30 # NACL_ROOT is the root of the native client repository. | 35 # NACL_ROOT is the root of the native client repository. |
31 NACL_ROOT ?= $(shell python -c "import sys; sys.path.insert(0, 'pydir'); \ | 36 NACL_ROOT ?= $(shell python -c "import sys; sys.path.insert(0, 'pydir'); \ |
32 import utils; print utils.FindBaseNaCl()") | 37 import utils; print utils.FindBaseNaCl()") |
33 | 38 |
(...skipping 10 matching lines...) Expand all Loading... |
44 CLANG_PATH ?= $(shell readlink -e \ | 49 CLANG_PATH ?= $(shell readlink -e \ |
45 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) | 50 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) |
46 | 51 |
47 # LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should | 52 # LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should |
48 # contain header files and corresponding libraries. This is used for | 53 # contain header files and corresponding libraries. This is used for |
49 # building the host binaries in conjuction with clang. | 54 # building the host binaries in conjuction with clang. |
50 LIBCXX_INSTALL_PATH ?= $(PNACL_TOOLCHAIN_ROOT) | 55 LIBCXX_INSTALL_PATH ?= $(PNACL_TOOLCHAIN_ROOT) |
51 | 56 |
52 HOST_ARCH ?= x86_64 | 57 HOST_ARCH ?= x86_64 |
53 ifeq ($(HOST_ARCH),x86_64) | 58 ifeq ($(HOST_ARCH),x86_64) |
54 HOST_FLAGS = -m64 -stdlib=libc++ | 59 HOST_FLAGS = -m64 |
55 else | 60 else |
56 ifeq ($(HOST_ARCH),x86) | 61 ifeq ($(HOST_ARCH),x86) |
57 HOST_FLAGS = -m32 -stdlib=libc++ | 62 HOST_FLAGS = -m32 |
58 endif | 63 endif |
59 endif | 64 endif |
60 | 65 |
61 ifdef DEBUG | 66 ifdef DEBUG |
62 OBJDIR = build/Debug | 67 OBJDIR = build/Debug |
63 OPTLEVEL = -O0 | 68 OPTLEVEL = -O0 |
64 LINKOPTLEVEL = -O0 | 69 LINKOPTLEVEL = -O0 |
65 else | 70 else |
66 OBJDIR = build/Release | 71 OBJDIR = build/Release |
67 OPTLEVEL = -O2 -ffunction-sections -fdata-sections | 72 OPTLEVEL = -O2 -ffunction-sections -fdata-sections |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 CCACHE := `command -v ccache` | 139 CCACHE := `command -v ccache` |
135 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ | 140 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
136 SB_CXX := CCACHE_CPP2=yes $(CCACHE) $(PNACL_BIN_PATH)/pnacl-clang++ | 141 SB_CXX := CCACHE_CPP2=yes $(CCACHE) $(PNACL_BIN_PATH)/pnacl-clang++ |
137 SB_TRANSLATE := $(PNACL_BIN_PATH)/pnacl-translate | 142 SB_TRANSLATE := $(PNACL_BIN_PATH)/pnacl-translate |
138 | 143 |
139 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ | 144 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ |
140 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ | 145 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ |
141 -Wno-error=unused-parameter $(CXX_EXTRA) | 146 -Wno-error=unused-parameter $(CXX_EXTRA) |
142 | 147 |
143 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ | 148 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ |
144 » -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 | 149 » $(STDLIB_FLAGS) |
145 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(SB_CXX_DEFINES) | 150 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(SB_CXX_DEFINES) |
146 | 151 |
147 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ | 152 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ |
148 » $(LD_EXTRA) | 153 » $(LD_EXTRA) $(STDLIB_FLAGS) |
149 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. | 154 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. |
150 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) | 155 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) |
151 | 156 |
152 SRCS = \ | 157 SRCS = \ |
153 assembler.cpp \ | 158 assembler.cpp \ |
154 assembler_ia32.cpp \ | 159 assembler_ia32.cpp \ |
155 IceBrowserCompileServer.cpp \ | 160 IceBrowserCompileServer.cpp \ |
156 IceCfg.cpp \ | 161 IceCfg.cpp \ |
157 IceCfgNode.cpp \ | 162 IceCfgNode.cpp \ |
158 IceClFlags.cpp \ | 163 IceClFlags.cpp \ |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 bloat: make_symlink | 317 bloat: make_symlink |
313 nm -C -S -l pnacl-sz | \ | 318 nm -C -S -l pnacl-sz | \ |
314 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json | 319 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json |
315 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html | 320 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html |
316 | 321 |
317 clean: | 322 clean: |
318 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json | 323 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json |
319 | 324 |
320 clean-all: clean | 325 clean-all: clean |
321 rm -rf build/ | 326 rm -rf build/ |
OLD | NEW |