Remove bounded-pointers build system support.

This commit is contained in:
Joseph Myers 2013-02-15 15:07:54 +00:00
parent 2bdd4ca6b6
commit daaa7713e9
16 changed files with 62 additions and 95 deletions

View File

@ -1,3 +1,54 @@
2013-02-15 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* Makeconfig [!+link-bounded] (+link-bounded): Remove variable.
[!link-extra-libs] (link-extra-libs-bounded): Likewise.
(run-via-rtld-prefix): Do not handle %-bp tests.
(test-via-rtld-prefix): Do not mention %-bp tests in comment.
(all-object-suffixes): Remove .ob.
(bppfx): Remove variable.
[$(build-bounded) = yes] (object-suffixes): Do not add .ob.
[$(build-bounded) = yes] (CPPFLAGS-.ob): Remove variable.
[$(build-bounded) = yes] (CFLAGS-.ob): Likewise.
[$(build-bounded) = yes] (libtype.ob): Likewise.
* Makerules (elide-routines.ob): Remove variable.
(do-tests-clean): Do not handle *-bp.out.
(common-mostlyclean): Do not handle *-bp and *-bp.out.
* Rules [$(build-bounded) = yes] (tests-bp.out): Remove variable.
[$(build-bounded) = yes] (xtests-bp.out): Likewise.
(tests): Do not include $(tests-bp.out).
(xtests): Do not include $(xtests-bp.out).
[$(build-bounded) = yes] (binaries-bounded): Remove variable.
[$(build-bounded) = yes] ($(addprefix
$(objpfx),$(binaries-bounded))): Remove rule.
($(objpfx)%-bp.out): Remove rule.
* config.make.in (build-bounded): Remove variable.
* crypt/Makefile [$(build-bounded) = yes]
($(tests:%=$(objpfx)%-bp)): Remove dependency.
* csu/Makefile [$(build-bounded) = yes] (extra-objs): Do not
append to variable.
[$(build-bounded) = yes] (install-lib): Likewise.
[$(build-bounded) = yes] (generated): Likewise.
[!start-installed-name-rule] ($(objpfx)b$(start-installed-name)):
Remove rule.
* intl/Makefile [$(build-bounded) = yes]
($(multithread-test-srcs:%=$(objpfx)%-bp)): Remove dependency.
* math/Makefile [$(build-bounded) = yes]
($(tests:%=$(objpfx)%-bp): Likewise.
* misc/Makefile [$(build-bounded) = yes]
($(objpfx)tst-tsearch-bp): Likewise.
* nptl/Makeconfig (bounded-thread-library): Remove variable.
* rt/Makefile [$(build-bounded) = yes] ($(tests:%=$(objpfx)%-bp)):
Remove dependency.
* string/Makefile (o-objects.ob): Remove variable.
* sysdeps/i386/i686/Makefile [$(config-asflags-i686) = yes]
(CFLAGS-.ob): Remove variable.
[$(config-asflags-i686) = yes] (ASFLAGS-.ob): Likewise.
* sysdeps/sparc/sparc32/sparcv9/Makefile (ASFLAGS-.ob): Remove
both definitions of variable.
* sysdeps/sparc/sparc64/Makefile [$(have-as-vis3) = yes]
(ASFLAGS-.ob): Remove variable.
2013-02-14 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]

View File

@ -435,18 +435,6 @@ else
+link-tests = $(+link-static-tests)
endif
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) $(+prectorT) \
$(filter-out $(addprefix $(csu-objpfx),start.ob \
$(start-installed-name))\
$(+preinit) $(link-extra-libs-bounded) \
$(common-objpfx)libc% $(+postinit),$^) \
$(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
endif
ifeq (yes,$(build-shared))
ifndef rtld-LDFLAGS
rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
@ -506,13 +494,11 @@ endif
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)
link-extra-libs-bounded = $(link-extra-libs)
endif
# The static libraries.
link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
# How to link against libgcc. Some libgcc functions, such as those
# for "long long" arithmetic or software floating point, can always be
@ -617,12 +603,11 @@ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
# $(run-via-rtld-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
# program. For the statically-linked %-bp test programs, and for
# tests listed in tests-static or xtests-static, it is empty.
# program. For tests listed in tests-static or xtests-static, it is
# empty.
run-via-rtld-prefix = \
$(if $(strip $(filter $(notdir $(built-program-file)), \
$(tests-static) $(xtests-static)) \
$(filter %-bp,$(built-program-file))),, \
$(tests-static) $(xtests-static))),, \
$(elf-objpfx)$(rtld-installed-name) \
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
else
@ -652,9 +637,9 @@ endif
# $(test-via-rtld-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
# program. For the statically-linked %-bp test programs, and for
# tests listed in tests-static or xtests-static as well as when test
# programs are hardcoded to the newly built libraries, it is empty.
# program. For tests listed in tests-static or xtests-static as well
# as when test programs are hardcoded to the newly built libraries, it
# is empty.
# $(test-program-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
@ -817,7 +802,7 @@ endif
# The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
# to pass different flags for each flavor.
libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
all-object-suffixes := .o .os .op .og .ob .oS
all-object-suffixes := .o .os .op .og .oS
object-suffixes :=
CPPFLAGS-.o = $(pic-default)
CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@ -852,18 +837,6 @@ endif
# differently from the rest.
object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
bppfx = BP-
ifeq (yes,$(build-bounded))
# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
# to runtime bounds checking. The bounded-pointer objects are named foo.ob.
# We disable sibling-call optimizations so that stack traces will be complete
# and thus aid debugging, since after all, BPs are a debugging tool.
object-suffixes += .ob
CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls -fno-strict-aliasing
libtype.ob = lib%_b.a
endif
object-suffixes-for-libc := $(object-suffixes)
ifeq (yes,$(build-shared))

View File

@ -418,7 +418,6 @@ elide-routines.os += $(static-only-routines)
elide-routines.o += $(shared-only-routines)
elide-routines.op += $(shared-only-routines)
elide-routines.og += $(shared-only-routines)
elide-routines.ob += $(shared-only-routines)
# Shared library building.
@ -1265,9 +1264,7 @@ mostlyclean: common-mostlyclean
do-tests-clean:
-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) $(xtests) \
$(test-srcs)) \
$(addsuffix -bp.out,$(tests) $(xtests) \
$(test-srcs)))
$(test-srcs)))
# Remove the object files.
common-mostlyclean:
@ -1276,12 +1273,8 @@ common-mostlyclean:
$(addsuffix .o,$(tests) $(xtests) \
$(test-srcs) $(others) \
$(sysdep-others)) \
$(addsuffix -bp,$(tests) $(xtests) \
$(test-srcs)) \
$(addsuffix .out,$(tests) $(xtests) \
$(test-srcs)) \
$(addsuffix -bp.out,$(tests) $(xtests) \
$(test-srcs)))
$(test-srcs)))
-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
$(install-lib) $(install-lib.so) \
$(install-lib.so:%.so=%_pic.a))

18
Rules
View File

@ -98,12 +98,8 @@ ifeq ($(run-built-tests),no)
tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
xtests: tests
else
ifeq ($(build-bounded),yes)
tests-bp.out = $(tests:%=$(objpfx)%-bp.out)
xtests-bp.out = $(xtests:%=$(objpfx)%-bp.out)
endif
tests: $(tests:%=$(objpfx)%.out) $(tests-bp.out)
xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-bp.out)
tests: $(tests:%=$(objpfx)%.out)
xtests: tests $(xtests:%=$(objpfx)%.out)
endif
ifeq ($(build-programs),yes)
@ -179,14 +175,6 @@ $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
$(+link-static-tests)
endif
ifeq ($(build-bounded),yes)
binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
$(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
$(sort $(filter $(common-objpfx)lib%,$(link-libc-bounded))) \
$(addprefix $(csu-objpfx),start.ob) $(+preinit) $(+postinit)
$(+link-bounded)
endif
ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
# These are the implicit rules for making test outputs
# from the test programs and whatever input files are present.
@ -194,8 +182,6 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
make-test-out = $(test-wrapper-env) \
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
$($*-ENV) $(host-test-program-cmd) $($*-ARGS)
$(objpfx)%-bp.out: %.input $(objpfx)%-bp
$(make-test-out) > $@ < $(word 1,$^)
$(objpfx)%.out: %.input $(objpfx)%
$(make-test-out) > $@ < $(word 1,$^)
$(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.

View File

@ -91,7 +91,6 @@ nss-crypt = @libc_cv_nss_crypt@
build-shared = @shared@
build-pic-default= @libc_cv_pic_default@
build-profile = @profile@
build-bounded = no
build-static-nss = @static_nss@
add-ons = @add_ons@
add-on-subdirs = @add_on_subdirs@

View File

@ -69,9 +69,6 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
else
$(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
endif
ifeq (yes,$(build-bounded))
$(tests:%=$(objpfx)%-bp): $(objpfx)libcrypt_b.a
endif
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by

View File

@ -53,12 +53,6 @@ install-lib += S$(start-installed-name)
generated += start.os
endif
ifeq (yes,$(build-bounded))
extra-objs += b$(start-installed-name)
install-lib += b$(start-installed-name)
generated += start.ob
endif
ifneq ($(start-installed-name),$(static-start-installed-name))
extra-objs += $(static-start-installed-name) g$(static-start-installed-name)
omit-deps += $(patsubst %.o,%,$(static-start-installed-name) \
@ -98,9 +92,6 @@ $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
$(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \
$(objpfx)init.o
$(link-relocatable)
$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \
$(objpfx)init.ob
$(link-relocatable)
endif
# The profiling startfile is made by linking together the normal

View File

@ -117,9 +117,6 @@ $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library)
else
$(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library)
endif
ifeq (yes,$(build-bounded))
$(multithread-test-srcs:%=$(objpfx)%-bp): $(bounded-thread-library)
endif
endif
$(objpfx)tst-translit.out: $(objpfx)tst-gettext.out

View File

@ -193,9 +193,6 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libm.so$(libm.so-version)
else
$(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
endif
ifeq ($(build-bounded),yes)
$(tests:%=$(objpfx)%-bp): $(objpfx)libm_b.a
endif
gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \

View File

@ -109,10 +109,6 @@ else
$(objpfx)tst-tsearch: $(common-objpfx)math/libm.a
endif
ifeq ($(build-bounded),yes)
$(objpfx)tst-tsearch-bp: $(common-objpfx)math/libm_b.a
endif
tst-error1-ENV = MALLOC_TRACE=$(objpfx)tst-error1.mtrace
tst-error1-ARGS = $(objpfx)tst-error1.out
$(objpfx)tst-error1-mem: $(objpfx)tst-error1.out

View File

@ -24,7 +24,6 @@ have-thread-library = yes
shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
$(common-objpfx)nptl/libpthread.so
static-thread-library = $(common-objpfx)nptl/libpthread.a
bounded-thread-library = $(common-objpfx)nptl/libpthread_b.a
rpath-dirs += nptl

View File

@ -76,8 +76,5 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)librt.so $(shared-thread-library)
else
$(addprefix $(objpfx),$(tests)): $(objpfx)librt.a $(static-thread-library)
endif
ifeq (yes,$(build-bounded))
$(tests:%=$(objpfx)%-bp): $(objpfx)librt_b.a $(bounded-thread-library)
endif
tst-mqueue7-ARGS = -- $(host-test-program-cmd)

View File

@ -41,10 +41,6 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
strcoll_l strxfrm_l string-inlines memrchr \
xpg-strerror strerror_l
# Gcc internally generates calls to unbounded memcpy and memset
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
o-objects.ob := memcpy.o memset.o memchr.o
strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
stpcpy stpncpy strcat strchr strcmp strcpy strcspn \
strlen strncmp strncpy strpbrk strrchr strspn memmem \

View File

@ -15,13 +15,11 @@ CFLAGS-.o += -Wa,-mtune=i686
CFLAGS-.os += -Wa,-mtune=i686
CFLAGS-.op += -Wa,-mtune=i686
CFLAGS-.og += -Wa,-mtune=i686
CFLAGS-.ob += -Wa,-mtune=i686
CFLAGS-.oS += -Wa,-mtune=i686
ASFLAGS-.o += -Wa,-mtune=i686
ASFLAGS-.os += -Wa,-mtune=i686
ASFLAGS-.op += -Wa,-mtune=i686
ASFLAGS-.og += -Wa,-mtune=i686
ASFLAGS-.ob += -Wa,-mtune=i686
ASFLAGS-.oS += -Wa,-mtune=i686
endif

View File

@ -10,13 +10,11 @@ ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
ASFLAGS-.og += -Wa,-Av9d
ASFLAGS-.ob += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
else
ASFLAGS-.o += -Wa,-Av9a
ASFLAGS-.os += -Wa,-Av9a
ASFLAGS-.op += -Wa,-Av9a
ASFLAGS-.og += -Wa,-Av9a
ASFLAGS-.ob += -Wa,-Av9a
ASFLAGS-.oS += -Wa,-Av9a
endif

View File

@ -12,6 +12,5 @@ ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
ASFLAGS-.og += -Wa,-Av9d
ASFLAGS-.ob += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
endif