Index: Makefile |
diff --git a/Makefile b/Makefile |
index 2e929922f1f4a33812550d42259a1f7f11c32f3d..7e1bed98a6be81f28c68945b7d123e454c4a12f6 100644 |
--- a/Makefile |
+++ b/Makefile |
@@ -12,9 +12,19 @@ LEVEL := $(SUBZERO_LEVEL)/../.. |
# Include LLVM common makefile. |
include $(LEVEL)/Makefile.common |
-CXX.Flags += -std=c++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 |
+# -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 |
+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 |