diff --git a/cc/global.go b/cc/global.go
new file mode 100644
index 0000000..ec0f572
--- /dev/null
+++ b/cc/global.go
@@ -0,0 +1,138 @@
+// Copyright 2016 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cc
+
+import (
+	"strings"
+
+	"android/soong/android"
+)
+
+// Flags used by lots of devices.  Putting them in package static variables will save bytes in
+// build.ninja so they aren't repeated for every file
+var (
+	commonGlobalCflags = []string{
+		"-DANDROID",
+		"-fmessage-length=0",
+		"-W",
+		"-Wall",
+		"-Wno-unused",
+		"-Winit-self",
+		"-Wpointer-arith",
+
+		// COMMON_RELEASE_CFLAGS
+		"-DNDEBUG",
+		"-UDEBUG",
+	}
+
+	deviceGlobalCflags = []string{
+		"-fdiagnostics-color",
+
+		// TARGET_ERROR_FLAGS
+		"-Werror=return-type",
+		"-Werror=non-virtual-dtor",
+		"-Werror=address",
+		"-Werror=sequence-point",
+		"-Werror=date-time",
+	}
+
+	hostGlobalCflags = []string{}
+
+	commonGlobalCppflags = []string{
+		"-Wsign-promo",
+	}
+
+	noOverrideGlobalCflags = []string{
+		"-Werror=int-to-pointer-cast",
+		"-Werror=pointer-to-int-cast",
+	}
+
+	illegalFlags = []string{
+		"-w",
+	}
+)
+
+func init() {
+	if android.BuildOs == android.Linux {
+		commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
+	}
+
+	pctx.StaticVariable("commonGlobalCflags", strings.Join(commonGlobalCflags, " "))
+	pctx.StaticVariable("deviceGlobalCflags", strings.Join(deviceGlobalCflags, " "))
+	pctx.StaticVariable("hostGlobalCflags", strings.Join(hostGlobalCflags, " "))
+	pctx.StaticVariable("noOverrideGlobalCflags", strings.Join(noOverrideGlobalCflags, " "))
+
+	pctx.StaticVariable("commonGlobalCppflags", strings.Join(commonGlobalCppflags, " "))
+
+	pctx.StaticVariable("commonClangGlobalCflags",
+		strings.Join(append(clangFilterUnknownCflags(commonGlobalCflags), "${clangExtraCflags}"), " "))
+	pctx.StaticVariable("deviceClangGlobalCflags",
+		strings.Join(append(clangFilterUnknownCflags(deviceGlobalCflags), "${clangExtraTargetCflags}"), " "))
+	pctx.StaticVariable("hostClangGlobalCflags",
+		strings.Join(clangFilterUnknownCflags(hostGlobalCflags), " "))
+	pctx.StaticVariable("noOverrideClangGlobalCflags",
+		strings.Join(append(clangFilterUnknownCflags(noOverrideGlobalCflags), "${clangExtraNoOverrideCflags}"), " "))
+
+	pctx.StaticVariable("commonClangGlobalCppflags",
+		strings.Join(append(clangFilterUnknownCflags(commonGlobalCppflags), "${clangExtraCppflags}"), " "))
+
+	// Everything in this list is a crime against abstraction and dependency tracking.
+	// Do not add anything to this list.
+	pctx.PrefixedPathsForOptionalSourceVariable("commonGlobalIncludes", "-isystem ",
+		[]string{
+			"system/core/include",
+			"system/media/audio/include",
+			"hardware/libhardware/include",
+			"hardware/libhardware_legacy/include",
+			"hardware/ril/include",
+			"libnativehelper/include",
+			"frameworks/native/include",
+			"frameworks/native/opengl/include",
+			"frameworks/av/include",
+			"frameworks/base/include",
+		})
+	// This is used by non-NDK modules to get jni.h. export_include_dirs doesn't help
+	// with this, since there is no associated library.
+	pctx.PrefixedPathsForOptionalSourceVariable("commonNativehelperInclude", "-I",
+		[]string{"libnativehelper/include/nativehelper"})
+
+	pctx.SourcePathVariable("clangDefaultBase", "prebuilts/clang/host")
+	pctx.VariableFunc("clangBase", func(config interface{}) (string, error) {
+		if override := config.(android.Config).Getenv("LLVM_PREBUILTS_BASE"); override != "" {
+			return override, nil
+		}
+		return "${clangDefaultBase}", nil
+	})
+	pctx.VariableFunc("clangVersion", func(config interface{}) (string, error) {
+		if override := config.(android.Config).Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
+			return override, nil
+		}
+		return "clang-3016494", nil
+	})
+	pctx.StaticVariable("clangPath", "${clangBase}/${HostPrebuiltTag}/${clangVersion}")
+	pctx.StaticVariable("clangBin", "${clangPath}/bin")
+}
+
+var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
+
+func bionicHeaders(bionicArch, kernelArch string) string {
+	return strings.Join([]string{
+		"-isystem bionic/libc/arch-" + bionicArch + "/include",
+		"-isystem bionic/libc/include",
+		"-isystem bionic/libc/kernel/uapi",
+		"-isystem bionic/libc/kernel/uapi/asm-" + kernelArch,
+		"-isystem bionic/libc/kernel/android/uapi",
+	}, " ")
+}
