Removed offending flags for Chromium

Removed flags and verified Linux build / execution still works properly.

Change-Id: Ibad4ec5d1b89d8e9b826c57bf2d6dbd0d18b7a2e
Reviewed-on: https://swiftshader-review.googlesource.com/9812
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index bfd68e2..694942a 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -39,7 +39,7 @@
     cflags = [
       "-std=c++11",
       "-Wall",
-      "-fexceptions",
+      "-fno-exceptions",
       "-fno-operator-names",
     ]
 
@@ -59,7 +59,6 @@
         "-ffunction-sections",
         "-fdata-sections",
         "-fomit-frame-pointer",
-        "-O2",
         "-Os",
       ]
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d67476e..9bea271 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,7 +137,7 @@
 else()
     set_cpp_flag("--std=c++11")
     set_cpp_flag("-Wall")
-    set_cpp_flag("-fexceptions")
+    set_cpp_flag("-fno-exceptions")
 
     # Don't allow symbols to be overridden by another module.
     # This enables libGLES_CM and libGLESv2 to statically link LLVM.
@@ -167,9 +167,8 @@
     set_cpp_flag("-s" RELEASE)
 
     # For distribution it is more important to be slim than super optimized
-    # so even in Release we use only -O2
-    set_cpp_flag("-O2 -Os" RELEASE)
-    set_cpp_flag("-O2 -Os" RELWITHDEBINFO)
+    set_cpp_flag("-Os" RELEASE)
+    set_cpp_flag("-Os" RELWITHDEBINFO)
 
     set_cpp_flag("-DNDEBUG" RELEASE)
     set_cpp_flag("-DNDEBUG" RELWITHDEBINFO)