Subzero makefile changes for linking a static llvm2ice nexe w/ LLVM build sys.
Need to list more dependencies, otherwise the static
link fails. The current unsandboxed build is a shared build
which uses libLLVM-3.*.so.
Also mess with the CXXFlags a bit. The current pnacl-llc
nexe build uses O3, but that triggers a method pointer bug:
https://code.google.com/p/nativeclient/issues/detail?id=3857,
so override that with O2. We may just want to change the
pnacl-llc build as well (maybe use Os), but I don't
know of the performance implications right now.
Use gnu++11, because of newlib + libc++.
Toggle the feature flags to be a MINIMAL build when
building the sandboxed translator w/ the LLVM-based
Makefile.
Goes with build script change https://codereview.chromium.org/945473003/
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3857
R=dschuff@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/937283002
diff --git a/Makefile b/Makefile
index 2e92992..7e1bed9 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,19 @@
# Include LLVM common makefile.
include $(LEVEL)/Makefile.common
-CXX.Flags += -std=c++11
+# -O3 seems to trigger the following PNaCl ABI transform bug
+# on method pointers, so override that with -O2:
+# https://code.google.com/p/nativeclient/issues/detail?id=3857
+CXX.Flags += -O2
+# Newlib paired with libc++ requires gnu.
+CXX.Flags += -std=gnu++11
-CPP.Defines += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \
- -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 \
- -DALLOW_MINIMAL_BUILD=0
-
+ifeq ($(PNACL_BROWSER_TRANSLATOR),1)
+ CPP.Defines += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \
+ -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 \
+ -DALLOW_MINIMAL_BUILD=1
+else
+ CPP.Defines += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \
+ -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 \
+ -DALLOW_MINIMAL_BUILD=0
+endif