Sync flags from `CMakeLists.txt` to `util/util.bzl`.

This currently uses only flags from the non-`MSVC` case, and adds the
following flags:

- `-Wnon-virtual-dtor`
- `-Wtype-limits`
- `-Wvla`

NOT including; with bazel this one generally has to be set in the root
project of whatever wants to embed BoringSSL:

- `-fvisibility=hidden`

Also, sorted the flags in each `CMakeLists.txt` definition
alphabetically to allow easier comparison between the two.

Bug: 454835295
Change-Id: Ica86008a1abb7077243470cf05cc75cb23289db1
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/83228
Reviewed-by: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Auto-Submit: Rudolf Polzer <rpolzer@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59bb999..5ee0a37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,7 +119,7 @@
 if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
   # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
   # primarily on our normal Clang one.
-  set(C_CXX_FLAGS "-fno-strict-aliasing -Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers")
+  set(C_CXX_FLAGS "-Werror -Wformat=2 -Wmissing-field-initializers -Wshadow -Wsign-compare -Wtype-limits -Wvla -Wwrite-strings -fno-strict-aliasing")
   if(MSVC)
     # clang-cl sets different default warnings than clang. It also treats -Wall
     # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
@@ -133,7 +133,7 @@
       set(C_CXX_FLAGS "${C_CXX_FLAGS} -ggdb")
     endif()
 
-    set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fvisibility=hidden -fno-common")
+    set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fno-common -fvisibility=hidden")
   endif()
 
   if(CLANG)
diff --git a/util/util.bzl b/util/util.bzl
index c668089..b0d7988 100644
--- a/util/util.bzl
+++ b/util/util.bzl
@@ -23,16 +23,19 @@
     # This list of warnings should match those in the top-level CMakeLists.txt.
     "-Wall",
     "-Wformat=2",
-    "-Wsign-compare",
     "-Wmissing-field-initializers",
-    "-Wwrite-strings",
     "-Wshadow",
+    "-Wsign-compare",
+    "-Wtype-limits",
+    "-Wvla",
+    "-Wwrite-strings",
     "-fno-common",
     "-fno-strict-aliasing",
 ]
 
 gcc_copts_cxx = [
     "-Wmissing-declarations",
+    "-Wnon-virtual-dtor",
 ]
 
 gcc_copts_c = [