Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550428 - linux-mod.eclass ignores configured kernel CROSS_COMPILE option
Summary: linux-mod.eclass ignores configured kernel CROSS_COMPILE option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2015-05-26 02:30 UTC by Luke-Jr
Modified: 2021-09-06 20:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,23.16 KB, text/plain)
2015-05-26 02:30 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2015-05-26 02:30:15 UTC
Created attachment 403980 [details]
build.log

i686-pc-linux-gnu-ld: Relocatable linking with relocations from format elf64-x86-64 (/var/tmp/portage/net-firewall/xtables-addons-2.6/work/xtables-addons-2.6/extensions/compat_xtables.o) to format elf32-i386 (/var/tmp/portage/net-firewall/xtables-addons-2.6/work/xtables-addons-2.6/extensions/compat_xtables.ko) is not supported

My kernel has the necessary GNUmakefile for cross-compiling:
    ARCH=x86_64
    CROSS_COMPILE=x86_64-pc-linux-gnu-
    include Makefile
Comment 1 Mike Gilbert gentoo-dev 2015-05-29 01:33:51 UTC
I think this would happen with any out-of-tree kernel module.
Comment 2 Mike Pagano gentoo-dev 2021-08-23 22:33:16 UTC
Is this still an issue?
Comment 3 Luke-Jr 2021-08-24 02:45:23 UTC
Yes
Comment 4 Mike Pagano gentoo-dev 2021-09-02 19:49:32 UTC
So right now linux-info ignore GNUMakefile .

I wrote a patch to address this.
Comment 5 Mike Pagano gentoo-dev 2021-09-04 20:49:18 UTC
So, linux-info should not read GNUMakefile properly.

Can you test again, I commited the new eclass 3 hours ago as of this writing.

So hopefully,you'll have it on next sync.
Comment 6 Mike Pagano gentoo-dev 2021-09-04 20:49:36 UTC
(In reply to Mike Pagano from comment #5)
> So, linux-info should not read GNUMakefile properly.
> 
> Can you test again, I commited the new eclass 3 hours ago as of this writing.
> 
> So hopefully,you'll have it on next sync.

Should not read / Should read
Comment 7 Luke-Jr 2021-09-04 21:22:11 UTC
This is an issue with the zfs-kmod ebuild itself, not the eclass
Comment 8 Mike Gilbert gentoo-dev 2021-09-04 22:45:01 UTC
(In reply to Luke-Jr from comment #7)
> This is an issue with the zfs-kmod ebuild itself, not the eclass

Nobody made any mention of zfs-kmod in this bug. The original bug summary mentioned net-firewall/xtables-addons.
Comment 9 Mike Gilbert gentoo-dev 2021-09-04 23:44:59 UTC
linux-mod_src_compile passes CROSS_COMPILE=${CHOST}- to make on the command line. Any definition of CROSS_COMPILE in GNUmakefile or Makefile will be overridden by the value on the command line.

Removing this command line setting would cause plain "gcc" to be used on most sytems, and this would cause failures on systems with sys-devel/gcc[-native-symlinks].

linux-mod.eclass really was not designed to allow you to use a separate toolchain for kernel builds.
Comment 10 Luke-Jr 2021-09-05 02:03:49 UTC
Sorry, I mixed this up with the new bug I filed :(

Ignore my zfs-kmod comments here.
Comment 11 Mike Gilbert gentoo-dev 2021-09-05 16:03:22 UTC
Please give this PR a try.

https://github.com/gentoo/gentoo/pull/22225
Comment 12 Larry the Git Cow gentoo-dev 2021-09-06 20:18:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=328b6c7b4f2f6f9ef5b053688af3272a314667ad

commit 328b6c7b4f2f6f9ef5b053688af3272a314667ad
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-09-05 16:01:23 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-09-06 20:18:37 +0000

    linux-mod.eclass: set CROSS_COMPILE in the environment
    
    This allows it to be overriden in local Makefiles.
    
    Closes: https://bugs.gentoo.org/550428
    Closes: https://github.com/gentoo/gentoo/pull/22225
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/linux-mod.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)