linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	irogers@google.com, wangnan0@huawei.com, jolsa@kernel.org,
	svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com,
	hca@linux.ibm.com
Subject: Re: [PATCH 1/2 Resend] perf build: Update feature check for clang and llvm
Date: Wed, 2 Aug 2023 11:28:23 -0300	[thread overview]
Message-ID: <ZMpoB1bYk+KfTDJA@kernel.org> (raw)
In-Reply-To: <20230725150347.3479291-1-tmricht@linux.ibm.com>

Em Tue, Jul 25, 2023 at 05:03:46PM +0200, Thomas Richter escreveu:
> Perf build auto-detects features and packages already installed
> for its build. This is done in directory tools/build/feature. This
> directory contains small sample programs. When they successfully
> compile the necessary prereqs in form of libraries and header
> files are present.
> 
> Such a check is also done for llvm and clang. And the checks fail.
> 
> Fix this and update to the latest C++ standard and use the
> new library provided by clang (which contains new packaging)
> see this link for reference:
>  https://fedoraproject.org/wiki/Changes/Stop-Shipping-Individual-Component-Libraries-In-clang-lib-Package
> 
> Output before:
>  # rm -f ./test-clang.bin; make test-clang.bin; ./test-clang.bin; \
> 	ll test-clang.make.output
>  g++  -MD -Wall -Werror -o test-clang.bin test-clang.cpp \
> 	 	> test-clang.make.output 2>&1 -std=gnu++14 \
> 	-I/usr/include 		\
> 	-L/usr/lib64		\
> 	-Wl,--start-group -lclangBasic -lclangDriver	\
> 	  -lclangFrontend -lclangEdit -lclangLex	\
> 	  -lclangAST -Wl,--end-group 			\
> 	-lLLVM-16	\
> 			\
> 	> test-clang.make.output 2>&1
>  make: *** [Makefile:356: test-clang.bin] Error 1
>  -bash: ./test-clang.bin: No such file or directory
>  -rw-r--r--. 1 root root 252041 Jul 12 09:56 test-clang.make.output
>  #
> 
> File test-clang.make.output contains many lines of unreferenced
> symbols.
> 
> Output after:
>  # rm -f ./test-clang.bin; make test-clang.bin; ./test-clang.bin; \
> 	cat test-clang.make.output
>  g++  -MD -Wall -Werror -o test-clang.bin test-clang.cpp \
> 	 > test-clang.make.output 2>&1 -std=gnu++17	\
> 	-I/usr/include 		\
> 	-L/usr/lib64		\
> 	-Wl,--start-group -lclang-cpp -Wl,--end-group	\
> 	-lLLVM-16	\
> 			\
> 	> test-clang.make.output 2>&1
>  #

Thanks, tested and applied. Added some notes about needing to have
'llvm-devel' and 'clang-devel' installed to do the tests.

- arnaldo
 
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>  tools/build/feature/Makefile | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 2cd6dbbee088..3184f387990a 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -340,7 +340,7 @@ $(OUTPUT)test-jvmti-cmlr.bin:
>  	$(BUILD)
>  
>  $(OUTPUT)test-llvm.bin:
> -	$(BUILDXX) -std=gnu++14 				\
> +	$(BUILDXX) -std=gnu++17 				\
>  		-I$(shell $(LLVM_CONFIG) --includedir) 		\
>  		-L$(shell $(LLVM_CONFIG) --libdir)		\
>  		$(shell $(LLVM_CONFIG) --libs Core BPF)		\
> @@ -348,17 +348,15 @@ $(OUTPUT)test-llvm.bin:
>  		> $(@:.bin=.make.output) 2>&1
>  
>  $(OUTPUT)test-llvm-version.bin:
> -	$(BUILDXX) -std=gnu++14					\
> +	$(BUILDXX) -std=gnu++17					\
>  		-I$(shell $(LLVM_CONFIG) --includedir)		\
>  		> $(@:.bin=.make.output) 2>&1
>  
>  $(OUTPUT)test-clang.bin:
> -	$(BUILDXX) -std=gnu++14					\
> +	$(BUILDXX) -std=gnu++17					\
>  		-I$(shell $(LLVM_CONFIG) --includedir) 		\
>  		-L$(shell $(LLVM_CONFIG) --libdir)		\
> -		-Wl,--start-group -lclangBasic -lclangDriver	\
> -		  -lclangFrontend -lclangEdit -lclangLex	\
> -		  -lclangAST -Wl,--end-group 			\
> +		-Wl,--start-group -lclang-cpp -Wl,--end-group	\
>  		$(shell $(LLVM_CONFIG) --libs Core option)	\
>  		$(shell $(LLVM_CONFIG) --system-libs)		\
>  		> $(@:.bin=.make.output) 2>&1
> -- 
> 2.41.0
> 

-- 

- Arnaldo

  parent reply	other threads:[~2023-08-02 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 15:03 [PATCH 1/2 Resend] perf build: Update feature check for clang and llvm Thomas Richter
2023-07-25 15:03 ` [PATCH 2/2 Resend] perf build: Support llvm and clang support compiled in Thomas Richter
2023-08-02 14:37   ` Arnaldo Carvalho de Melo
2023-08-02 14:28 ` Arnaldo Carvalho de Melo [this message]
2023-08-10 22:07   ` [PATCH 1/2 Resend] perf build: Update feature check for clang and llvm Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZMpoB1bYk+KfTDJA@kernel.org \
    --to=acme@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sumanthk@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tmricht@linux.ibm.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).