1 |
On 03/01/2020 12:52, Jason A. Donenfeld wrote: |
2 |
> A user reported that when compiling modules for a system with a 64-bit |
3 |
> kernel and a 32-bit userland, there were linker errors. This patch here |
4 |
> is an attempt to fix that by making sure that we always use the kernel |
5 |
> ABI when giving target build parameters. |
6 |
> |
7 |
> Signed-off-by: Jason A. Donenfeld <zx2c4@g.o> |
8 |
> Fixes: https://bugs.gentoo.org/704468 |
9 |
> Cc: joakim.tjernlund@××××××××.com |
10 |
> Cc: kernel@g.o |
11 |
> --- |
12 |
> eclass/linux-mod.eclass | 11 +++++++---- |
13 |
> 1 file changed, 7 insertions(+), 4 deletions(-) |
14 |
> |
15 |
> diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass |
16 |
> index b6dc2c84d09..60b0d88e9b9 100644 |
17 |
> --- a/eclass/linux-mod.eclass |
18 |
> +++ b/eclass/linux-mod.eclass |
19 |
> @@ -671,13 +671,16 @@ linux-mod_src_compile() { |
20 |
> # spaces that must be preserved. If don't do this, then the stuff |
21 |
> # inside the variables gets used as targets for Make, which then |
22 |
> # fails. |
23 |
> - eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" \ |
24 |
> - CROSS_COMPILE=${CHOST}- \ |
25 |
> - LDFLAGS=\"$(get_abi_LDFLAGS)\" \ |
26 |
> + local KERNEL_CHOST="$(ABI=${KERNEL_ABI} get_abi_CHOST)" |
27 |
> + local KERNEL_LDFLAGS="$(ABI=${KERNEL_ABI} get_abi_LDFLAGS)" |
28 |
> + local HOST_CC="$(tc-getBUILD_CC)" |
29 |
> + eval "emake HOSTCC=\"${HOST_CC}\" \ |
30 |
> + CROSS_COMPILE=${KERNEL_CHOST}- \ |
31 |
> + LDFLAGS=\"${KERNEL_LDFLAGS}\" \ |
32 |
> ${BUILD_FIXES} \ |
33 |
> ${BUILD_PARAMS} \ |
34 |
> ${BUILD_TARGETS} " \ |
35 |
> - || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" |
36 |
> + || die "Unable to emake HOSTCC="${HOST_CC}" CROSS_COMPILE=${KERNEL_CHOST}- LDFLAGS="${KERNEL_LDFLAGS}" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" |
37 |
> cd "${OLDPWD}" |
38 |
> touch "${srcdir}"/.built |
39 |
> fi |
40 |
> |
41 |
|
42 |
It seems doing what it is supposed to do. what is the testing condition? |
43 |
|
44 |
lu |