瀏覽代碼

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 <[email protected]>
Tested-by: Roman Yeryomin <[email protected]>
Signed-off-by: Jonas Gorski <[email protected]>
Jonas Gorski 8 年之前
父節點
當前提交
e26ffb31df
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/kernel.mk

+ 1 - 1
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