summaryrefslogtreecommitdiff
path: root/devel/llvm11/files/clang
diff options
context:
space:
mode:
Diffstat (limited to 'devel/llvm11/files/clang')
-rw-r--r--devel/llvm11/files/clang/patch-fformat_extensions.diff44
-rw-r--r--devel/llvm11/files/clang/patch-fopenmp.diff14
-rw-r--r--devel/llvm11/files/clang/patch-tools_clang_lib_Headers_CMakeLists.txt32
-rw-r--r--devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format-sublime.py14
-rw-r--r--devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format.py11
-rw-r--r--devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_git-clang-format32
-rw-r--r--devel/llvm11/files/clang/patch-tools_clang_tools_scan-build_libexec_ccc-analyzer12
7 files changed, 159 insertions, 0 deletions
diff --git a/devel/llvm11/files/clang/patch-fformat_extensions.diff b/devel/llvm11/files/clang/patch-fformat_extensions.diff
new file mode 100644
index 000000000000..1a14313340c2
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-fformat_extensions.diff
@@ -0,0 +1,44 @@
+diff -ruN tools/clang/include/clang/Basic/LangOptions.def tools/clang/include/clang/Basic/LangOptions.def
+--- tools/clang/include/clang/Basic/LangOptions.def 2015-07-30 22:47:41 UTC
++++ tools/clang/include/clang/Basic/LangOptions.def
+@@ -114,6 +114,7 @@
+ LANGOPT(RTTIData , 1, 1, "emit run-time type information data")
+ 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")
+ LANGOPT(GNUAsm , 1, 1, "GNU-style inline assembly")
+diff -ruN tools/clang/include/clang/Driver/Options.td tools/clang/include/clang/Driver/Options.td
+--- tools/clang/include/clang/Driver/Options.td.orig 2020-01-30 15:29:37.000000000 +0000
++++ tools/clang/include/clang/Driver/Options.td 2020-01-31 23:26:44.132423000 +0000
+@@ -1211,6 +1211,8 @@
+
+ def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Assert that the compilation takes place in a freestanding environment">;
++def fformat_extensions: Flag<["-"], "fformat-extensions">, Group<f_Group>, Flags<[CC1Option]>,
++ HelpText<"Enable FreeBSD kernel specific format string extensions">;
+ def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
+ HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">,
+ Flags<[CC1Option, CoreOption]>;
+--- tools/clang/lib/Driver/ToolChains/Clang.cpp.orig 2017-09-14 19:36:28.212240000 +0100
++++ tools/clang/lib/Driver/ToolChains/Clang.cpp 2017-09-14 19:35:59.296165000 +0100
+@@ -3202,6 +3202,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_fno_operator_names);
+ // Emulated TLS is enabled by default on Android and OpenBSD, and can be enabled
+diff -ruN tools/clang/lib/Frontend/CompilerInvocation.cpp tools/clang/lib/Frontend/CompilerInvocation.cpp
+--- tools/clang/lib/Frontend/CompilerInvocation.cpp 2015-07-30 22:47:41 UTC
++++ tools/clang/lib/Frontend/CompilerInvocation.cpp
+@@ -1543,6 +1543,7 @@
+ Opts.ShortWChar = Args.hasFlag(OPT_fshort_wchar, OPT_fno_short_wchar, false);
+ 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);
diff --git a/devel/llvm11/files/clang/patch-fopenmp.diff b/devel/llvm11/files/clang/patch-fopenmp.diff
new file mode 100644
index 000000000000..18932bd0d19c
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-fopenmp.diff
@@ -0,0 +1,14 @@
+--- tools/clang/lib/Driver/ToolChains/CommonArgs.cpp.orig 2017-05-10 17:18:56.000000000 +0000
++++ tools/clang/lib/Driver/ToolChains/CommonArgs.cpp 2017-05-10 23:01:17.087686000 +0000
+@@ -441,7 +441,10 @@
+
+ switch (TC.getDriver().getOpenMPRuntime(Args)) {
+ case Driver::OMPRT_OMP:
+- CmdArgs.push_back("-lomp");
++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so"))
++ CmdArgs.push_back("-lomp");
++ else
++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libomp.so");
+ break;
+ case Driver::OMPRT_GOMP:
+ CmdArgs.push_back("-lgomp");
diff --git a/devel/llvm11/files/clang/patch-tools_clang_lib_Headers_CMakeLists.txt b/devel/llvm11/files/clang/patch-tools_clang_lib_Headers_CMakeLists.txt
new file mode 100644
index 000000000000..32cf06d0bc0c
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-tools_clang_lib_Headers_CMakeLists.txt
@@ -0,0 +1,32 @@
+--- tools/clang/lib/Headers/CMakeLists.txt.orig
++++ tools/clang/lib/Headers/CMakeLists.txt
+@@ -72,7 +72,6 @@
+ inttypes.h
+ invpcidintrin.h
+ iso646.h
+- limits.h
+ lwpintrin.h
+ lzcntintrin.h
+ mm3dnow.h
+@@ -98,13 +97,7 @@
+ s390intrin.h
+ shaintrin.h
+ smmintrin.h
+- stdalign.h
+- stdarg.h
+- stdatomic.h
+- stdbool.h
+- stddef.h
+ __stddef_max_align_t.h
+- stdint.h
+ stdnoreturn.h
+ tbmintrin.h
+ tgmath.h
+@@ -113,7 +106,6 @@
+ unwind.h
+ vadefs.h
+ vaesintrin.h
+- varargs.h
+ vecintrin.h
+ vpclmulqdqintrin.h
+ waitpkgintrin.h
diff --git a/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format-sublime.py b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format-sublime.py
new file mode 100644
index 000000000000..2c8909f1e1d1
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format-sublime.py
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- tools/clang/tools/clang-format/clang-format-sublime.py.orig
++++ tools/clang/tools/clang-format/clang-format-sublime.py
+@@ -18,7 +18,7 @@
+ import subprocess
+
+ # Change this to the full path if clang-format is not on the path.
+-binary = 'clang-format'
++binary = 'clang-format%%LLVM_SUFFIX%%'
+
+ # Change this to format according to other formatting styles. See the output of
+ # 'clang-format --help' for a list of supported styles. The default looks for
diff --git a/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format.py b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format.py
new file mode 100644
index 000000000000..2962d3f4cbcb
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_clang-format.py
@@ -0,0 +1,11 @@
+--- tools/clang/tools/clang-format/clang-format.py.orig 2015-09-08 20:44:00 UTC
++++ tools/clang/tools/clang-format/clang-format.py
+@@ -34,7 +34,7 @@ import vim
+
+ # set g:clang_format_path to the path to clang-format if it is not on the path
+ # Change this to the full path if clang-format is not on the path.
+-binary = 'clang-format'
++binary = 'clang-format%%LLVM_SUFFIX%%'
+ if vim.eval('exists("g:clang_format_path")') == "1":
+ binary = vim.eval('g:clang_format_path')
+
diff --git a/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_git-clang-format b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_git-clang-format
new file mode 100644
index 000000000000..5c5ae3581228
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-tools_clang_tools_clang-format_git-clang-format
@@ -0,0 +1,32 @@
+
+$FreeBSD$
+
+--- tools/clang/tools/clang-format/git-clang-format.orig
++++ tools/clang/tools/clang-format/git-clang-format
+@@ -90,7 +90,7 @@
+ usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter,
+ description=desc)
+ p.add_argument('--binary',
+- default=config.get('clangformat.binary', 'clang-format'),
++ default=config.get('clangformat.binary', 'clang-format%%LLVM_SUFFIX%%'),
+ help='path to clang-format'),
+ p.add_argument('--commit',
+ default=config.get('clangformat.commit', 'HEAD'),
+@@ -344,7 +344,7 @@
+
+
+ def run_clang_format_and_save_to_tree(changed_lines, revision=None,
+- binary='clang-format', style=None):
++ binary='clang-format%%LLVM_SUFFIX%%', style=None):
+ """Run clang-format on each file and save the result to a git tree.
+
+ Returns the object ID (SHA-1) of the created tree."""
+@@ -397,7 +397,7 @@
+
+
+ def clang_format_to_blob(filename, line_ranges, revision=None,
+- binary='clang-format', style=None):
++ binary='clang-format%%LLVM_SUFFIX%%', style=None):
+ """Run clang-format on the given file and save the result to a git blob.
+
+ Runs on the file in `revision` if not None, or on the file in the working
diff --git a/devel/llvm11/files/clang/patch-tools_clang_tools_scan-build_libexec_ccc-analyzer b/devel/llvm11/files/clang/patch-tools_clang_tools_scan-build_libexec_ccc-analyzer
new file mode 100644
index 000000000000..e1c65480ce2f
--- /dev/null
+++ b/devel/llvm11/files/clang/patch-tools_clang_tools_scan-build_libexec_ccc-analyzer
@@ -0,0 +1,12 @@
+--- tools/clang/tools/scan-build/libexec/ccc-analyzer.orig
++++ tools/clang/tools/scan-build/libexec/ccc-analyzer
+@@ -81,6 +81,9 @@
+ if (-x "/usr/bin/xcrun") {
+ $UseXCRUN = 1;
+ }
++} elsif (`uname -s` eq "FreeBSD\n") {
++ $DefaultCCompiler = 'cc';
++ $DefaultCXXCompiler = 'c++';
+ } else {
+ $DefaultCCompiler = 'gcc';
+ $DefaultCXXCompiler = 'g++';