aboutsummaryrefslogtreecommitdiff
path: root/Makeconfig
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-07-26 18:18:43 +0000
committerGreg McGary <greg@mcgary.org>2000-07-26 18:18:43 +0000
commitac556388135e5bf0578cb24bc958870ff3a0f00c (patch)
tree4c3c8c7213d349cd412270e4346b94f85d7521e0 /Makeconfig
parente04b831ab49dfb24f1c1a70b3816bff5515cbab9 (diff)
downloadglibc-ac556388135e5bf0578cb24bc958870ff3a0f00c.tar
glibc-ac556388135e5bf0578cb24bc958870ff3a0f00c.tar.gz
glibc-ac556388135e5bf0578cb24bc958870ff3a0f00c.tar.bz2
glibc-ac556388135e5bf0578cb24bc958870ff3a0f00c.zip
* Makeconfig (+link-bounded, link-libc-bounded,
link-extra-libs-bounded): New variables. (built-program-cmd): Omit $(run-program-prefix) for static BP tests. * Makerules (do-tests-clean, common-mostlyclean): Remove BP test files. * Rules (tests-bp.out): New variable. (tests): Conditionally add BP tests. (binaries-bounded): Add variable and associated rule. * csu/Makefile [build-bounded] (extra-objs, install-lib): Move conditional stuff after place where condition is defined.
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makeconfig b/Makeconfig
index da3c88f0e0..b36bf7e6fe 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -400,6 +400,18 @@ ifndef +link-static
$(common-objpfx)libc% $(+postinit),$^) \
$(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
endif
+# Command for statically linking bounded-pointer programs with the C library.
+ifndef +link-bounded
++link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) \
+ $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
+ $(+preinit) $(+prector) \
+ $(filter-out $(addprefix $(csu-objpfx),start.o \
+ $(start-installed-name))\
+ $(+preinit) $(link-extra-libs-bounded) \
+ $(common-objpfx)libc% $(+postinit),$^) \
+ $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctor) $(+postinit)
+endif
ifndef config-LDFLAGS
ifeq (yes,$(build-shared))
config-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
@@ -458,6 +470,8 @@ link-libc-static = $(gnulib) $(common-objpfx)libc_pic.a
link-extra-libs-static = $(link-extra-libs)
endif
endif
+link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
+link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib)_b.a)
ifndef gnulib
gnulib := -lgcc
@@ -486,7 +500,10 @@ run-program-prefix = $(elf-objpfx)$(rtld-installed-name) \
else
run-program-prefix =
endif
-built-program-cmd = $(run-program-prefix) $(built-program-file)
+# Never use $(run-program-prefix) for the statically-linked %-bp test programs
+built-program-cmd = $(patsubst %,$(run-program-prefix),\
+ $(filter-out %-bp,$(built-program-file))) \
+ $(built-program-file)
ifndef LD
LD := ld -X