Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119012 - need KERNEL_ABI
Summary: need KERNEL_ABI
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 124816
  Show dependency tree
 
Reported: 2006-01-14 11:26 UTC by Simon Stelling (RETIRED)
Modified: 2006-03-26 09:48 UTC (History)
5 users (show)

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


Attachments
suggested patch (patch,857 bytes, patch)
2006-01-14 11:28 UTC, Simon Stelling (RETIRED)
Details | Diff
enable use of KERNEL_ABI (kernel-abi.patch,1.42 KB, patch)
2006-03-01 11:16 UTC, Simon Stelling (RETIRED)
Details | Diff
linux-mod patch (linux-mod-kernel-abi.patch,983 bytes, patch)
2006-03-25 04:12 UTC, Simon Stelling (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Stelling (RETIRED) gentoo-dev 2006-01-14 11:26:41 UTC
when using e.g. MULTILIB_ABIS="amd64 x86" DEFAULT_ABI="x86" all attempts to compile modules will fail since they get built 32bit instead of 64bit, which of course is not what we want.
Comment 1 Simon Stelling (RETIRED) gentoo-dev 2006-01-14 11:28:48 UTC
Created attachment 77098 [details, diff]
suggested patch
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2006-01-14 11:31:57 UTC
mips herd: i'm not absolutely sure if the logic in the patch is correct, could you check it out please? :)
Comment 3 Simon Stelling (RETIRED) gentoo-dev 2006-01-31 01:45:56 UTC
someone from the mips herd told me that the patch should be correct, but that they don't use multilib anyway
Comment 4 Simon Stelling (RETIRED) gentoo-dev 2006-01-31 10:42:04 UTC
Comment on attachment 77098 [details, diff]
suggested patch

actually, let me revise this patch. there has recently been a change in toolchain-funcs.eclass which invalidates this patch for ppc{,64}
Comment 5 Simon Stelling (RETIRED) gentoo-dev 2006-02-09 01:35:18 UTC
I think the sanest solution to this problem would be just setting ABI=$(get_kernel_abi) in linux-mod.eclass and handling the rest either in the profiles by setting KERNEL_ABI=... or in multilib.eclass with something like this:

+# get_kernel_abi()
+# Return the ABI used by the kernel and modules
+get_kernel_abi() {
+       if has_multilib_profile ; then
+               case $(get_abi_var CHOST) in
+                               *86*)           echo "amd64";;
+                               mips*)          echo "n64";;
+                               powerpc*)       echo "ppc64";;
+                               sparc*)         echo "sparc64";;
+                               *)              echo "${DEFAULT_ABI}";;
+               esac
+       else
+               echo "${DEFAULT_ABI}"
+       fi
+}
+

However, I'm much in favour of setting it in the profiles.. eradicator, what's your opinion?
Comment 6 Simon Stelling (RETIRED) gentoo-dev 2006-02-09 01:37:40 UTC
I think the sanest solution to this problem would be just setting ABI=$(get_kernel_abi) in linux-mod.eclass and handling the rest either in the profiles by setting KERNEL_ABI=... or directly with some uname -m magic in multilib.eclass.

Personally, I'm in favour of setting it in the profiles.. eradicator, what's your opinion?
Comment 7 Simon Stelling (RETIRED) gentoo-dev 2006-02-09 01:38:20 UTC
bleh, screw comment 5 :P
Comment 8 Simon Stelling (RETIRED) gentoo-dev 2006-03-01 11:16:56 UTC
Created attachment 81057 [details, diff]
enable use of KERNEL_ABI
Comment 9 Herbie Hopkins (RETIRED) gentoo-dev 2006-03-02 02:57:21 UTC
Don't think it's going to be as simple as that. This will affect all packages that inherit linux-mod and it's going to affect everything they compile. For example lirc inherits linux-mod and provides a kernel module, shared libs and executables. The patch as it stands would force all of this to be compiled for the KERNEL_ABI which is not what you want. Moreover it would override anything you set on the command line.

Comment 10 Simon Stelling (RETIRED) gentoo-dev 2006-03-02 11:39:01 UTC
(In reply to comment #9)
> Don't think it's going to be as simple as that. This will affect all packages
> that inherit linux-mod and it's going to affect everything they compile. For
> example lirc inherits linux-mod and provides a kernel module, shared libs and
> executables. The patch as it stands would force all of this to be compiled for
> the KERNEL_ABI which is not what you want. Moreover it would override anything
> you set on the command line.

well, that's basically not different from any other eclass. setting ABI=KERNEL_ABI makes sense, since everything else will just break. i tend to claim that the number of packages that compile executables/libraries beside kernel modules is rather low, but that's only a vague feeling.

pkg_setup() {
 ABI2=${ABI}
 linux-mod_pkg_setup
 ABI=${ABI2}
}

should be a valid workaround for those packages. if the number of packages compiling additional stuff is higher than the number of those who don't, there's no point in having the eclass doing the ABI=${KERNEL_ABI} of course, but then we'll have to set it for the rest..

or maybe you know a fix that would approach both types of packages? i unfortunately don't :/
Comment 11 Simon Stelling (RETIRED) gentoo-dev 2006-03-09 08:36:13 UTC
i added KERNEL_ABI to multilib.eclass (not to the kernel eclasses though)

adding arches with multilib profiles which might be interested in using it
Comment 12 Simon Stelling (RETIRED) gentoo-dev 2006-03-25 04:12:41 UTC
Created attachment 83078 [details, diff]
linux-mod patch

This patch only sets ABI for linux-mod_src_compile() which ensures that only kernel modules get built with KERNEL_ABI, the rest of the package will be built with whatever ABI was chosen
Comment 13 Simon Stelling (RETIRED) gentoo-dev 2006-03-26 09:48:17 UTC
patch committed