From patchwork Fri Apr 12 15:26:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Yeryomin X-Patchwork-Id: 1084794 X-Patchwork-Delegate: jogo@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=advem.lv Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LKa9OEvh"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44ghZM1GK8z9s9h for ; Sat, 13 Apr 2019 01:26:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:Date:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=H19LqsCFkme3zpm4/phrNglXRK/+Ktj0k/ACex0FVQ4=; b=LKa9OEvht2fbfl 6pgWllsmsuXbYa8jtiXUYGGbLaoD5y7miPXpJ5jJvxzrmthGDioSa7c7AWrKfquuX4Be8m9138eRN 337xhCiH42cP+WHq3BolP6+BP7INuK2M6fYydz21Xm8x4ma0V9tXyuMOaOdEddFe5lGMF1PH3PZcO JQ8xEvg3owZX+woIGkdLLHWhCGKwm2BB8dKJzusgw1F/N4yZVn87Gf+pEwlao4hESmXyDzg5bYHW0 cvHh7f4rNqPIm4rrHmQzqsNhkI6C5AURXOTjreaT78HFbcYuY5LIglRkUtk+6yZ6xnpHe4oP4Nr8U jeC5jhR70LUNA4xsQMZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEy4G-00005m-Qx; Fri, 12 Apr 2019 15:26:16 +0000 Received: from [213.175.92.62] (helo=mail.pbx.lv) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEy4C-0008VL-UZ for openwrt-devel@lists.openwrt.org; Fri, 12 Apr 2019 15:26:14 +0000 Received: from localhost.localdomain (unknown [213.175.92.61]) by mail.pbx.lv (MailSystem) with ESMTPSA id B4B4D1A5F2B for ; Fri, 12 Apr 2019 18:26:10 +0300 (EEST) From: Roman Yeryomin To: OpenWrt Development List Date: Fri, 12 Apr 2019 18:26:03 +0300 Message-Id: <20190412152603.25182-1-roman@advem.lv> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_082613_173887_F028D97A X-CRM114-Status: UNSURE ( 6.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.3 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Subject: [OpenWrt-Devel] [PATCH] build: fix external module symbol collection if build_dir is a symlink X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org e26ffb31dfa30d498b963a86d231835e3af7d3df fixed only embedded modules symbol collection. If we are building external modules, like broadcom-wl or lantiq dsl stuff then modules which do EXPORT_SYMBOL have unresolved paths in Module.symvers and external module which depend on other external modules will have empty dependencies, leading to broken module loading. This was discussed on IRC with Jonas some time ago. Fix this by handling both resolved and unresolved paths. Signed-off-by: Roman Yeryomin --- include/kernel.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/kernel.mk b/include/kernel.mk index 3195090a0a..8dfe903bcc 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -141,7 +141,10 @@ endef define collect_module_symvers for subdir in $(PKG_EXTMOD_SUBDIRS); do \ - grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \ + realdir=$$$$(readlink -f $(PKG_BUILD_DIR)); \ + grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \ + [ "$(PKG_BUILD_DIR)" = "$$$$realdir" ] || \ + grep -F $$$$realdir $(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