Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237618 - linux-mod.eclass: Module.symvers information lost and thus unresoloved symbols if MODVERSIONS enabled
Summary: linux-mod.eclass: Module.symvers information lost and thus unresoloved symbol...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Miscellaneous
Depends on:
Blocks: 232070 232099
  Show dependency tree
Reported: 2008-09-14 11:18 UTC by Peter Volkov (RETIRED)
Modified: 2008-11-05 12:00 UTC (History)
5 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Volkov (RETIRED) gentoo-dev 2008-09-14 11:18:28 UTC
linux-mod eclass builds each module in MODULE_NAMES separately and thus loose Module.symvers information. This problem causes Unresolved symbols if CONFIG_MODVERSIONS enabled and CONFIG_MODULE_FORCE_LOAD disabled. (See madwifi-ng bug 232099).

Take a look at "7.3 Symbols from another external module" section of Documentation/kbuild/modules.txt. madwifi-ng uses top-level Makefile and thus single Module.symvers in default build is created. Because linux-mod eclass builds each module separately, Module.symvers file is created only for first modules: for others modpost fails due to missed symbols and creats empty Module.symvers. During such build you'll see the following warnings:

WARNING: "ieee80211_rate_register" [/var/tmp/portage/net-wireless/madwifi-ng-0.9.4/work/madwifi-0.9.4/ath_rate/onoe/ath_rate_onoe.ko] undefined!

So linux-mod.eclass should somehow preserve symbol version information, but I'm unsure of best solution. One possible solution is to create toplevel Module.symvers and then create symlink on this file in each module directory, like this patch does:
--- linux-mod.eclass    2008-04-03 20:37:30.000000000 +0400
+++ linux-mod.eclass    2008-09-14 14:50:34.000000000 +0400
@@ -497,6 +497,7 @@
        BUILD_TARGETS=${BUILD_TARGETS:-clean module}
        cd "${S}"
+       touch Module.symvers
        for i in ${MODULE_NAMES}
                unset libdir srcdir objdir
@@ -511,6 +512,7 @@
                if [ ! -f "${srcdir}/.built" ];
                        cd ${srcdir}
+                       ln -s "${S}"/Module.symvers Module.symvers
                        einfo "Preparing ${modulename} module"
                        if [[ -n ${ECONF_PARAMS} ]]

But I'm not sure: in case one package build independent modules what single Module.symvers file can cause? It's possible that nothing but it's better to check. I just don't know how to do that. *shrug*
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2008-09-19 07:19:16 UTC
I'm not sure, but this issue became very annoying with 2.6.26 kernel. Thus setting blocker for bug 232070.
Comment 2 Walter Meinl 2008-10-29 21:10:53 UTC
(In reply to comment #0)
Just FYI, the patch for the linux-mod.eclass helped me to build the shared folders kernel module of virtualbox-guest-additions against kernels > 2.6.26 (bug236151)
Comment 3 Daniel Drake (RETIRED) gentoo-dev 2008-11-05 12:00:51 UTC
thanks, committed. hope it doesn't break anything!