Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2411143ybk; Mon, 11 May 2020 21:37:35 -0700 (PDT) X-Google-Smtp-Source: APiQypIDTlQ3MMCc20KqOEllcRnLkav7HCLCnmtWykSwfzDh3TLbFXwNzUTjMEnm7xvtSfTQdz9+ X-Received: by 2002:aa7:d783:: with SMTP id s3mr16843541edq.64.1589258255322; Mon, 11 May 2020 21:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589258255; cv=none; d=google.com; s=arc-20160816; b=Tcl67fGZ585YEL9CI9f4SbDlJVgwCiy9FaOHWdMqZUnOsCfLG6/sMSaXwsSOP8E2JM 6ilB24E6RxIvGGL8wU/B3TaEjbRSbbZPeMWWFlLhBQRdPMoolUhTBECNlIZLZV/gsb9p dkNYIvoit404EIgA5zfPI7NH90JXUt04LmINwcrlo4uAq3F2QtI5sO5yD1fcu58y/QsY xP/g4M9QPdLbvez5lc2v+JCvFp4nfhZFaGwCvH8oKYZsBTXaFMK7nAaEKB96EaQqLa/Y gRlyV3O9UdzKL7VEFaVkxvV9nMM0qmGHZJGhsB02rpv9NchLCxQqK329M32IEzXlvdQM 19MA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=Zc/JMr1NeOPCLi6khUpFKWNc1X+NiHrIEKTM+sXYRac=; b=NATSecd6cKI02KNq1bmR4B0sCcwbRbya//TJksKpeQ5WBT8KKbin4+MtE3NIpCZXX1 oADjKlfIzI0e8gheOGXJ3XMNpSpfiPTFPLoHvW2tficLqyo5eWUj3t2hK2RIzLknTEJa fxevmNOrGQ1KT+kVdfK49TM+wjC5K3ckVkW98p2codswY+ffZZl5R8/lfHdiYIjAJOko zVSrZR0bV3FskVbVOqXjjpZ/dG14efLqFM6euFYFzHzHZE45yVU8Iy3VKTlmiWRlh0Tl +P8Lo6OFO2myFgDot/OhS/OBfsC7fH1S7X1ktpFvjZv5fpXA1w8NCBGNPAfQ7tvebbl4 pedA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=OzCtvM8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si5196256edb.81.2020.05.11.21.37.11; Mon, 11 May 2020 21:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=OzCtvM8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbgELEfc (ORCPT + 99 others); Tue, 12 May 2020 00:35:32 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:51674 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgELEfb (ORCPT ); Tue, 12 May 2020 00:35:31 -0400 Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 04C4ZD5O021118; Tue, 12 May 2020 13:35:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 04C4ZD5O021118 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1589258114; bh=Zc/JMr1NeOPCLi6khUpFKWNc1X+NiHrIEKTM+sXYRac=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OzCtvM8GvN+ZCB9+p3csGiC6IRilbuwymmBCLGcc76Cz9/37L/J3fiKkMNf/lA1tn 4sxxOLBqlaN0Q4IQhWZ3ekzi1Cz7UipBjcIeUVkanSFKbO9lyX05G+/YvHWFYqiYEI nAsSzQiC9Dcmy/X+0Z/qTKUXzukEWFMe67ryY/cCRQqh3MMM+/BqES6MfxcEilKSyv PmBsdZHMjZEaivKIkq9Pa1kUCdTXX6ZEtEnHv6D4yvVxAidPYEK51bwzKnl+pwWQ5u IFsgNrK4pEr0gCeOvhaa2pXQIrHaNcJXcVwewWqhNtyfhObovt+l3WD5BSp2g9jg6B DOkjcGfdU1TIg== X-Nifty-SrcIP: [209.85.217.44] Received: by mail-vs1-f44.google.com with SMTP id x6so7089776vso.1; Mon, 11 May 2020 21:35:13 -0700 (PDT) X-Gm-Message-State: AOAM531+2VMzlg1Mg5BeOo3JNWwuWSw1sMPrDNs2DyRUQMUqIqDn3ZAW 1Q2pTBKnwlG7Czl8GbDOcKqeWY8C67L5mmp55/o= X-Received: by 2002:a67:d00e:: with SMTP id r14mr3327265vsi.215.1589258112774; Mon, 11 May 2020 21:35:12 -0700 (PDT) MIME-Version: 1.0 References: <20200429034527.590520-1-masahiroy@kernel.org> In-Reply-To: <20200429034527.590520-1-masahiroy@kernel.org> From: Masahiro Yamada Date: Tue, 12 May 2020 13:34:36 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/15] kbuild: support 'userprogs' syntax To: Linux Kbuild mailing list Cc: bpf , Arnd Bergmann , Sam Ravnborg , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 12:45 PM Masahiro Yamada wro= te: > > > Several Makefiles use 'hostprogs' to build programs for the host > architecture where it is not appropriate to do so. > This is just because Kbuild lacks the support for building programs > for the target architecture. > > This series introduce 'userprogs' syntax and use it from > sample and bpf Makefiles. > > Sam worked on this in 2014. > https://lkml.org/lkml/2014/7/13/154 > > He used 'uapiprogs-y' but I just thought the meaning of > "UAPI programs" is unclear. > > Naming the syntax is one of the most difficult parts. > > I chose 'userprogs'. Anothor choice I had in my mind was 'targetprogs'. > > You can test this series quickly by 'make allmodconfig samples/' > > When building objects for userspace, [U] is displayed. > > masahiro@oscar:~/workspace/linux$ make allmodconfig samples/ All applied to linux-kbuild. > [snip] > AR samples/vfio-mdev/built-in.a > CC [M] samples/vfio-mdev/mtty.o > CC [M] samples/vfio-mdev/mdpy.o > CC [M] samples/vfio-mdev/mdpy-fb.o > CC [M] samples/vfio-mdev/mbochs.o > AR samples/mei/built-in.a > CC [U] samples/mei/mei-amt-version > CC [U] samples/auxdisplay/cfag12864b-example > CC [M] samples/configfs/configfs_sample.o > CC [M] samples/connector/cn_test.o > CC [U] samples/connector/ucon > CC [M] samples/ftrace/ftrace-direct.o > CC [M] samples/ftrace/ftrace-direct-too.o > CC [M] samples/ftrace/ftrace-direct-modify.o > CC [M] samples/ftrace/sample-trace-array.o > CC [U] samples/hidraw/hid-example > CC [M] samples/hw_breakpoint/data_breakpoint.o > CC [M] samples/kdb/kdb_hello.o > CC [M] samples/kfifo/bytestream-example.o > CC [M] samples/kfifo/dma-example.o > CC [M] samples/kfifo/inttype-example.o > CC [M] samples/kfifo/record-example.o > CC [M] samples/kobject/kobject-example.o > CC [M] samples/kobject/kset-example.o > CC [M] samples/kprobes/kprobe_example.o > CC [M] samples/kprobes/kretprobe_example.o > CC [M] samples/livepatch/livepatch-sample.o > CC [M] samples/livepatch/livepatch-shadow-mod.o > CC [M] samples/livepatch/livepatch-shadow-fix1.o > CC [M] samples/livepatch/livepatch-shadow-fix2.o > CC [M] samples/livepatch/livepatch-callbacks-demo.o > CC [M] samples/livepatch/livepatch-callbacks-mod.o > CC [M] samples/livepatch/livepatch-callbacks-busymod.o > CC [M] samples/rpmsg/rpmsg_client_sample.o > CC [U] samples/seccomp/bpf-fancy.o > CC [U] samples/seccomp/bpf-helper.o > LD [U] samples/seccomp/bpf-fancy > CC [U] samples/seccomp/dropper > CC [U] samples/seccomp/bpf-direct > CC [U] samples/seccomp/user-trap > CC [U] samples/timers/hpet_example > CC [M] samples/trace_events/trace-events-sample.o > CC [M] samples/trace_printk/trace-printk.o > CC [U] samples/uhid/uhid-example > CC [M] samples/v4l/v4l2-pci-skeleton.o > CC [U] samples/vfs/test-fsmount > CC [U] samples/vfs/test-statx > samples/vfs/test-statx.c:24:15: warning: =E2=80=98struct foo=E2=80=99 dec= lared inside parameter list will not be visible outside of this definition = or declaration > 24 | #define statx foo > | ^~~ > CC [U] samples/watchdog/watchdog-simple > AR samples/built-in.a > > Changes for v2: > - Fix ARCH=3Di386 build error for bpfilter_umh > - Rename 'user-ccflags' to 'userccflags' > because 'user-ccflags' would conflict if an object > called 'user.o' exists in the directory. > - Support 'userldflags' > > Masahiro Yamada (14): > bpfilter: match bit size of bpfilter_umh to that of the kernel > kbuild: add infrastructure to build userspace programs > bpfilter: use 'userprogs' syntax to build bpfilter_umh > samples: seccomp: build sample programs for target architecture > kbuild: doc: document the new syntax 'userprogs' > samples: uhid: build sample program for target architecture > samples: hidraw: build sample program for target architecture > samples: connector: build sample program for target architecture > samples: vfs: build sample programs for target architecture > samples: pidfd: build sample program for target architecture > samples: mei: build sample program for target architecture > samples: auxdisplay: use 'userprogs' syntax > samples: timers: use 'userprogs' syntax > samples: watchdog: use 'userprogs' syntax > > Sam Ravnborg (1): > samples: uhid: fix warnings in uhid-example > > Documentation/kbuild/makefiles.rst | 183 +++++++++++++++++++++-------- > Makefile | 13 +- > init/Kconfig | 4 +- > net/bpfilter/Makefile | 11 +- > samples/Kconfig | 26 +++- > samples/Makefile | 4 + > samples/auxdisplay/Makefile | 11 +- > samples/connector/Makefile | 12 +- > samples/hidraw/Makefile | 9 +- > samples/mei/Makefile | 9 +- > samples/pidfd/Makefile | 8 +- > samples/seccomp/Makefile | 42 +------ > samples/timers/Makefile | 17 +-- > samples/uhid/.gitignore | 2 + > samples/uhid/Makefile | 9 +- > samples/uhid/uhid-example.c | 4 +- > samples/vfs/Makefile | 11 +- > samples/watchdog/Makefile | 10 +- > scripts/Makefile.build | 6 + > scripts/Makefile.clean | 2 +- > scripts/Makefile.userprogs | 45 +++++++ > usr/include/Makefile | 4 + > 22 files changed, 267 insertions(+), 175 deletions(-) > create mode 100644 samples/uhid/.gitignore > create mode 100644 scripts/Makefile.userprogs > > -- > 2.25.1 > --=20 Best Regards Masahiro Yamada