diff mbox series

[1/2] trace-cmd Makefile: Change test-build to link as well

Message ID 20220428174949.797657-2-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit d877803049f252b523fcc9b4444ff4bfd6060f6e
Headers show
Series trace-cmd: Still work without memfd_create() | expand

Commit Message

Steven Rostedt April 28, 2022, 5:49 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Remove the '-c' option from the test-build macro build. To test if a
function exists, it needs to go through the link phase, otherwise it can
pass with an undefined symbol.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 982514baad01..9fbc6de25d05 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,7 @@  export NO_PYTHON
 # $(call test-build, snippet, ret) -> ret if snippet compiles
 #                                  -> empty otherwise
 test-build = $(if $(shell sh -c 'echo "$(1)" | \
-	$(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2)
+	$(CC) -o /dev/null -x c - > /dev/null 2>&1 && echo y'), $2)
 
 UDIS86_AVAILABLE := $(call test-build,\#include <udis86.h>, y)
 ifneq ($(strip $(UDIS86_AVAILABLE)), y)