From patchwork Mon Apr 25 13:17:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102470 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1033766qge; Mon, 25 Apr 2016 06:19:25 -0700 (PDT) X-Received: by 10.98.75.81 with SMTP id y78mr8292380pfa.161.1461590365629; Mon, 25 Apr 2016 06:19:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z127si6790272pfz.158.2016.04.25.06.19.25; Mon, 25 Apr 2016 06:19:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932616AbcDYNTP (ORCPT + 29 others); Mon, 25 Apr 2016 09:19:15 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:59376 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932544AbcDYNTM (ORCPT ); Mon, 25 Apr 2016 09:19:12 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0LwEHK-1bmFfY00GU-0186K1; Mon, 25 Apr 2016 15:17:54 +0200 From: Arnd Bergmann To: Michal Marek Cc: Nicolas Pitre , Rusty Russell , Arnd Bergmann , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] kbuild: call adjust_autoksyms.sh from source directory Date: Mon, 25 Apr 2016 15:17:19 +0200 Message-Id: <1461590265-1397577-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:n2fB5a+4mZxMjVNB6FSTo91aV/ovowsLgwm93g81CaEkXc79FWO hdH3WjvezDfqmBHbO0+OlsG0zGGtun5NVs1UYo4bOLhvUkeXt6EM+Edon9L7Jy7PH/gOtQf q2VhXIjGWykBnD/0rwMtEA1ZPGjJAmt0Iy1SyBXnPS1o8Ri+79pOnWeSvsyriU/5KQsj0nw Kjc4FEEWmy6Z7sjXsOVgQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:uvXh7oUPve4=:LQvINQucNDNEahULI1hRXT V5SqyHpjG0h4YBTSXJfv54PHUe/TCFlW7L+IdOw0a8PbcE4VKxTnfPI6Z/WoR9E/Qy3mcr0E6 kMTYq+gxz7LFFtWiQ7qbSA3MoDUv98sWVqx5ddUHBOW5HMq56I8jBcN4fVWgrgeocd3eRYguj XIf6KMH4WaLbh7QCqzefAvqfGvFTA/Nh1M2DmIq73Mdw1scUzGJgpAWFHNmB7GU5PpBhNJxlj Xk3ooz6dynNijTeC2sC6+DEzucggXRmCDfCgebvlIZlnJb/9f6iC7ISmb+6gQqXN1+Ugw2bQX OoNpeAf0Dmzzmnb04js1Ra63T+GxmUCiaS9T14PZ04N9W1DzkObKL/bhXHcGtLRxIOqA7skhh TWD7or7Y9Ryj8ftaoS5RcDajOzP21UMPN/t4n1nDRkvQ9j092r8tDd2ge2VDhTZUFMkltPN4/ UG05khmaOLe87RJv9mq7+C0ITGhg4aJ8lieAFCUAfafRAdbIHyj64vlDpR9sR9dz/CwSQttA+ yaNsQvQvHg8GZ4W5xIeBA/8Tj8jRvLTofoNoOILYrNDaqxHatZsat8heaCX9JjC18Dn1S01X4 tfGp2JEgbns/VfqHJGMrLPLhY7xtx3hsNgM05xPtfTnmZuiCeENgYbtcxSCqSxa3EuJKYkfca FzE2wEM2q7B5FbupIBfonn0gWNPSkWM5l0162G2YUXjD7nOxqrGLj5ZjsjaCZevWUnDI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with separate object trees, scripts/adjust_autoksyms.sh cannot be called from the object directory: /bin/bash: scripts/adjust_autoksyms.sh: No such file or directory This adds a $(src) prefix, as we do for all other shell scripts. Signed-off-by: Arnd Bergmann Fixes: 23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h") --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.0 diff --git a/Makefile b/Makefile index 81534210dcb9..b5c67617a98d 100644 --- a/Makefile +++ b/Makefile @@ -945,7 +945,7 @@ quiet_cmd_link-vmlinux = LINK $@ # execute if the rest of the kernel build went well. vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE ifdef CONFIG_TRIM_UNUSED_KSYMS - $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \ + $(Q)$(CONFIG_SHELL) $(src)/scripts/adjust_autoksyms.sh \ "$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive" endif ifdef CONFIG_HEADERS_CHECK @@ -960,13 +960,13 @@ endif +$(call if_changed,link-vmlinux) autoksyms_recursive: $(vmlinux-deps) - $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \ + $(Q)$(CONFIG_SHELL) $(src)/scripts/adjust_autoksyms.sh \ "$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive" PHONY += autoksyms_recursive # standalone target for easier testing include/generated/autoksyms.h: FORCE - $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh true + $(Q)$(CONFIG_SHELL) $(src)/scripts/adjust_autoksyms.sh true # Build samples along the rest of the kernel ifdef CONFIG_SAMPLES From patchwork Mon Apr 25 13:17:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102469 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1033770qge; Mon, 25 Apr 2016 06:19:26 -0700 (PDT) X-Received: by 10.66.148.232 with SMTP id tv8mr48403901pab.21.1461590366205; Mon, 25 Apr 2016 06:19:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z127si6790272pfz.158.2016.04.25.06.19.25; Mon, 25 Apr 2016 06:19:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932632AbcDYNTR (ORCPT + 29 others); Mon, 25 Apr 2016 09:19:17 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:51262 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932542AbcDYNTM (ORCPT ); Mon, 25 Apr 2016 09:19:12 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0MR97T-1bHbfd3hFv-00UeuG; Mon, 25 Apr 2016 15:18:54 +0200 From: Arnd Bergmann To: Michal Marek , Jonathan Corbet , Arnd Bergmann , Nicholas Bellinger Cc: Nicolas Pitre , Rusty Russell , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] samples: connector: from Documentation to samples directory Date: Mon, 25 Apr 2016 15:17:20 +0200 Message-Id: <1461590265-1397577-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1461590265-1397577-1-git-send-email-arnd@arndb.de> References: <1461590265-1397577-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:yhzS3IFqBDsXMHXYyw5Y7I4hW49QHtGLtn//vzSADlWYjkiFvNW TpgHOGdlaUnGxI4rB/mZfnVbX9XUdjBLJmKn8APf1RBZCVncOENEGTexfc7toxyHbg45Rxa VfUQB6C5qfz+IsXOuqOi0uHL7mZbsMNh57bmBvolWnVLKsZkBON0oqXEao3SAfUgM5c/C94 ldz0GecRfctwXasL1vEdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:elIbe5gghjg=:/Q38cN20Z1OTw9iz3qYOdn aHpKxnK04vLYZRoPWqhuQiXkP4RfNkci1BNMuZK2RPUwMrti5PcedkpT1yCE+5FbM4fbIdLBC zbxIyyIH7S76lBDzacQaGS5EBz/eddB+/hxQmD+8PrgDbpw3DrWVWrQ/LI2PJGCmZg3D4bVWJ of8GBq7nXkQNszuRCbTgRPjZpxf0XPmuS8mPOHJCG4Im/C79N+Vi6OYPY+KlZZXMeshIlbRJe jyh/Os86Bi2b+FAxLnHE1lIAmL0pF78KVU+aSQIsiDQcANjCqaTLtUe8HqvRzyRVp7BK7dh0t HxgEmDh5ZoGYI42MXvHeI0muO6Vc8vxpmKiE2ODxOY05wsOiK4j9JX97cIdKtV7fnE5pEb29y mQmaHPazX/W/4e3bId00E3vxyy29JoSLw5Q4LuufKDURCPdHxz1MbDFd4vyrAvvrD0oY+LX07 CFbIhk2aUBghazmJ9OUP6vyX6xULnVNFTmc3/5kJf8camTWL9sCkIul4UoACBlZh24kQvG6dF 2RiSHCoNm20hUOSGSrniNzqIgmSdDTF2OkLHdwDtx1mfNwsneIC7lQRCJgfUkYzSOIFZOAZCZ NedY/Y/lqxmInLFBZFRUPf5mcWBSTOAeA3LD21Dye5+KBiXUU5nnkz8z+K4+rSHS0HrT0oYLT 6IedyFT8tgjBQovCfPOr4AdMqSu4n1PsjxuYDsXwlr7qGxa1Ez5ZaE00pb1Jg0iZdQb0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the new autoksyms support, we can run into a situation where the connector sample module is the only one using some exported symbols that get dropped because they are never referenced by the kernel otherwise, causing a build problem: ERROR: "cn_del_callback" [Documentation/connector/cn_test.ko] undefined! ERROR: "cn_add_callback" [Documentation/connector/cn_test.ko] undefined! ERROR: "cn_netlink_send" [Documentation/connector/cn_test.ko] undefined! Specifically, we do look in the samples directory for users of symbols, but not the Documentation directory. This solves the build problem by moving the connector sample into the same directory as the other samples. Signed-off-by: Arnd Bergmann Fixes: 23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h") --- Documentation/Makefile | 2 +- Documentation/connector/connector.txt | 8 ++++++++ samples/Kconfig | 9 +++++++++ samples/Makefile | 2 +- {Documentation => samples}/connector/.gitignore | 0 {Documentation => samples}/connector/Makefile | 6 +++--- {Documentation => samples}/connector/cn_test.c | 0 {Documentation => samples}/connector/ucon.c | 0 8 files changed, 22 insertions(+), 5 deletions(-) rename {Documentation => samples}/connector/.gitignore (100%) rename {Documentation => samples}/connector/Makefile (76%) rename {Documentation => samples}/connector/cn_test.c (100%) rename {Documentation => samples}/connector/ucon.c (100%) -- 2.7.0 diff --git a/Documentation/Makefile b/Documentation/Makefile index 1207d7907650..13b5ae1b87aa 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,4 +1,4 @@ -subdir-y := accounting auxdisplay blackfin connector \ +subdir-y := accounting auxdisplay blackfin \ filesystems filesystems ia64 laptops mic misc-devices \ networking pcmcia prctl ptp timers vDSO video4linux \ watchdog diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt index f6215f95149b..ab7ca897fab7 100644 --- a/Documentation/connector/connector.txt +++ b/Documentation/connector/connector.txt @@ -186,3 +186,11 @@ only cn_test.c test module used it. Some work in netlink area is still being done, so things can be changed in 2.6.15 timeframe, if it will happen, documentation will be updated for that kernel. + +/*****************************************/ +Code samples +/*****************************************/ + +Sample code for a connector test module and user space can be found +in samples/connector/. To build this code, enable CONFIG_CONNECTOR +and CONFIG_SAMPLES. diff --git a/samples/Kconfig b/samples/Kconfig index d54f28c6dc5e..559a58baff6e 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -76,4 +76,13 @@ config SAMPLE_CONFIGFS help Builds a sample configfs interface. +config SAMPLE_CONNECTOR + tristate "Build connector sample -- loadable modules only" + depends on CONNECTOR && m + help + When enabled, this builds both a sample kernel module for + the connector interface and a user space tool to communicate + with it. + See also Documentation/connector/connector.txt + endif # SAMPLES diff --git a/samples/Makefile b/samples/Makefile index 48001d7e23f0..594ef7d9fa2a 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -2,4 +2,4 @@ obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ - configfs/ + configfs/ connector/ diff --git a/Documentation/connector/.gitignore b/samples/connector/.gitignore similarity index 100% rename from Documentation/connector/.gitignore rename to samples/connector/.gitignore diff --git a/Documentation/connector/Makefile b/samples/connector/Makefile similarity index 76% rename from Documentation/connector/Makefile rename to samples/connector/Makefile index d98e4df98e24..04b9622b6f51 100644 --- a/Documentation/connector/Makefile +++ b/samples/connector/Makefile @@ -1,9 +1,9 @@ -ifneq ($(CONFIG_CONNECTOR),) -obj-m += cn_test.o -endif +obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o # List of programs to build +ifdef CONFIG_SAMPLE_CONNECTOR hostprogs-y := ucon +endif # Tell kbuild to always build the programs always := $(hostprogs-y) diff --git a/Documentation/connector/cn_test.c b/samples/connector/cn_test.c similarity index 100% rename from Documentation/connector/cn_test.c rename to samples/connector/cn_test.c diff --git a/Documentation/connector/ucon.c b/samples/connector/ucon.c similarity index 100% rename from Documentation/connector/ucon.c rename to samples/connector/ucon.c