Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9930582ybi; Wed, 24 Jul 2019 12:32:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5raXTxzNiI+5QURcFW5HPwK9PCSnmYXN5bi6aQGDxWLTJfKt9sBsYE51XrKVWRITkmewj X-Received: by 2002:a65:4304:: with SMTP id j4mr84594777pgq.419.1563996721889; Wed, 24 Jul 2019 12:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996721; cv=none; d=google.com; s=arc-20160816; b=OrEfvrn7CRi5EqDvmWI9CXHEtNCKW4HDw9PQ1Hefj0ETBYKTJhifQcdPRCZKYweFsw pBvsVN4PM2d0vR1PsEZmMj5eRvAd0FQrKtYZ5/XxAeJjJ0uah8GK9GioDeG4pzAsBN/l 4GfRn+jREmP6UmgGxqUiVNG6Zar8jIMz6JdtChobgrNTKiP04Xy2hZaV0WGDThyVWnKc cuuXzykZKZ8yKRIJmphSNuwzCXvFDT92KkMyRMjOTP7ZivMf0vYQvQLs+scU9JCpv1ar tJOpLUic0ygW/iLhYCut/dvi6RfZdPDQb1u1gTe6f9S2O6YRC/EXQ5EgqLpRivRk1PtH AnIw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eF6iX8b14QfT6zXFrRfonFN7nD9MtExmkqadkPXrPOA=; b=zSXMmcjkfb47FZDWuAgs1gAKpCnukctISAVxuKBRyXzeSO9BYwwxMGwIGowasW4QYg OVmpg5L8qIU2ryv03rAeGWf3c6tASwDhKLqKRwwIMOP+kPFwoKCdZn3ksqmSK3sDmIg7 dJnqFHj5uOGLvUDwfT2JSIC5oZ4oDkV2NOmYrbQDYCJ4M05Bj5q0MH0WtOgCmB1wTZVW u7+ObuEh833c09VuZCD0DBPDCn5An5FAGF716anhKsFbz8enIp/PtjouiWttz4C4frrO +3h0YNeckWHnsQzeM2V5S+r3Nzmjk5KxD1DbkTOWmH/Zk7qBZquX6psKkKa1lv/OtCoB i34A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X7FIN5LM; 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 l186si16944701pgd.455.2019.07.24.12.31.47; Wed, 24 Jul 2019 12:32:01 -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=pass header.i=@kernel.org header.s=default header.b=X7FIN5LM; 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 S2388046AbfGXT3y (ORCPT + 99 others); Wed, 24 Jul 2019 15:29:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387978AbfGXT3v (ORCPT ); Wed, 24 Jul 2019 15:29:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B008A229FA; Wed, 24 Jul 2019 19:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996590; bh=1IhLdSTJ384CIEvJIEt8sq+hnX1k7Ne5k/kgyLm0Ezg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7FIN5LMjLLgKnwzNYEGEbv3aMOtYKLPfTuLuj7uN+dZRk+PpnpOW7xTxi1UTBbr+ 3yo3UuCQWidP3fXaEtq90Zc4X2t3pXbeoTQtn173g5t4ndxBGsmdn0EcHDBFND/CFY qk1hq7ePKi5vlSzh5KE3LxsC+k2Nl91wFhFwXerw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Florian Fainelli , Jiri Olsa , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.2 122/413] perf build: Handle slang being in /usr/include and in /usr/include/slang/ Date: Wed, 24 Jul 2019 21:16:53 +0200 Message-Id: <20190724191743.928000697@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 78d6ccce03e86de34c7000bcada493ed0679e350 ] In some distros slang.h may be in a /usr/include 'slang' subdir, so use the if slang is not explicitely disabled (by using NO_SLANG=1) and its feature test for the common case (having /usr/include/slang.h) failed, use the results for the test that checks if it is in slang/slang.h. Change the only file in perf that includes slang.h to use HAVE_SLANG_INCLUDE_SUBDIR and forget about this for good. On a rhel6 system now we have: $ /tmp/build/perf/perf -vv | grep slang libslang: [ on ] # HAVE_SLANG_SUPPORT $ ldd /tmp/build/perf/perf | grep libslang libslang.so.2 => /usr/lib64/libslang.so.2 (0x00007fa2d5a8d000) $ grep slang /tmp/build/perf/FEATURE-DUMP feature-libslang=0 feature-libslang-include-subdir=1 $ cat /etc/redhat-release CentOS release 6.10 (Final) $ While on fedora:29: $ /tmp/build/perf/perf -vv | grep slang libslang: [ on ] # HAVE_SLANG_SUPPORT $ ldd /tmp/build/perf/perf | grep slang libslang.so.2 => /lib64/libslang.so.2 (0x00007f8eb11a7000) $ grep slang /tmp/build/perf/FEATURE-DUMP feature-libslang=1 feature-libslang-include-subdir=1 $ $ cat /etc/fedora-release Fedora release 29 (Twenty Nine) $ The feature-libslang-include-subdir=1 line is because the 'gettid()' test was added to test-all.c as the new glibc has an implementation for that, so we soon should have it not failing, i.e. should be the common case soon. Perhaps I should move it out till it becomes the norm... Cc: Adrian Hunter Cc: Florian Fainelli Cc: Jiri Olsa Cc: Namhyung Kim Fixes: 1955c8cf5e26 ("perf tools: Don't hardcode host include path for libslang") Link: https://lkml.kernel.org/n/tip-bkgtpsu3uit821fuwsdhj9gd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/Makefile.config | 11 ++++++++--- tools/perf/ui/libslang.h | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 85fbcd265351..17b81bc403e4 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -637,9 +637,14 @@ endif ifndef NO_SLANG ifneq ($(feature-libslang), 1) - msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev); - NO_SLANG := 1 - else + ifneq ($(feature-libslang-include-subdir), 1) + msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev); + NO_SLANG := 1 + else + CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR + endif + endif + ifndef NO_SLANG # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h CFLAGS += -I/usr/include/slang CFLAGS += -DHAVE_SLANG_SUPPORT diff --git a/tools/perf/ui/libslang.h b/tools/perf/ui/libslang.h index c0686cda39a5..991e692b9b46 100644 --- a/tools/perf/ui/libslang.h +++ b/tools/perf/ui/libslang.h @@ -10,7 +10,12 @@ #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG __GLIBC_HAVE_LONG_LONG #endif + +#ifdef HAVE_SLANG_INCLUDE_SUBDIR +#include +#else #include +#endif #if SLANG_VERSION < 20104 #define slsmg_printf(msg, args...) \ -- 2.20.1