From d619cda8578e0d27ce0de14b09c4dc8e8056d534 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 19 Apr 2021 15:49:19 -0400 Subject: [PATCH] lttng-gen-tp: no linker flags when compiling .o The lttng-gen-tp scripts appends the content of the LDFLAGS variable to the cc command use to compile object files, this is unnecessary since we are not linking an executable or shared object and will generate warnings with recent clang. Change-Id: I87812028f145e0fc3848cf9d58de998abc98e57e Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- doc/examples/gen-tp/Makefile | 1 - tools/lttng-gen-tp | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/doc/examples/gen-tp/Makefile b/doc/examples/gen-tp/Makefile index 07627f3d..39331854 100644 --- a/doc/examples/gen-tp/Makefile +++ b/doc/examples/gen-tp/Makefile @@ -39,7 +39,6 @@ sample.o: sample.c sample_tracepoint.h @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \ CFLAGS="$(AM_CFLAGS) $(CFLAGS)" \ - LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \ CC="$(CC)" \ $(PYTHON) $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp index 84f4297e..a62107f7 100755 --- a/tools/lttng-gen-tp +++ b/tools/lttng-gen-tp @@ -138,12 +138,8 @@ class ObjFile: cflags = " " + os.environ['CFLAGS'] else: cflags = "" - if 'LDFLAGS' in os.environ: - ldflags = " " + os.environ['LDFLAGS'] - else: - ldflags = "" - command = cc + " -c" + cppflags + cflags + ldflags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename + command = cc + " -c" + cppflags + cflags + " -I. -o " + self.outputFilename + " " + cFilename if verbose: print("Compile command: " + command) subprocess.call(command.split()) -- 2.34.1