[source] build: fix module symbol collection if build_dir is a symlink

LEDE Commits lede-commits at lists.infradead.org
Wed Nov 8 06:16:53 PST 2017


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/e26ffb31dfa30d498b963a86d231835e3af7d3df

commit e26ffb31dfa30d498b963a86d231835e3af7d3df
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Nov 3 10:59:00 2017 +0100

    build: fix module symbol collection if build_dir is a symlink
    
    If PKG_BUILD_DIR contains symlinks, the generated Module.symvers will
    contain the resolved paths, not the virtual path with the symlink name.
    
    This breaks the filter for the module's own symbols, so to fix this
    ensure we also grep for the resolved path.
    
    Reported-by: Roman Yeryomin <roman at advem.lv>
    Tested-by: Roman Yeryomin <roman at advem.lv>
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 include/kernel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 92136f4..8cb0def 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -135,7 +135,7 @@ endef
 
 define collect_module_symvers
 	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
-		grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
+		grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
 	done; \
 	sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \
 	mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers



More information about the lede-commits mailing list