Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514AbbG3OXz (ORCPT ); Thu, 30 Jul 2015 10:23:55 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:33130 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbbG3OXy convert rfc822-to-8bit (ORCPT ); Thu, 30 Jul 2015 10:23:54 -0400 MIME-Version: 1.0 In-Reply-To: <55BA2B91.5070107@windriver.com> References: <20150729161912.GF18685@windriver.com> <55BA2B91.5070107@windriver.com> Date: Thu, 30 Jul 2015 16:23:52 +0200 Message-ID: Subject: Re: samples/kdbus/kdbus-workers.c and cross compiling MIPS From: David Herrmann To: Paul Gortmaker Cc: David Herrmann , Greg Kroah-Hartman , Daniel Mack , Djalal Harouni , linux-mips@linux-mips.org, linux-kernel , "linux-next@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2588 Lines: 69 Hi On Thu, Jul 30, 2015 at 3:50 PM, Paul Gortmaker wrote: > On 2015-07-29 12:31 PM, David Herrmann wrote: >> Hi >> >> On Wed, Jul 29, 2015 at 6:19 PM, Paul Gortmaker >> wrote: >>> Hi David, >>> >>> Does it make sense to build this sample when cross compiling? >>> >>> The reason I ask is that it has been breaking the linux-next build of >>> allmodconfig for a while now, with: >>> >>> HOSTCC samples/kdbus/kdbus-workers >>> samples/kdbus/kdbus-workers.c: In function ‘prime_new’: >>> samples/kdbus/kdbus-workers.c:934:18: error: ‘__NR_memfd_create’ undeclared (first use in this function) >>> p->fd = syscall(__NR_memfd_create, "prime-area", MFD_CLOEXEC); >>> ^ >>> samples/kdbus/kdbus-workers.c:934:18: note: each undeclared identifier is reported only once for each function it appears in >>> scripts/Makefile.host:91: recipe for target 'samples/kdbus/kdbus-workers' failed >>> make[2]: *** [samples/kdbus/kdbus-workers] Error 1 >> >> mips does have this syscall, so I assume the problem is out-of-date >> kernel headers. You can fix this by running: >> >> $ make headers_install > > No, let me try and clarify. Please note the emphasis on cross compiling > and automated build coverage, i.e. there is no place for manual steps. User-space samples in ./samples/ are compiled with HOSTCC, which is the compiler for the _local_ machine. Regardless of cross-compiling the same local compiler is used. So I cannot understand why this is even remotely related to cross compiling. Please elaborate. Please note that this is HOSTCC running, so it does *NOT* require the toolchain for your cross-compiled architecture. Also, please tell me why your system has "linux/memfd.h" available, but __NR_memfd_create is undefined? Anyway, patch is attached. Can you verify it works? David diff --git a/samples/kdbus/Makefile b/samples/kdbus/Makefile index 137f842..dbd9de8 100644 --- a/samples/kdbus/Makefile +++ b/samples/kdbus/Makefile @@ -1,9 +1,13 @@ # kbuild trick to avoid linker error. Can be omitted if a module is built. obj- := dummy.o +ifndef CROSS_COMPILE + hostprogs-$(CONFIG_SAMPLE_KDBUS) += kdbus-workers always := $(hostprogs-y) HOSTCFLAGS_kdbus-workers.o += -I$(objtree)/usr/include HOSTLOADLIBES_kdbus-workers := -lrt + +endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/