Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752012AbbG2QbG (ORCPT ); Wed, 29 Jul 2015 12:31:06 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:34519 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbbG2QbE convert rfc822-to-8bit (ORCPT ); Wed, 29 Jul 2015 12:31:04 -0400 MIME-Version: 1.0 In-Reply-To: <20150729161912.GF18685@windriver.com> References: <20150729161912.GF18685@windriver.com> Date: Wed, 29 Jul 2015 18:31:02 +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: 1868 Lines: 45 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 This will put the sanitized headers in your local kernel tree "./usr/". This is preferred over "/usr" as include path for the kernel examples, hence, everything should work fine then. The kernel samples/ directory is explicitly used for example programs for the kernel. Hence, I think it is quite fine to use new kernel features. Same applies to the selftests. I'd be fine making kdbus-workers a no-op program if __NR_memfd_create is not defined. But I'm not really sure that fixes real problems. I mean, new samples and selftests will be added by other subsystems and those might as well require new kernel headers. Thanks David -- 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/