Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4589291imm; Wed, 30 May 2018 08:18:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKNDcR6RPCz6A1xZtWrLvhvSpMQ2YNTdV/3zgbJYPb5ZzG/Ih5a3vji0b4LBhFtyN04NNsa X-Received: by 2002:a63:a902:: with SMTP id u2-v6mr2545929pge.169.1527693505733; Wed, 30 May 2018 08:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527693505; cv=none; d=google.com; s=arc-20160816; b=teIUv6J3ZuvBG63U8qer6wOuioFxDZpyxGW45NReAirAtA1lhNdTsKxpUyAisHUkE2 vHF9DwL96NtvG/F5OUQZnIaIc1pvs2Azxvr2+4DzvRLRXxpVtJwxwilfpToHAEJSsBqP edOLNshICUHQjkBwQOFWqTd6nx8EStcdTJ91iU/z8OnFHxnfAtJBlFsmQKWbb1kPTU4y PIj8jz8jsYAr/kE2+Z86480mqDYOZf0gVacjz27FIrKKjatXPyW+tehs/JFgYig1Ywcv P5fkVYz7dGrcubHzQ3/F/pWDWMb0wzFXtnSmzVnylRfc6jXV/ArYGszolvoJnEmWp8jR T7mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CQ8kMNDob8nJ1NlgkjQMZt9zUpblT6HsW+ZXJnlaZfI=; b=VtUW3av8+YkQsPrJhAUnJweqSC6a1PzXKQaZFLe8LQ33gcFc+bV9a7pI2f4DME8X+Y +LItL76cdCVusTkJUqUJr9W+rbyjW/dVnkeASiQ/3l5EBaPgUuJBKDVlcuZAKAHknaAL +ivLPUtpfC3nvHcLJKTTCvdFju6o7S+BF2xE9iN/0SPlxynYbpHgvig8p8sUhM2A41Kb jurRbzVKIaLwczSfYz9vXK0KZtSrOse9ItWtZ6WIzmv4fa66ziyVJi1xz0lP7NKf235i fq1+2mLTsknPV+WFeJLhVELI9+GczBWYfDMlBm+T0+w3u68/CxJunmGrSI9xYj6/Hpiu UFyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aHNdWjQS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4-v6si33364042pfm.110.2018.05.30.08.18.11; Wed, 30 May 2018 08:18: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aHNdWjQS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753904AbeE3PRt (ORCPT + 99 others); Wed, 30 May 2018 11:17:49 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34769 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753666AbeE3PRn (ORCPT ); Wed, 30 May 2018 11:17:43 -0400 Received: by mail-pl0-f66.google.com with SMTP id ay10-v6so11287859plb.1; Wed, 30 May 2018 08:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CQ8kMNDob8nJ1NlgkjQMZt9zUpblT6HsW+ZXJnlaZfI=; b=aHNdWjQSzYPPnS7pjSi/vQY8sGbcmE5nQLAHrgQoFv69SVzBSZtXZCyRWh4J62qzzD HJv/MHS9bEYGc0GQ8NJZwY1DnlPmu7qhVBZ9Yb+ny5udP/ILScciErX8mkFQY9mCajuq gyoegFPx2u0QIX6lx68XQXDjaFZNUUWeRFRLAhkP3iW4nLF7Psq1adItSuV8VjZSnaJP PbS6A0xVspeaQlCN6HEBM9SevgIkjfv3nGt6uEtYFhwQSMMbW1ytL4TMPngGxCfvfG14 5180BhDzp3BN8wgUUouOUmSAihkcB/tCz19/yQAm3wcam2ox9lhLufMENCGHcCijAILx lJTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CQ8kMNDob8nJ1NlgkjQMZt9zUpblT6HsW+ZXJnlaZfI=; b=TfcwMTW0ZIHZYfbrDbDOfKelSzCapSUB3JQ2QSJTGSVPf/mCGNqEXPfVnNehnRCIru t5QNgSDzbky3izDuxfE76u37DOYRGTK92SnCIOzotGQpg5LtKqGwAaNyObwbmnlD68z5 Ny2Y/5eeE4z7ChigUNUZJNkmxloMg6Tz7za4xNb49eCbQ89f9pWxKR/mW/J48fYjHPjv cjIIEA0oUL9UHdg9j3744wXdWwyjX9UqNQzFvJAlq4oZQnZoz6gGXYtpanqeDvFk1Lym WwcC0HxAKoIu81JTG1tIUHWkhwaPEyofBTymlfqoaW3xeFvTPfbCVjkwR8HouFMi9hfq aDiQ== X-Gm-Message-State: ALKqPwdc3DFMUwj1IW3jK3TU+jDhV9feJfPlZMWBk5O7O9GeG2kwM+zZ 2iDTR9cHH2zXuioPmdnW8VA= X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr3330001plr.323.1527693462437; Wed, 30 May 2018 08:17:42 -0700 (PDT) Received: from ast-mbp ([2620:10d:c090:180::1:862f]) by smtp.gmail.com with ESMTPSA id m11-v6sm43702528pgv.48.2018.05.30.08.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 08:17:41 -0700 (PDT) Date: Wed, 30 May 2018 11:17:38 -0400 From: Alexei Starovoitov To: Arnd Bergmann Cc: "David S. Miller" , Alexei Starovoitov , Masahiro Yamada , linux-kbuild@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [net-next, wrong] make BPFILTER_UMH depend on X86 Message-ID: <20180530151736.nzpde2bgzn4koi7f@ast-mbp> References: <20180528153222.2037158-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180528153222.2037158-1-arnd@arndb.de> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.