summaryrefslogtreecommitdiff
path: root/extra/distcc/distcc-hardened.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-03-12 23:00:02 +0000
committerdavidovski <david@davidovski.xyz>2022-03-12 23:00:02 +0000
commit1daf71c2980b1920bbdc2f07af669ebf6f0f82d6 (patch)
tree7ef6ac7612c7361f7d3657e8f32d5b0a17b2e602 /extra/distcc/distcc-hardened.patch
parentd215dd09cb60ed38dbcffe14f0c7cc748645ad79 (diff)
added patches for broken files
Diffstat (limited to 'extra/distcc/distcc-hardened.patch')
-rw-r--r--extra/distcc/distcc-hardened.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/extra/distcc/distcc-hardened.patch b/extra/distcc/distcc-hardened.patch
new file mode 100644
index 0000000..c50b15d
--- /dev/null
+++ b/extra/distcc/distcc-hardened.patch
@@ -0,0 +1,24 @@
+From: Gordon Malm <gengor@gentoo.org>
+
+Make distcc client pass -D__KERNEL__ macro. Hardened GCC uses this
+macro to determine if code intended to be run in-kernel is being compiled.
+If the code is kernel code, certain compile flags are not applied.
+
+When using distcc to build kernel code (modules, etc.) without this patch,
+the distccd host doesn't get passed -D__KERNEL__. Consequently, gcc on
+the distccd host applies all kinds of flags that it shouldn't.
+
+--- distcc-2.18.3/src/strip.c
++++ distcc-2.18.3-hardened/src/strip.c
+@@ -79,7 +79,10 @@ int dcc_strip_local_args(char **from, ch
+ /* skip through argv, copying all arguments but skipping ones that
+ * ought to be omitted */
+ for (from_i = to_i = 0; from[from_i]; from_i++) {
+- if (str_equal("-D", from[from_i])
++ if (str_equal("-D__KERNEL__", from[from_i])) {
++ to[to_i++] = from[from_i];
++ }
++ else if (str_equal("-D", from[from_i])
+ || str_equal("-I", from[from_i])
+ || str_equal("-U", from[from_i])
+ || str_equal("-L", from[from_i])