From: Cheng-Yang Chou <yphbchou0911@gmail.com>
To: sched-ext@lists.linux.dev, Tejun Heo <tj@kernel.org>,
David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>
Cc: Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>,
chengyang.chou@mediatek.com,
Cheng-Yang Chou <yphbchou0911@gmail.com>
Subject: [PATCH 2/2] selftests/sched_ext: Move -rdynamic to LDFLAGS and append to it
Date: Tue, 8 Sep 2026 21:47:09 +0800 [thread overview]
Message-ID: <20260908134722.8671-3-yphbchou0911@gmail.com> (raw)
In-Reply-To: <20260908134722.8671-2-yphbchou0911@gmail.com>
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]
Unlike the demo schedulers, the selftest runner requires -rdynamic at
link time to populate .dynsym for testcases. Additionally, LDFLAGS uses
'=' rather than '+=', silently discarding USERLDFLAGS from lib.mk.
Move -rdynamic from CFLAGS to LDFLAGS and append with '+='. This fixes
builds with CC=clang-N while preserving symbol export and USERLDFLAGS.
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
tools/testing/selftests/sched_ext/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/sched_ext/Makefile b/tools/testing/selftests/sched_ext/Makefile
index 3cfe90e0f34fa..c756285a4903e 100644
--- a/tools/testing/selftests/sched_ext/Makefile
+++ b/tools/testing/selftests/sched_ext/Makefile
@@ -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 += -rdynamic -lelf -lz -lpthread -lzstd
IS_LITTLE_ENDIAN = $(shell $(CC) -dM -E - </dev/null | \
grep 'define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__')
--
2.43.0
next prev parent reply other threads:[~2026-09-08 13:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:47 [PATCH sched_ext/for-7.4 0/2] sched_ext: Clean up -rdynamic and LDFLAGS in Makefiles Cheng-Yang Chou
2026-09-08 13:47 ` [PATCH 1/2] tools/sched_ext: Drop the no-op -rdynamic from CFLAGS Cheng-Yang Chou
2026-09-08 13:47 ` Cheng-Yang Chou [this message]
2026-09-08 17:09 ` [PATCH 2/2] selftests/sched_ext: Move -rdynamic to LDFLAGS and append to it Tejun Heo
2026-09-09 14:55 ` Cheng-Yang Chou
2026-09-08 17:09 ` [PATCH 1/2] tools/sched_ext: Drop the no-op -rdynamic from CFLAGS Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260908134722.8671-3-yphbchou0911@gmail.com \
--to=yphbchou0911@gmail.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chengyang.chou@mediatek.com \
--cc=chia7712@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox