Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp596232imm; Fri, 8 Jun 2018 01:57:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKd/JaG6Hh0FpGL7uWXgIxT0apDRlr1A55Np+X2HAjIbVqJHj1WybssutbGOenWAyvMuzg/ X-Received: by 2002:a62:4255:: with SMTP id p82-v6mr5144213pfa.227.1528448273552; Fri, 08 Jun 2018 01:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528448273; cv=none; d=google.com; s=arc-20160816; b=Td8FGZRiX+NxdI+kyHA5a7/YLkBubeMPJ6VcUwHQmm5SWGiImhPXItE/bxEPqK3R2V EK1mF/2QYyNuIYpfr7wN9AdcjbVPFjqn1ZA+OQrkiAXLwDLgrYIyTEizSrZr9Mt3tUZo yHlc/i8uo9QTyQg81YKEofVW/l9cF4PNuQAQfPrKviR3sovVGNH6dpZaFDmNGo5Uj77z 0/35Im/CJETMjtRAc74R0gSwWXRwAA5uPbp1iu4EkEV7J02zjfjvhYTYWvHgY3wdCOwK Es7w+bSKzVyZBOvibbda2tRFAX/ZeUOjk7d3xKTpHIUL2uFooLiuYGOSb48N09cjYr+H 8M5Q== 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 :arc-authentication-results; bh=dNwv5UCTFoHmjNaGlxWj7DZXWL5saowvS0MX539AhAE=; b=XhHxGZgoeJAx68v/13tzEWEeYMtXuju5OV4lKWMn9yudhf2qM9oh/7B7vjEE7qjSnt SyIZIGp74y47nkztsYduFWyDSOzT5f8np+UDJ/mIHkrZVcYLbjW1GDjPhGEQ5aeXCuUp dFrSNVmp8bDV+neK5X29vWUh7vK/Amd5FcQy56eabmixNbtJiPVO8CKT3VJQBQBs8F3N 94WT/4Fqw6+T7CH9H06d8IhTKmqFbbx2fPwMfNlQFoER7+UoSwwwKhPt7aAKsCH6SENS CErh1W7ZMB0J1l6Rc7v6zBgYpDSAbmCeUy5c5xy7Rz0YnQobEhUIiUcQZ1n39rFPsMwj 50Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aTAdupVf; 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 o14-v6si43937018pgc.664.2018.06.08.01.57.38; Fri, 08 Jun 2018 01:57:53 -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=fail header.i=@gmail.com header.s=20161025 header.b=aTAdupVf; 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 S1751101AbeFHI5M (ORCPT + 99 others); Fri, 8 Jun 2018 04:57:12 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:35289 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbeFHI5J (ORCPT ); Fri, 8 Jun 2018 04:57:09 -0400 Received: by mail-ua0-f196.google.com with SMTP id s13-v6so4949606uad.2; Fri, 08 Jun 2018 01:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dNwv5UCTFoHmjNaGlxWj7DZXWL5saowvS0MX539AhAE=; b=aTAdupVfMcyDbT2u2IpMG6spoqoadP22l8a2+cJqmtHbG4PIed5TvWofjiCsFM6luY 2rUwRGv63QYov1GSFVgT8Vv9dBmWkGO21dxTi9znEvM4PaC30NVaJi2vCnB7tJXMMQYR eRp+0ivaMZfdsavLRZjioOGOBL2jqC4/oB1VTvkZnKxlCmvtX9NRjIAa5CJ7TQUSn0mS +HNqMK7tsyELAN2Wsx4yF41h9GCPPeHOKN5uFZpLMcP46GVOV4s2SRAPS+j14RB4bWmc Kd4r2Hqf4kwOPXxojLzm2PpHL+cLIvQxEntPmYPuoYczY4rV++/Q5cnpP+de5FKKNHW1 NbSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dNwv5UCTFoHmjNaGlxWj7DZXWL5saowvS0MX539AhAE=; b=BEepdTJ0xSnPKtPxyuVmXo2pae/f9UNJ9cx/seqND5euwG6I9G0eB4P+cIdXLhrHbj /y4KB1xR2MWiUgmcHQZ0Nuyywjgac0VxkjDZbKGsP11mEPxX00n8PhjaZBPmn+/g5QUc g3Zxb7X8eLiKMvN6yDTf7Aly0GH/vJLrU87Q5sciUYEAlPmjIzw6Fgy8exufz7fha1Ha Qgp3CJwU2vf9VJVJp/0vR/HLRkAHX5KAKDOfguXnJUHPtu2FECPrnztu2QWcAIhu0VjJ NaffdaocnfOyJ1shsUcAgHb7tvD1Q85l/0gEYDkddEiJnz/pxgrfJB7cpeK49MkajA4T JjBw== X-Gm-Message-State: APt69E2aOcEsBhTus5ROeFJQjkhxcikILD3UXyEXM9KYrAgiOB0YTq0j JGYxhiBtS8sJdmaH5xGZdVKVQ9mHjVHrp3xFHtM= X-Received: by 2002:ab0:48e1:: with SMTP id y30-v6mr3583535uac.180.1528448228281; Fri, 08 Jun 2018 01:57:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8596:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 01:57:07 -0700 (PDT) In-Reply-To: <20180528153222.2037158-1-arnd@arndb.de> References: <20180528153222.2037158-1-arnd@arndb.de> From: Geert Uytterhoeven Date: Fri, 8 Jun 2018 10:57:07 +0200 X-Google-Sender-Auth: BWnB_qLUXXQWdPb_PxrjJmRAhtU Message-ID: Subject: Re: [PATCH] [net-next, wrong] make BPFILTER_UMH depend on X86 To: Arnd Bergmann , Alexei Starovoitov Cc: "David S. Miller" , Masahiro Yamada , linux-kbuild , netdev , 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 Hi Arnd, Alexei, 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... > default m > help > This builds bpfilter kernel module with embedded user mode helper Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds