* [PATCH] perf: Replace deprecated -target with --target= for Clang
@ 2023-06-24 0:27 Fangrui Song
2023-06-25 18:24 ` Yonghong Song
0 siblings, 1 reply; 4+ messages in thread
From: Fangrui Song @ 2023-06-24 0:27 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
linux-perf-users
Cc: linux-kernel, bpf, llvm, Fangrui Song
-target has been deprecated since Clang 3.4 in 2013. Use the preferred
--target=bpf form instead. This matches how we use --target= in
scripts/Makefile.clang.
Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277
Signed-off-by: Fangrui Song <maskray@google.com>
---
tools/perf/Documentation/perf-config.txt | 2 +-
tools/perf/Makefile.perf | 4 ++--
tools/perf/util/llvm-utils.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index e56ae54805a8..1478068ad5dd 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -669,7 +669,7 @@ llvm.*::
"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
"-Wno-unused-value -Wno-pointer-sign " \
"-working-directory $WORKING_DIR " \
- "-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
+ "-c \"$CLANG_SOURCE\" --target=bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
llvm.clang-opt::
Options passed to clang.
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index f48794816d82..1b752e0a3723 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1057,7 +1057,7 @@ $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_
ifdef BUILD_BPF_SKEL
BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool
# Get Clang's default includes on this system, as opposed to those seen by
-# '-target bpf'. This fixes "missing" files on some architectures/distros,
+# '--target=bpf'. This fixes "missing" files on some architectures/distros,
# such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc.
#
# Use '-idirafter': Don't interfere with include mechanics except where the
@@ -1081,7 +1081,7 @@ $(BPFTOOL): | $(SKEL_TMP_OUT)
OUTPUT=$(SKEL_TMP_OUT)/ bootstrap
$(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) | $(SKEL_TMP_OUT)
- $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \
+ $(QUIET_CLANG)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \
-c $(filter util/bpf_skel/%.bpf.c,$^) -o $@
$(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index 4e8e243a6e4b..c6c9c2228578 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -25,7 +25,7 @@
"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
"-Wno-unused-value -Wno-pointer-sign " \
"-working-directory $WORKING_DIR " \
- "-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -g -O2 -o - $LLVM_OPTIONS_PIPE"
+ "-c \"$CLANG_SOURCE\" --target=bpf $CLANG_EMIT_LLVM -g -O2 -o - $LLVM_OPTIONS_PIPE"
struct llvm_param llvm_param = {
.clang_path = "clang",
@@ -569,7 +569,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
pr_err("ERROR:\tunable to compile %s\n", path);
pr_err("Hint:\tCheck error message shown above.\n");
pr_err("Hint:\tYou can also pre-compile it into .o using:\n");
- pr_err(" \t\tclang -target bpf -O2 -c %s\n", path);
+ pr_err(" \t\tclang --target=bpf -O2 -c %s\n", path);
pr_err(" \twith proper -I and -D options.\n");
goto errout;
}
--
2.41.0.178.g377b9f9a00-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] perf: Replace deprecated -target with --target= for Clang
2023-06-24 0:27 [PATCH] perf: Replace deprecated -target with --target= for Clang Fangrui Song
@ 2023-06-25 18:24 ` Yonghong Song
2023-06-27 19:29 ` Namhyung Kim
0 siblings, 1 reply; 4+ messages in thread
From: Yonghong Song @ 2023-06-25 18:24 UTC (permalink / raw)
To: Fangrui Song, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, linux-perf-users
Cc: linux-kernel, bpf, llvm
On 6/23/23 5:27 PM, Fangrui Song wrote:
> -target has been deprecated since Clang 3.4 in 2013. Use the preferred
> --target=bpf form instead. This matches how we use --target= in
> scripts/Makefile.clang.
>
> Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277
> Signed-off-by: Fangrui Song <maskray@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Replace deprecated -target with --target= for Clang
2023-06-25 18:24 ` Yonghong Song
@ 2023-06-27 19:29 ` Namhyung Kim
2023-06-27 19:53 ` Fangrui Song
0 siblings, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2023-06-27 19:29 UTC (permalink / raw)
To: Yonghong Song
Cc: Fangrui Song, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, bpf,
llvm
Hi Fangui and Yonghong,
On Sun, Jun 25, 2023 at 11:25 AM Yonghong Song <yhs@meta.com> wrote:
>
>
>
> On 6/23/23 5:27 PM, Fangrui Song wrote:
> > -target has been deprecated since Clang 3.4 in 2013. Use the preferred
> > --target=bpf form instead. This matches how we use --target= in
> > scripts/Makefile.clang.
> >
> > Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277
> > Signed-off-by: Fangrui Song <maskray@google.com>
>
> Acked-by: Yonghong Song <yhs@fb.com>
After 10 years of deprecation, time to change. :)
Applied to perf-tools-next, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Replace deprecated -target with --target= for Clang
2023-06-27 19:29 ` Namhyung Kim
@ 2023-06-27 19:53 ` Fangrui Song
0 siblings, 0 replies; 4+ messages in thread
From: Fangrui Song @ 2023-06-27 19:53 UTC (permalink / raw)
To: Namhyung Kim
Cc: Yonghong Song, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, bpf,
llvm
On Tue, Jun 27, 2023 at 12:29 PM Namhyung Kim <namhyung@gmail.com> wrote:
>
> Hi Fangui and Yonghong,
>
> On Sun, Jun 25, 2023 at 11:25 AM Yonghong Song <yhs@meta.com> wrote:
> >
> >
> >
> > On 6/23/23 5:27 PM, Fangrui Song wrote:
> > > -target has been deprecated since Clang 3.4 in 2013. Use the preferred
> > > --target=bpf form instead. This matches how we use --target= in
> > > scripts/Makefile.clang.
> > >
> > > Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277
> > > Signed-off-by: Fangrui Song <maskray@google.com>
> >
> > Acked-by: Yonghong Song <yhs@fb.com>
>
> After 10 years of deprecation, time to change. :)
>
> Applied to perf-tools-next, thanks!
Thank you!
--
宋方睿
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-27 19:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-24 0:27 [PATCH] perf: Replace deprecated -target with --target= for Clang Fangrui Song
2023-06-25 18:24 ` Yonghong Song
2023-06-27 19:29 ` Namhyung Kim
2023-06-27 19:53 ` Fangrui Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox