[gentoo-dev] Re: [PATCH] linux-mod.eclass: pass proper arch to kernel's build system

2020-01-05 Thread Luca Barbato

On 03/01/2020 12:52, Jason A. Donenfeld wrote:

A user reported that when compiling modules for a system with a 64-bit
kernel and a 32-bit userland, there were linker errors. This patch here
is an attempt to fix that by making sure that we always use the kernel
ABI when giving target build parameters.

Signed-off-by: Jason A. Donenfeld 
Fixes: https://bugs.gentoo.org/704468
Cc: joakim.tjernl...@infinera.com
Cc: ker...@gentoo.org
---
  eclass/linux-mod.eclass | 11 +++
  1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index b6dc2c84d09..60b0d88e9b9 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -671,13 +671,16 @@ linux-mod_src_compile() {
# spaces that must be preserved. If don't do this, then 
the stuff
# inside the variables gets used as targets for Make, 
which then
# fails.
-   eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" \
-   CROSS_COMPILE=${CHOST}- \
-   LDFLAGS=\"$(get_abi_LDFLAGS)\" \
+   local KERNEL_CHOST="$(ABI=${KERNEL_ABI} get_abi_CHOST)"
+   local KERNEL_LDFLAGS="$(ABI=${KERNEL_ABI} 
get_abi_LDFLAGS)"
+   local HOST_CC="$(tc-getBUILD_CC)"
+   eval "emake HOSTCC=\"${HOST_CC}\" \
+   CROSS_COMPILE=${KERNEL_CHOST}- \
+   LDFLAGS=\"${KERNEL_LDFLAGS}\" \
${BUILD_FIXES} \
${BUILD_PARAMS} \
${BUILD_TARGETS} " \
-   || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" 
CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} 
${BUILD_TARGETS}"
+   || die "Unable to emake HOSTCC="${HOST_CC}" 
CROSS_COMPILE=${KERNEL_CHOST}- LDFLAGS="${KERNEL_LDFLAGS}" ${BUILD_FIXES} ${BUILD_PARAMS} 
${BUILD_TARGETS}"
cd "${OLDPWD}"
touch "${srcdir}"/.built
fi



It seems doing what it is supposed to do. what is the testing condition?

lu




Re: [gentoo-dev] Re: [PATCH] linux-mod.eclass: pass proper arch to kernel's build system

2020-01-04 Thread Jason A. Donenfeld
On Sat, Jan 4, 2020 at 9:33 PM Aaron Bauman  wrote:
>
> On Sat, Jan 04, 2020 at 09:11:01PM -0500, Jason A. Donenfeld wrote:
> > Hi,
> >
> > I'd appreciate some code review of this before I commit.
> >
> > Thanks,
> > Jason
> >
>
> Silence is consent.

Maybe. But there's quite a bit of this that I look at and think,
"that's not necessary, let me just trim this all down to something
much smaller..." And then I start to wonder whether the original
authors have already been through several bug-fixing cycles when they
added all that. So I'd like to avoid repeating that exercise if
possible.



Re: [gentoo-dev] Re: [PATCH] linux-mod.eclass: pass proper arch to kernel's build system

2020-01-04 Thread Aaron Bauman
On Sat, Jan 04, 2020 at 09:11:01PM -0500, Jason A. Donenfeld wrote:
> Hi,
> 
> I'd appreciate some code review of this before I commit.
> 
> Thanks,
> Jason
> 

Silence is consent. I also don't know the original authors are even Gentoo devs
anymore...

-- 
Cheers,
Aaron


signature.asc
Description: PGP signature


[gentoo-dev] Re: [PATCH] linux-mod.eclass: pass proper arch to kernel's build system

2020-01-04 Thread Jason A. Donenfeld
Hi,

I'd appreciate some code review of this before I commit.

Thanks,
Jason