Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp996957imu; Fri, 4 Jan 2019 10:59:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7xIXDF/5B7ZY0h0zKCwghXqWdcT6Lpo6FoLos5hvqhtlI9PWCyr5s2R7ucOQ2qrhjVVIBp X-Received: by 2002:a63:2d82:: with SMTP id t124mr2588327pgt.260.1546628364411; Fri, 04 Jan 2019 10:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546628364; cv=none; d=google.com; s=arc-20160816; b=0h5WDImXNl0AGreOHrOrqwXnticYLc+NphueoQNINJcLLowg/XU8JtuhjxqjH2Ztqd GJiNOx9Vbuos4dA29ahEhpA+SMABbX6XuilMTH5iPeLEKe343dkHWag8casVi3h2ormv 0jeSNwZYLtAvTxep2UmsLVm1dvh0iNVBmE3HSMBAlIoqGe+SEw4udP3VI0piwKUGOlG0 TtjTAugwUV7nQnTdLF7ncWU7stZvtMQQLv0p7eOgs93nNRO3rcT/lyxB0Dhgu+rZtppQ nMUn/HSqEAa20xVG1Pt9gcE1WqMLQGqXQh9MPEvNj+cXViAGtEgpDJL9DzFHjYPhlkOZ 2phg== 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 :in-reply-to:references:mime-version; bh=KvriM1Lv+ofrC7EkdpTv2LB6W1GMDvx4iGf9Rz8N23Q=; b=Jid3aa8B1QJsnjTllkGIbOc41zKk6kZXPebgfRlBrIdDQ2EVXlFRaoyjoenApj+knk AxsC7n9+VSQzqOnO3myCT8PQGqSvBGh8SYBNMlrYwYffMHxzGJHusWyxc05eY3mAcICN 3oZq29ACI/PH5rUVbpzvAGTlzzEretfoi1mmLdVCx0KmnBQoVxke/z53kn2QeCJKibtQ qs3/TN+8b16bbPB1l45NO6Fs7vwj1m9I7M+Kpt3i9paQhWEmi1unoIT13xNp7SS46an+ +HxZOYGd0ww/U+eTQ5Fa/SiqdvAQaF4Q7EnvgmlmAo9IMiIvLYMfZn0VEzIpDBdYtliG NRYA== 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 u24si16855275pgj.489.2019.01.04.10.59.08; Fri, 04 Jan 2019 10:59:24 -0800 (PST) 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 S1728116AbfADRQq (ORCPT + 99 others); Fri, 4 Jan 2019 12:16:46 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:40525 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbfADRQp (ORCPT ); Fri, 4 Jan 2019 12:16:45 -0500 Received: by mail-vs1-f67.google.com with SMTP id z3so23050735vsf.7; Fri, 04 Jan 2019 09:16:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KvriM1Lv+ofrC7EkdpTv2LB6W1GMDvx4iGf9Rz8N23Q=; b=COlI/b1ZeHHx316GRrhoG9OWKV+pLpp5SHeki+jHFWGLpVSNXEO0230io9Pi8duFo5 gwL96A1lAV9a1Nb5XIM7O8asZN6UchYOfPPXGhXe/RF3mu1gx+z1ni2X74QwMSd+5gbW GS1UT4u5PtxZ+FJ69lEJOYaqC5kcE1hRnpmZEnp7BzlJz9HTfZm7mbS4ygltyqZUP8ua 81mAKCzabZQos15x0+09YDt9wY/ukH2eXRgEPHu1KqHqKOwhGAKcl1hz2dhLODh/m+4T DkpadrI5zr5qxWqnePQh4bNax0WL1pOHQh5muchxoBeA7jqvQfAY/SeUhmWldZrf+1W6 zMPQ== X-Gm-Message-State: AJcUukfe3sgm1aBzECSYkEkX0UOGwnrgVHnIniBeKq75F9vCkaYVfBob ASQEfi/c+x2GHZePjbb1CVYfAp1lr4wBH7M065I= X-Received: by 2002:a67:3885:: with SMTP id n5mr18246062vsi.96.1546622203679; Fri, 04 Jan 2019 09:16:43 -0800 (PST) MIME-Version: 1.0 References: <20170908111923.27434-1-thomas@m3y3r.de> <20170908230155.esge2mctk5d5g7gb@ast-mbp> <59B32231.9090406@iogearbox.net> <295553a4-aadc-e5d1-229e-22d1966bc9f5@kernel.org> In-Reply-To: <295553a4-aadc-e5d1-229e-22d1966bc9f5@kernel.org> From: Geert Uytterhoeven Date: Fri, 4 Jan 2019 18:16:31 +0100 Message-ID: Subject: Re: selftests/bpf doesn't compile To: Shuah Khan Cc: Daniel Borkmann , Alexei Starovoitov , Thomas Meyer , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , Networking , Masahiro Yamada , linux-kbuild , "open list:GPIO SUBSYSTEM" 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 Shuah, CC kbuild, gpio On Thu, Sep 14, 2017 at 5:34 PM Shuah Khan wrote: > bpf test depends on clang and fails to compile when > > ------------------------------------------------------ > make -C tools/testing/selftests/bpf run_tests > > > make: clang: Command not found > Makefile:39: recipe for target '.linux-kselftest/tools/testing/selftests/bpf/test_pkt_access.o' failed > make: *** [./linux-kselftest/tools/testing/selftests/bpf/test_pkt_access.o] Error 127 > make: Leaving directory '.linux-kselftest/tools/testing/selftests/bpf' The above failure is indeed due to missing clang. > With "make TARGETS=bpf kselftest" it fails earlier: > > make[3]: Entering directory './linux-kselftest/tools/lib/bpf' > Makefile:40: tools/scripts/Makefile.arch: No such file or directory > Makefile:84: tools/build/Makefile.feature: No such file or directory > Makefile:143: tools/build/Makefile.include: No such file or directory This is due to srctree being "." instead of the actual source tree, when invoked as "make kselftest". When using "make -C tools/testing/selftests", srctree is correct. tools/testing/selftests/bpf/Makefile has: $(BPFOBJ): force $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/ to enter the tools/lib/bpf directory to force a build of libbpf.a Note that tools/gpio has the same issue. There seem to be _four_ different ways to build kselftests (Documentation/dev-tools/kselftest.rst): make kselftest make O=/path/to/output kselftest make -C tools/testing/selftests make O=/path/to/output -C tools/testing/selftests I'm not so fond of the latter two, as they basically run make from somewhere inside the tree, which complicates things. I believe we don't support this anywhere else. Each of the four seem to have (different) issues. Especially when you throw cross-compiling into the mix. And care about where installed headers end up (yes, kselftest calls headers_install internally). I'm working on fixes for some of them, but I don't know how to fix the srctree issue. Anyone with a suggestion? Thanks! > make[3]: *** No rule to make target 'tools/build/Makefile.include'. Stop. > make[3]: Leaving directory '.linux-kselftest/tools/lib/bpf' > Makefile:34: recipe for target './linux-kselftest/tools/testing/selftests/bpf/libbpf.a' failed > make[2]: *** [./linux-kselftest/tools/testing/selftests/bpf/libbpf.a] Error 2 > make[2]: Leaving directory './linux-kselftest/tools/testing/selftests/bpf' > Makefile:69: recipe for target 'all' failed > make[1]: *** [all] Error 2 > Makefile:1190: recipe for target 'kselftest' failed > make: *** [kselftest] Error 2 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