selftests/sched_ext: Drop -rdynamic and stop clobbering LDFLAGS
Subsystems (2)
PATCH v2 1/1 selftests/sched_ext: Drop -rdynamic and stop clobbering LDFLAGS
CFLAGS passes the link-time flag -rdynamic to compile steps ($(CC) -c), where it is unused. Under -Werror, Clang fails the build:
$ make CC=clang-21
clang-21: error: argument unused during compilation: '-rdynamic'
[-Werror,-Wunused-command-line-argument]Nothing needs the exported symbols. Separately, LDFLAGS uses '=' rather than '+=', discarding USERLDFLAGS from lib.mk.
Drop -rdynamic and append LDFLAGS with '+='. This fixes builds with CC=clang-N while preserving USERLDFLAGS.
Signed-off-by Cheng-Yang Chou <[email protected]>
---
Changes in v2:
- Drop -rdynamic instead of moving it to LDFLAGS (Tejun Heo)
- Link to v1:
https://lore.kernel.org/r/[email protected]/
tools/testing/selftests/sched_ext/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/sched_ext/Makefile +2 -2
@@ -53,7 +53,7 @@ ifneq ($(wildcard $(GENHDR)),) GENFLAGS := -DHAVE_GENHDR endif -CFLAGS += -g -O2 -rdynamic -pthread -Wall -Werror $(GENFLAGS) \ +CFLAGS += -g -O2 -pthread -Wall -Werror $(GENFLAGS) \ -I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \ -I$(TOOLSINCDIR) -I$(APIDIR) -I$(CURDIR)/include -I$(SCXTOOLSINCDIR)
@@ -62,7 +62,7 @@ ifneq ($(LLVM),) CFLAGS += -Wno-unused-command-line-argument endif -LDFLAGS = -lelf -lz -lpthread -lzstd +LDFLAGS += -lelf -lz -lpthread -lzstd IS_LITTLE_ENDIAN = $(shell $(CC) -dM -E - </dev/null | \ grep 'define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__')
Signature · 1 line
2.43.0
Hello,
Applied to sched_ext/for-7.4.
Thanks.
Signature · 1 line
tejun