Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3199008ybi; Sun, 14 Jul 2019 08:40:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpfSUDNs9Yv1fHJsvq522lR4ZSGUkm9EEdYiSutiMrqS5luMvGSbdnPHFHb9odfLv3uZdH X-Received: by 2002:a17:902:a60d:: with SMTP id u13mr23564056plq.144.1563118847979; Sun, 14 Jul 2019 08:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563118847; cv=none; d=google.com; s=arc-20160816; b=GGpjEvft5RZ5GNSSFdmV59WH5k9KxswsxVe/RqzCF8nRgadWrK8vKn0aHS7U3oa+nv h1bs1P6rFqtiQhKBI2MQpuorDfb2K0LcoEf9SZfjMYZBEW8aThv5/EEFeYaG+p+DQ02q 2o0LVbn/bOyZxTZJan35Oabn6xZUyWqcy92UjORH+A5OaYDR2+ml9q/UEtmvNJPM5gaV b9HomP9sQ3ZVmIQVA4PsTxRcII74uwn5kR9WucMQ4k5aVhxlLfH4xGrjfFFL1THlK06c RCwbgfhNf/az9wZhWsvdCyh0NM3wSpVbvn7cLVu87lGJuM9xCvFTzeubpSDNQMKQtxcr DIyw== 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; bh=CShmySg8ueLkHeTKaUIMkGpLFzJETKHHSNgC8OcFbPk=; b=VtOv3l/p6Y+Ky1RhC+9v2x9/p7DOYNwD6wunGUAGeR+63D2f+rY80s3zSgFv995vYX R4MEkmzCsEY3K2aHMu6ULh8yEYAssZ1Z/BGkFA5fMdlWXtge1g60+EWXrLVsu7DBN9vw ltXVx/5Y+rEOCvKhpjGeh8oJcamA/NCRNoFfhdwEoJEWFQcmEiz5tRfbFE8SRviku+L0 AOtq+TbTI3iPACwmomufFDX5IuW6Xgp4EWJeXAm9pxdqHX/fuIIGvJ1bU38W2kE96IkT 8YSAxOFpkbXzHVbB/5uDmHOuZUlAezJXiZpwuI9R5t8R/ullorPNwe2kHB192ma1uZ73 serw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si14311433pfd.141.2019.07.14.08.40.30; Sun, 14 Jul 2019 08:40:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbfGNPkJ (ORCPT + 99 others); Sun, 14 Jul 2019 11:40:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728095AbfGNPkJ (ORCPT ); Sun, 14 Jul 2019 11:40:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D17A3084288; Sun, 14 Jul 2019 15:40:08 +0000 (UTC) Received: from krava (ovpn-204-80.brq.redhat.com [10.40.204.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 75A345D772; Sun, 14 Jul 2019 15:40:07 +0000 (UTC) Date: Sun, 14 Jul 2019 17:40:06 +0200 From: Jiri Olsa To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, acme@kernel.org, Jiri Olsa Subject: Re: [RFC] Fix python feature detection Message-ID: <20190714154006.GB16802@krava> References: <20190707144417.237913-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190707144417.237913-1-joel@joelfernandes.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sun, 14 Jul 2019 15:40:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 07, 2019 at 10:44:17AM -0400, Joel Fernandes (Google) wrote: > I am having a hard time building BPF samples by doing a make in > samples/bpf. While I am debugging that, I ran into the Python issue. > Even though the system has libpython2.7-dev: > > If I just do a 'make' inside tools/build/feature/ I get: > Python.h: No such file or directory because you don't have FLAGS_PYTHON_EMBED set? > > This led me to this patch which fixes Python feature detection for me. > I am not sure if it is the right fix for Python since it is hardcoded > for Python version 2, but I thought it could be useful. we detect python in tools/perf/Makefile.config and set FLAGS_PYTHON_EMBED properly it's supposed to be set by a project using tools/build for feature detection.. what are you building? AFAICS samples/bpf do not use tools/build jirka > > My system is a Debian buster release. > > Cc: acme@kernel.org > Cc: jolsa@redhat.com > Signed-off-by: Joel Fernandes (Google) > --- > tools/build/feature/Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile > index 4b8244ee65ce..cde44cb38a5e 100644 > --- a/tools/build/feature/Makefile > +++ b/tools/build/feature/Makefile > @@ -83,7 +83,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$( > ############################### > > $(OUTPUT)test-all.bin: > - $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma > + $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(shell $(PKG_CONFIG) --libs --cflags python2 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma > > $(OUTPUT)test-hello.bin: > $(BUILD) > @@ -205,7 +205,7 @@ $(OUTPUT)test-libperl.bin: > $(BUILD) $(FLAGS_PERL_EMBED) > > $(OUTPUT)test-libpython.bin: > - $(BUILD) $(FLAGS_PYTHON_EMBED) > + $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags python2 2>/dev/null) $(FLAGS_PYTHON_EMBED) > > $(OUTPUT)test-libpython-version.bin: > $(BUILD) > -- > 2.22.0.410.gd8fdbe21b5-goog >