Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp627473imm; Fri, 8 Jun 2018 02:34:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKItrFwyVuxGQzZExBH5+67/2qa1wm8X2l15PcVHmiP4dWNAvB7yn/felw/gxvnhUaGif6FP X-Received: by 2002:a17:902:380c:: with SMTP id l12-v6mr5855916plc.19.1528450450690; Fri, 08 Jun 2018 02:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528450450; cv=none; d=google.com; s=arc-20160816; b=H7H/ty31EZLiJBfGNjhQUfa2GPXMBS9vaGJh2Km0vnzkYfCaIVwRu0e8avOT1fXDO1 1AWkzBu1KyXBELwS7i1aAnmLLS04IGEt0SO46XkDjzioP3VsfcU/H3k0EOcgJIfJGTr3 X1uTPbbzsstHDPNCDX5dunKuKHDz2OkNb6LUU/MKPT7GBBpQxy7jdG2ugVTfxjq0vvt0 1AQzgm6mO9Jg5tohn4Ue53K2MQrp/sc/1jtwy/C0pEC7M1+wyNIk05JUMXEP4pwR629f M1seypRE6FC17nDNJD+Fv79HgqFxEEd846+LSuOITN8ev5C+AwZIUhmasTRDx7BRZY8q MUVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=tQopJyShtz+PUdoLlTtTdzE3Je0Sj1n+dJ2A/LacC+k=; b=faDvDjXyzIjLCsjmmJV8Pgx7d4pOQGAymKuXIwNQOSVPs5J168HhKXA1VgcJbf30i4 gpsRLOKGOkzXHIFW/3JGixxgdEYrU7QttmaGct2hB6PXWc0cHuBPrpZsg0ZAJSIISEm8 YVngptqx5aAaaWwRzBMgGnwHze+cgwsJKCHY97Nb3ZuS5zSj5RqXmQacjZa3ciIlzB3Q BBiE/U3C9sR0dOGglhy76ZXun0ULGRTeL0fC5ykfqgPe9v8RWqJpdBY9pJFBsFJ+mEYg Gmjy3/276W4gjbkfwRNL0OdfZV2fRGR8olKOpcegCE12JKla/dFcwVDgBnsU6Ipt5Dvj VKig== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d90-v6si56732905pld.92.2018.06.08.02.33.56; Fri, 08 Jun 2018 02:34:10 -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 S1752364AbeFHJd3 (ORCPT + 99 others); Fri, 8 Jun 2018 05:33:29 -0400 Received: from www62.your-server.de ([213.133.104.62]:37459 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbeFHJd1 (ORCPT ); Fri, 8 Jun 2018 05:33:27 -0400 Received: from [178.197.248.12] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fRDlk-0007H5-CL; Fri, 08 Jun 2018 11:33:16 +0200 Subject: Re: [PATCH] [net-next, wrong] make BPFILTER_UMH depend on X86 To: Geert Uytterhoeven , Arnd Bergmann , Alexei Starovoitov Cc: "David S. Miller" , Masahiro Yamada , linux-kbuild , netdev , Linux Kernel Mailing List References: <20180528153222.2037158-1-arnd@arndb.de> From: Daniel Borkmann Message-ID: <8c0f8cc4-b919-9b69-4144-fd216253aa24@iogearbox.net> Date: Fri, 8 Jun 2018 11:33:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24643/Fri Jun 8 06:37:57 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On 06/08/2018 10:57 AM, Geert Uytterhoeven wrote: > On Mon, May 28, 2018 at 5:31 PM, 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. > > So that was done in commit 819dd92b9c0bc7bc ("bpfilter: switch to CC > from HOSTCC"), but it is not sufficient: > > GEN net/bpfilter/bpfilter_umh.o > Usage: m68k-linux-gnu-objcopy [option(s)] in-file [out-file] > Copies a binary file, possibly transforming it in the process > The options are: > [...] > > net/bpfilter/Makefile:29: recipe for target 'net/bpfilter/bpfilter_umh.o' failed > make[5]: *** [net/bpfilter/bpfilter_umh.o] Error 1 > >> --- 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 > > No, (currently) it does depend on X86, due to its use of: > > $(OBJCOPY) -I binary -O $(CONFIG_OUTPUT_FORMAT) > > with CONFIG_OUTPUT_FORMAT being defined on X86 only... That hard dependency should have been fixed with the following patch in -net tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=8d97ca6b6755bf7ef57d323642ca9ee80d689782 Thanks, Daniel