diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn --- a/llvm/utils/gn/build/BUILD.gn +++ b/llvm/utils/gn/build/BUILD.gn @@ -31,7 +31,6 @@ cflags += [ "-fdiagnostics-color" ] cflags_cc = [ "-std=c++11", - "-fno-exceptions", "-fvisibility-inlines-hidden", ] } else { @@ -139,6 +138,10 @@ } } +config("no_exceptions") { + cflags_cc = [ "-fno-exceptions" ] +} + config("no_rtti") { if (current_os == "win") { cflags_cc = [ "/GR-" ] diff --git a/llvm/utils/gn/build/BUILDCONFIG.gn b/llvm/utils/gn/build/BUILDCONFIG.gn --- a/llvm/utils/gn/build/BUILDCONFIG.gn +++ b/llvm/utils/gn/build/BUILDCONFIG.gn @@ -5,6 +5,7 @@ shared_binary_target_configs = [ "//llvm/utils/gn/build:compiler_defaults", "//llvm/utils/gn/build:llvm_code", + "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", "//llvm/utils/gn/build:thin_archive", "//llvm/utils/gn/build:warn_covered_switch_default",