Gentoo Archives: gentoo-commits

From: "Gordon Malm (gengor)" <gengor@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-devel/distcc/files: distcc-hardened.patch
Date: Sun, 02 Nov 2008 22:24:25
Message-Id: E1KwlMt-0000yX-ED@stork.gentoo.org
1 gengor 08/11/02 22:24:23
2
3 Added: distcc-hardened.patch
4 Log:
5 Add "hardened" USE flag, fixing bugs #120001, #167844 and probably more.
6 (Portage version: 2.1.4.5)
7
8 Revision Changes Path
9 1.1 sys-devel/distcc/files/distcc-hardened.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/distcc/files/distcc-hardened.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/distcc/files/distcc-hardened.patch?rev=1.1&content-type=text/plain
13
14 Index: distcc-hardened.patch
15 ===================================================================
16 From: Gordon Malm <gengor@g.o>
17
18 Make distcc client pass -D__KERNEL__ macro. Hardened GCC uses this
19 macro to determine if code intended to be run in-kernel is being compiled.
20 If the code is kernel code, certain compile flags are not applied.
21
22 When using distcc to build kernel code (modules, etc.) without this patch,
23 the distccd host doesn't get passed -D__KERNEL__. Consequently, gcc on
24 the distccd host applies all kinds of flags that it shouldn't.
25
26 --- distcc-2.18.3/src/strip.c
27 +++ distcc-2.18.3-hardened/src/strip.c
28 @@ -73,7 +73,10 @@ int dcc_strip_local_args(char **from, ch
29 /* skip through argv, copying all arguments but skipping ones that
30 * ought to be omitted */
31 for (from_i = to_i = 0; from[from_i]; from_i++) {
32 - if (str_equal("-D", from[from_i])
33 + if (str_equal("-D__KERNEL__", from[from_i])) {
34 + to[to_i++] = from[from_i];
35 + }
36 + else if (str_equal("-D", from[from_i])
37 || str_equal("-I", from[from_i])
38 || str_equal("-U", from[from_i])
39 || str_equal("-L", from[from_i])