Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 237618

Summary: linux-mod.eclass: Module.symvers information lost and thus unresoloved symbols if MODVERSIONS enabled
Product: Gentoo Linux Reporter: Peter Volkov (RETIRED) <pva>
Component: [OLD] UnspecifiedAssignee: Gentoo Kernel Miscellaneous <kernel-misc>
Status: RESOLVED FIXED    
Severity: normal CC: gengor, ikelos, patrizio.bassi, swapon, wuno
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 232070, 232099    

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}
        strip_modulenames;
        cd "${S}"
+       touch Module.symvers
        for i in ${MODULE_NAMES}
        do
                unset libdir srcdir objdir
@@ -511,6 +512,7 @@
                if [ ! -f "${srcdir}/.built" ];
                then
                        cd ${srcdir}
+                       ln -s "${S}"/Module.symvers Module.symvers
                        einfo "Preparing ${modulename} module"
                        if [[ -n ${ECONF_PARAMS} ]]
                        then
===============================================================================

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!