Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp99873imm; Wed, 30 May 2018 18:44:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLdF47GF/DMtJKOd2fUz/X8pQNBJiPtZAeg+iZV1fz2TVzkQMKfr0zlNAfeB0JLXWK9DQPy X-Received: by 2002:a62:ed12:: with SMTP id u18-v6mr4957960pfh.127.1527731046301; Wed, 30 May 2018 18:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527731046; cv=none; d=google.com; s=arc-20160816; b=F6mqdjoiH4bLw5lAIlAJPWiSSnXIbI2YGyEfYY6V7ghIAL3kbIAxnirHPUtcgN/pXb 3sUctmtkX45bGAqNlF5Zo51K54Wci6OINc1IQ/izRnhvzJryx31Eegv+Ys1cR49Z+/PS Yk2Z5gf+7Pws8hmbCMkQQJnskuUklcVSLOJCQqpOP4DKymuGVgzQXJOtZLpKgyRCuJM5 vcUwPJbmJy6thtZPwxOcAf0LuQxzyScHQU2GHkZRTjv0ODhWs8DVQFDRHGWx5FqSrcMK K/hQtXI2gPX51XMpfjoJtN2sA6qxdb6CFwU4GZ2QOXTzO5pxntyQJtyVu1L/pe/8aUvZ UHoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=/BKs3rSymJhLwvvQ32va2uu4QxBM2tUtK5/bCKoclx4=; b=skIvCK1ow5YNma3E7Ub+Z+wfjKaqsrEkWjHWUQvIBJtsqBjLyjS33kUdjHs+jZDOwd c5xtPrUXBzEjHBaBc+xkLZ3iK4aEY7QWWKeHVF+Yshr/WFvOYmIwvHJvAQv2LL0dd/3r TPzy3KE/06LiynEYgaJ6hOJInynBWNaO9tpLYB0Ai1wsfOXeqP8rR52fI51KgR9XnFvs bhgMPGddyMio6g/Ij3jyu08WngmZeRcvNCF1Yq8E4D4dEFfIAc06efHVREWmNwSn3txq +USPh+2A30fRicLuZ0Wjr9fyP37VV8Ew+SHfNdqPO/uD5mxmKqCkjERPoAJ6Mg2OUl1r u50w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DkEwSjux; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si35830831plr.454.2018.05.30.18.43.49; Wed, 30 May 2018 18:44:06 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DkEwSjux; 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 S932656AbeEaBnV (ORCPT + 99 others); Wed, 30 May 2018 21:43:21 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:46750 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932593AbeEaBnT (ORCPT ); Wed, 30 May 2018 21:43:19 -0400 Received: from mail-vk0-f46.google.com (mail-vk0-f46.google.com [209.85.213.46]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w4V1h596029242; Thu, 31 May 2018 10:43:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w4V1h596029242 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527730986; bh=/BKs3rSymJhLwvvQ32va2uu4QxBM2tUtK5/bCKoclx4=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=DkEwSjux4tr3dLo5b9IFpSU0/nAO+QPMJcyfni7WyUuH92qAeyJdwD6z3fMmFInUD L6nT6M0xPbfWezo3LSR+TTOUakJPYw2jSCon+MIO1vXy2nsKAEWQLhqngmJ3YN6X7V kWZfOsIvQbaV2Sj70t+hu/TM8DI6PhYvU0lT0/VgkGMXJV8FxeI+Ip9GDEFHzi3ofv IwT/Pf10BcTYtBiBntlQo0TDmRQKhX4/hij3cQx7q02Q/2rpY03K5rR/vXzQnlfSxx UsTcNxDZh4cJHthwQcbWrao1Pn/q7Zni352lgfJWr29s8qKj9cEyAE3d83uLG4nq+G WJc9MwF9ADybA== X-Nifty-SrcIP: [209.85.213.46] Received: by mail-vk0-f46.google.com with SMTP id n134-v6so12348211vke.12; Wed, 30 May 2018 18:43:06 -0700 (PDT) X-Gm-Message-State: ALKqPwfIMbe/hz3xMFoeaWh1xmZw3c0jVghIWdHByMGsC8yjF/CuzTc/ rdbuWZgu5ArxI9eg3tupofJVREgNDMRvxrG+Y2A= X-Received: by 2002:a1f:2f8a:: with SMTP id v132-v6mr3084562vkv.34.1527730985034; Wed, 30 May 2018 18:43:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:20ab:0:0:0:0:0 with HTTP; Wed, 30 May 2018 18:42:24 -0700 (PDT) In-Reply-To: <20180530151736.nzpde2bgzn4koi7f@ast-mbp> References: <20180528153222.2037158-1-arnd@arndb.de> <20180530151736.nzpde2bgzn4koi7f@ast-mbp> From: Masahiro Yamada Date: Thu, 31 May 2018 10:42:24 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [net-next, wrong] make BPFILTER_UMH depend on X86 To: Alexei Starovoitov Cc: Arnd Bergmann , "David S. Miller" , Alexei Starovoitov , Linux Kbuild mailing list , netdev@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-31 0:17 GMT+09:00 Alexei Starovoitov : > On Mon, May 28, 2018 at 05:31:01PM +0200, Arnd Bergmann wrote: >> When build testing across architectures, I run into a build error on >> all targets other than X86: >> >> gcc-8.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objdump: net/bpfilter/bpfilter_umh: File format not recognized >> gcc-8.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy:net/bpfilter/bpfilter_umh.o: Invalid bfd target >> >> The problem is that 'hostprogs' get built with 'gcc' rather than >> '$(CROSS_COMPILE)gcc', and my default gcc (as most people's) targets x86. >> >> To work around it, adding an X86 dependency gets randconfigs building >> again on my box. >> >> Clearly, this is not a good solution, since it should actually work fine >> when building native kernels on other architectures but that is now >> disabled, while cross building an x86 kernel on another host is still >> broken after my patch. >> >> What we probably want here is to try out if the compiler is able to build >> executables for the target architecture and not build the helper otherwise, >> at least when compile-testing. No idea how to do that though. >> >> Link: http://www.kernel.org/pub/tools/crosstool/ >> Cc: Masahiro Yamada >> Cc: linux-kbuild@vger.kernel.org >> Signed-off-by: Arnd Bergmann >> --- >> net/bpfilter/Kconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/net/bpfilter/Kconfig b/net/bpfilter/Kconfig >> index 60725c5f79db..61cc4fcbb4d0 100644 >> --- a/net/bpfilter/Kconfig >> +++ b/net/bpfilter/Kconfig >> @@ -9,6 +9,7 @@ menuconfig BPFILTER >> if BPFILTER >> config BPFILTER_UMH >> tristate "bpfilter kernel module with user mode helper" >> + depends on X86 # actually depends on native builds > > depends on X86 will break it on arm. > I think the better short term fix would be to test that HOSTCC == CC > It doesn't have to be the same compiler. HOSTCC's arch == kernel ARCH > Not sure how to hack makefile to do that. > Long term we need to get rid of HOSTCC dependency. > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Hmm. For cross-compiling, we set 'ARCH' via the environment variable or the command line. ARCH is not explicitly set, the top-level Makefile sets it to $(SUBARCH) ARCH ?= $(SUBARCH) Maybe, we can assume the native build if $(ARCH) and $(SUBARCH) are the same? -- Best Regards Masahiro Yamada