diff -ruN tools/clang/include/clang/Basic/LangOptions.def tools/clang/include/clang/Basic/LangOptions.def --- tools/clang/include/clang/Basic/LangOptions.def 2013-11-06 23:31:51.000000000 +0400 +++ tools/clang/include/clang/Basic/LangOptions.def 2014-10-24 20:19:55.000000000 +0400 @@ -84,6 +84,7 @@ LANGOPT(RTTI , 1, 1, "run-time type information") LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout") LANGOPT(Freestanding, 1, 0, "freestanding implementation") +LANGOPT(FormatExtensions , 1, 0, "FreeBSD format extensions") LANGOPT(NoBuiltin , 1, 0, "disable builtin functions") LANGOPT(NoMathBuiltin , 1, 0, "disable math builtin functions") diff -ruN tools/clang/include/clang/Driver/Options.td tools/clang/include/clang/Driver/Options.td --- tools/clang/include/clang/Driver/Options.td 2013-11-17 20:03:29.000000000 +0400 +++ tools/clang/include/clang/Driver/Options.td 2014-10-24 20:16:16.000000000 +0400 @@ -530,6 +530,8 @@ def ffreestanding : Flag<["-"], "ffreestanding">, Group, Flags<[CC1Option]>, HelpText<"Assert that the compilation takes place in a freestanding environment">; +def fformat_extensions: Flag<["-"], "fformat-extensions">, Group, Flags<[CC1Option]>, + HelpText<"Enable FreeBSD kernel specific format string extensions">; def fgnu_keywords : Flag<["-"], "fgnu-keywords">, Group, Flags<[CC1Option]>, HelpText<"Allow GNU-extension keywords regardless of language standard">; def fgnu89_inline : Flag<["-"], "fgnu89-inline">, Group, Flags<[CC1Option]>, diff -ruN tools/clang/lib/Driver/Tools.cpp tools/clang/lib/Driver/Tools.cpp --- tools/clang/lib/Driver/Tools.cpp 2014-04-12 00:31:24.000000000 +0400 +++ tools/clang/lib/Driver/Tools.cpp 2014-10-24 20:17:22.000000000 +0400 @@ -2984,6 +2984,7 @@ // Forward -f (flag) options which we can pass directly. Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); + Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions); Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); Args.AddLastArg(CmdArgs, options::OPT_flimit_debug_info); Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info); diff -ruN tools/clang/lib/Frontend/CompilerInvocation.cpp tools/clang/lib/Frontend/CompilerInvocation.cpp --- tools/clang/lib/Frontend/CompilerInvocation.cpp 2013-11-18 17:23:07.000000000 +0400 +++ tools/clang/lib/Frontend/CompilerInvocation.cpp 2014-10-24 20:18:26.000000000 +0400 @@ -1319,6 +1319,7 @@ Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); Opts.ShortEnums = Args.hasArg(OPT_fshort_enums); Opts.Freestanding = Args.hasArg(OPT_ffreestanding); + Opts.FormatExtensions = Args.hasArg(OPT_fformat_extensions); Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin); Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new);