aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2025-07-28 12:15:11 -0700
committerH.J. Lu <hjl.tools@gmail.com>2025-08-01 05:50:53 -0700
commit69451ca6ec0a2ab09322bab77f7d441e4c579990 (patch)
tree2ec3d00ab91f694653a18c83847ea2ca7d809947
parent20681be149b9eb1b6c1f4246bf4bd801221c86cd (diff)
downloadglibc-69451ca6ec0a2ab09322bab77f7d441e4c579990.zip
glibc-69451ca6ec0a2ab09322bab77f7d441e4c579990.tar.gz
glibc-69451ca6ec0a2ab09322bab77f7d441e4c579990.tar.bz2
x86-64: Consolidate subdirectory check on elf and csu
Consolidate subdirectory check on elf and csu to avoid checking them more than once. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r--sysdeps/x86_64/Makefile25
1 files changed, 10 insertions, 15 deletions
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index c3e1065..8cace35 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -11,6 +11,7 @@ endif
ifeq ($(subdir),csu)
gen-as-const-headers += link-defines.sym
+gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
endif
ifeq ($(subdir),gmon)
@@ -235,10 +236,6 @@ $(objpfx)check-rtld.out: $(objpfx)rtld.reloc
generated += check-rtld.out
endif # $(subdir) == elf
-ifeq ($(subdir),csu)
-gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
-endif
-
ifeq ($(subdir),wcsmbs)
sysdep_routines += \
@@ -269,6 +266,15 @@ endif
ifneq ($(enable-cet),no)
+# Add -fcf-protection to CFLAGS when CET is enabled.
+CFLAGS-.o += -fcf-protection
+CFLAGS-.os += -fcf-protection
+CFLAGS-.op += -fcf-protection
+CFLAGS-.oS += -fcf-protection
+
+# Compile assembly codes with <cet.h> when CET is enabled.
+asm-CPPFLAGS += -fcf-protection -include cet.h
+
ifeq ($(subdir),elf)
sysdep-dl-routines += dl-cet
@@ -461,18 +467,7 @@ $(objpfx)tst-shstk-legacy-1g.out: \
$(..)/sysdeps/x86_64/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
$(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
$(evaluate-test)
-endif
-
-# Add -fcf-protection to CFLAGS when CET is enabled.
-CFLAGS-.o += -fcf-protection
-CFLAGS-.os += -fcf-protection
-CFLAGS-.op += -fcf-protection
-CFLAGS-.oS += -fcf-protection
-
-# Compile assembly codes with <cet.h> when CET is enabled.
-asm-CPPFLAGS += -fcf-protection -include cet.h
-ifeq ($(subdir),elf)
ifeq (yes,$(build-shared))
tests-special += $(objpfx)check-cet.out
endif