1 |
commit: 328b6c7b4f2f6f9ef5b053688af3272a314667ad |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 5 16:01:23 2021 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 6 20:18:37 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=328b6c7b |
7 |
|
8 |
linux-mod.eclass: set CROSS_COMPILE in the environment |
9 |
|
10 |
This allows it to be overriden in local Makefiles. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/550428 |
13 |
Closes: https://github.com/gentoo/gentoo/pull/22225 |
14 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
15 |
|
16 |
eclass/linux-mod.eclass | 8 ++++++-- |
17 |
1 file changed, 6 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass |
20 |
index ca7bb2e219f..943efa5cd9b 100644 |
21 |
--- a/eclass/linux-mod.eclass |
22 |
+++ b/eclass/linux-mod.eclass |
23 |
@@ -673,6 +673,11 @@ linux-mod_src_compile() { |
24 |
|
25 |
[[ -n ${KERNEL_DIR} ]] && addpredict "${KERNEL_DIR}/null.dwo" |
26 |
|
27 |
+ # Set CROSS_COMPILE in the environment. |
28 |
+ # This allows it to be overridden in local Makefiles. |
29 |
+ # https://bugs.gentoo.org/550428 |
30 |
+ local -x CROSS_COMPILE=${CROSS_COMPILE-${CHOST}-} |
31 |
+ |
32 |
BUILD_TARGETS=${BUILD_TARGETS:-clean module} |
33 |
strip_modulenames; |
34 |
cd "${S}" |
35 |
@@ -705,12 +710,11 @@ linux-mod_src_compile() { |
36 |
# inside the variables gets used as targets for Make, which then |
37 |
# fails. |
38 |
eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" \ |
39 |
- CROSS_COMPILE=${CHOST}- \ |
40 |
LDFLAGS=\"$(get_abi_LDFLAGS)\" \ |
41 |
${BUILD_FIXES} \ |
42 |
${BUILD_PARAMS} \ |
43 |
${BUILD_TARGETS} " \ |
44 |
- || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" |
45 |
+ || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" |
46 |
cd "${OLDPWD}" |
47 |
touch "${srcdir}"/.built |
48 |
fi |