linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf build: Fix broken feature check for llvm due to C++ standard
@ 2023-07-12  8:30 Thomas Richter
  2023-07-12  8:30 ` [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging Thomas Richter
  2023-07-13  3:10 ` [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Ian Rogers
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Richter @ 2023-07-12  8:30 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, wangnan0, jolsa
  Cc: svens, gor, sumanthk, hca, Thomas Richter

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 this check fails.
Fix this and update to the latest C++ standard.

Output before:
 # rm -f ./test-llvm.bin; make test-llvm.bin; ./test-llvm.bin
 g++  -MD -Wall -Werror -o test-llvm.bin test-llvm.cpp \
	 	> test-llvm.make.output 2>&1 -std=gnu++14 \
	-I/usr/include 		\
	-L/usr/lib64		\
	-lLLVM-16		\
			\
	> test-llvm.make.output 2>&1

 make: *** [Makefile:343: test-llvm.bin] Error 1
 -bash: ./test-llvm.bin: No such file or directory
 #

Output after:
 # rm -f ./test-llvm.bin; make test-llvm.bin; ./test-llvm.bin
 g++  -MD -Wall -Werror -o test-llvm.bin test-llvm.cpp \
	 	> test-llvm.make.output 2>&1 -std=gnu++17 \
	-I/usr/include 		\
	-L/usr/lib64		\
	-lLLVM-16		\
			\
	> test-llvm.make.output 2>&1
 Hello World!
 #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/build/feature/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 0f0aa9b7d7b5..f8db69654791 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)		\
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging
  2023-07-12  8:30 [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Thomas Richter
@ 2023-07-12  8:30 ` Thomas Richter
  2023-07-13  3:02   ` Ian Rogers
  2023-07-13  3:10 ` [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Ian Rogers
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Richter @ 2023-07-12  8:30 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, wangnan0, jolsa
  Cc: svens, gor, sumanthk, hca, Thomas Richter

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 clang. And this check fails.

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
 #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/build/feature/Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index f8db69654791..0b4a6e43c5cc 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -353,12 +353,10 @@ $(OUTPUT)test-llvm-version.bin:
 		> $(@:.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging
  2023-07-12  8:30 ` [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging Thomas Richter
@ 2023-07-13  3:02   ` Ian Rogers
  2023-07-13  3:05     ` Ian Rogers
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2023-07-13  3:02 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, wangnan0, jolsa, svens, gor,
	sumanthk, hca

On Wed, Jul 12, 2023 at 1:35 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> 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 clang. And this check fails.
>
> 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
>  #
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>

Tested-by: Ian Rogers <irogers@google.com>

Thanks!
Ian

> ---
>  tools/build/feature/Makefile | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index f8db69654791..0b4a6e43c5cc 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -353,12 +353,10 @@ $(OUTPUT)test-llvm-version.bin:
>                 > $(@:.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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging
  2023-07-13  3:02   ` Ian Rogers
@ 2023-07-13  3:05     ` Ian Rogers
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Rogers @ 2023-07-13  3:05 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, wangnan0, jolsa, svens, gor,
	sumanthk, hca

On Wed, Jul 12, 2023 at 8:02 PM Ian Rogers <irogers@google.com> wrote:
>
> On Wed, Jul 12, 2023 at 1:35 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
> >
> > 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 clang. And this check fails.
> >
> > 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
> >  #
> >
> > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
>
> Tested-by: Ian Rogers <irogers@google.com>

Ah, presumably obsolete to:
https://lore.kernel.org/linux-perf-users/20230712083037.4081444-1-tmricht@linux.ibm.com/

Thanks,
Ian



> Thanks!
> Ian
>
> > ---
> >  tools/build/feature/Makefile | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> > index f8db69654791..0b4a6e43c5cc 100644
> > --- a/tools/build/feature/Makefile
> > +++ b/tools/build/feature/Makefile
> > @@ -353,12 +353,10 @@ $(OUTPUT)test-llvm-version.bin:
> >                 > $(@:.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
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf build: Fix broken feature check for llvm due to C++ standard
  2023-07-12  8:30 [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Thomas Richter
  2023-07-12  8:30 ` [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging Thomas Richter
@ 2023-07-13  3:10 ` Ian Rogers
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Rogers @ 2023-07-13  3:10 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, wangnan0, jolsa, svens, gor,
	sumanthk, hca

On Wed, Jul 12, 2023 at 1:35 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> 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 this check fails.
> Fix this and update to the latest C++ standard.
>
> Output before:
>  # rm -f ./test-llvm.bin; make test-llvm.bin; ./test-llvm.bin
>  g++  -MD -Wall -Werror -o test-llvm.bin test-llvm.cpp \
>                 > test-llvm.make.output 2>&1 -std=gnu++14 \
>         -I/usr/include          \
>         -L/usr/lib64            \
>         -lLLVM-16               \
>                         \
>         > test-llvm.make.output 2>&1
>
>  make: *** [Makefile:343: test-llvm.bin] Error 1
>  -bash: ./test-llvm.bin: No such file or directory
>  #
>
> Output after:
>  # rm -f ./test-llvm.bin; make test-llvm.bin; ./test-llvm.bin
>  g++  -MD -Wall -Werror -o test-llvm.bin test-llvm.cpp \
>                 > test-llvm.make.output 2>&1 -std=gnu++17 \
>         -I/usr/include          \
>         -L/usr/lib64            \
>         -lLLVM-16               \
>                         \
>         > test-llvm.make.output 2>&1
>  Hello World!
>  #
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>

Tested-by: Ian Rogers <irogers@google.com>

Tested with clang/llvm 15.

Thanks,
Ian

> ---
>  tools/build/feature/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 0f0aa9b7d7b5..f8db69654791 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)         \
> --
> 2.41.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-13  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12  8:30 [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Thomas Richter
2023-07-12  8:30 ` [PATCH] perf build: Fix broken feature check for clang due to C++ standard and changed library packaging Thomas Richter
2023-07-13  3:02   ` Ian Rogers
2023-07-13  3:05     ` Ian Rogers
2023-07-13  3:10 ` [PATCH] perf build: Fix broken feature check for llvm due to C++ standard Ian Rogers

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).