Commit b65a3b0d authored by Natanael Copa's avatar Natanael Copa

core/distcc: add a patch that allows distcc compile kernel modules

parent 65b88074
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=distcc
pkgver=3.1
pkgrel=0
pkgrel=1
pkgdesc="A distributed C, C++, Obj C compiler"
url="http://distcc.org"
license="GPL-2"
......@@ -8,6 +9,7 @@ depends="popt"
makedepends="popt-dev"
source="http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tar.bz2
distcc-3.1-clone.patch
distcc-hardened.patch
distccd.initd distccd.confd"
subpackages="$pkgname-doc"
......@@ -39,5 +41,6 @@ build ()
md5sums="a1a9d3853df7133669fffec2a9aab9f3 distcc-3.1.tar.bz2
29fe296aa2985eea7af7402f421db187 distcc-3.1-clone.patch
351ca958ff4869f8a2795d8ca6647de1 distcc-hardened.patch
5cf566965873279fedc16934a2ba6cd0 distccd.initd
e9e0ccc9f5813b9c3c88c8687b2ebc73 distccd.confd"
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
@@ -73,7 +73,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])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment