Skip to content

Commit

Permalink
Remove old initfini mechanism.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Myers committed Feb 21, 2012
1 parent 599af3c commit 0e7dfae
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 391 deletions.
22 changes: 22 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
2012-02-21 Joseph Myers <joseph@codesourcery.com>

[BZ #13695]
* csu/Makefile (distribute): Remove initfini.c and defs.awk.
[crti.S not in sysdirs] (generated): Do not append.
[crti.S not in sysdirs] (omit-deps): Likewise.
[crti.S not in sysdirs] ($(crtstuff:%=$(objpfx)%.o)): Remove rule.
[crti.S not in sysdirs] ($(objpfx)initfini.s): Likewise.
[crti.S not in sysdirs] ($(objpfx)crti.S): Likewise.
[crti.S not in sysdirs] ($(objpfx)crtn.S): Likewise.
[crti.S not in sysdirs] ($(patsubst %,$(objpfx)crt%.o,i n)):
Likewise.
[crti.S not in sysdirs] ($(objpfx)defs.h): Likewise.
[crti.S not in sysdirs] (CFLAGS-initfini.s): Remove variable.
[crti.S not in sysdirs] (initfini.c): Remove vpath directive.
* csu/defs.awk: Remove file.
* sysdeps/generic/initfini.c: Likewise.
* sysdeps/powerpc/powerpc32/Makefile (CFLAGS-initfini.s): Remove
variable.
* sysdeps/powerpc/powerpc64/Makefile (CFLAGS-initfini.s):
Likewise.

2012-02-20 Joseph Myers <joseph@codesourcery.com>

* sysdeps/unix/sysv/linux/bits/epoll.h: New file.
Expand Down
49 changes: 2 additions & 47 deletions csu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
# consists of the startfile, built from start.c and installed as crt0.o
# (traditionally) or crt1.o (for ELF). In ELF we also install crti.o and
# crtn.o, special "initializer" and "finalizer" files used in the link
# to make the .init and .fini sections work right; both these files are
# built (in an arcane manner) from initfini.c.
# to make the .init and .fini sections work right.

subdir := csu

Expand All @@ -38,7 +37,7 @@ omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
b$(start-installed-name) $(csu-dummies) \
S$(start-installed-name))
install-lib = $(start-installed-name) g$(start-installed-name) $(csu-dummies)
distribute = initfini.c gmon-start.c start.c defs.awk \
distribute = gmon-start.c start.c \
abi-note.S init.c c not-cancel.h
generated = version-info.h
before-compile = $(objpfx)version-info.h
Expand Down Expand Up @@ -80,50 +79,6 @@ crtstuff = crti crtn
install-lib += $(crtstuff:=.o)
extra-objs += $(crtstuff:=.o)

# Conditionals on the existence of a sysdeps version of crti.S are
# temporary until all targets either have such a file or have been
# removed, after which the old approach of postprocessing compiler
# output will be removed.
ifeq (,$(wildcard $(sysdirs:%=%/crti.S)))

generated += $(crtstuff:=.S) initfini.s defs.h
omit-deps += $(crtstuff)

# Special rules for the building of crti.o and crtn.o
$(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h
$(compile.S) -g0 $(ASFLAGS-.os) -o $@

CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)

vpath initfini.c $(sysdirs)

$(objpfx)initfini.s: initfini.c $(before-compile)
$(compile.c) -S $(CFLAGS-initfini.s) -finhibit-size-directive \
$(patsubst -f%,-fno-%,$(exceptions)) -o $@

# We only have one kind of startup code files. Static binaries and
# shared libraries are build using the PIC version.
$(objpfx)crti.S: $(objpfx)initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@

$(objpfx)crtn.S: $(objpfx)initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@

# These explicit rules are necessary when the $(objpfx) subdirectory
# did not exist at the time make considered the implicit rules using it.
# This comes up with a fresh build using no_deps=t.
$(patsubst %,$(objpfx)crt%.o,i n): %.o: %.S

$(objpfx)defs.h: $(objpfx)initfini.s
sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
$(AWK) -f defs.awk > $@

endif

extra-objs += abi-note.o init.o
asm-CPPFLAGS += -I$(objpfx).

Expand Down
27 changes: 0 additions & 27 deletions csu/defs.awk

This file was deleted.

18 changes: 18 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2012-02-21 Joseph Myers <joseph@codesourcery.com>

[BZ #13695]
* Makefile (generated): Remove crti.S, crtn.S, defs.h and
pt-initfini.s.
[crti.S not in sysdirs] (omit-deps): Do not append.
[crti.S not in sysdirs] (CFLAGS-pt-initfini.s): Remove variable.
[crti.S not in sysdirs] (pt-initfini.c): Remove vpath directive.
[crti.S not in sysdirs] ($(objpfx)crti.S): Remove rule.
[crti.S not in sysdirs] ($(objpfx)crtn.S): Likewise.
[crti.S not in sysdirs] ($(objpfx)defs.h): Likewise.
[crti.S not in sysdirs] ($(objpfx)crti.o): Likewise.
[crti.S not in sysdirs] ($(objpfx)crtn.o): Likewise.
[crti.S in sysdirs] (extra-objs): Append unconditionally.
[crti.S in sysdirs] ($(objpfx)crti.o): Define rule
unconditionally.
* sysdeps/pthread/pt-initfini.c: Remove file.

2012-02-16 Richard Henderson <rth@twiddle.net>

* nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: Remove file.
Expand Down
49 changes: 1 addition & 48 deletions nptl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,25 +334,12 @@ ifneq (,$(patsubst .,,$(multidir)))
generated-dirs := $(firstword $(subst /, , $(multidir)))
crti-objs += $(multidir)/crti.o
crtn-objs += $(multidir)/crtn.o
# Conditionals on the existence of a sysdeps version of crti.S are
# temporary until all targets either have such a file or have been
# removed, after which the old approach of postprocessing compiler
# output will be removed.
ifeq (,$(wildcard $(sysdirs:%=%/crti.S)))
omit-deps += $(multidir)/crti $(multidir)/crtn
endif
$(objpfx)$(multidir):
mkdir -p $@
endif
extra-objs += $(crti-objs) $(crtn-objs)
ifeq (,$(wildcard $(sysdirs:%=%/crti.S)))
omit-deps += crti crtn

CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)
else
extra-objs += pt-crti.o
endif
endif

CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
CFLAGS-ftrylockfile.c = -D_IO_MTSAFE_IO
Expand Down Expand Up @@ -551,47 +538,13 @@ $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
endif

ifeq ($(build-shared),yes)
ifeq (,$(wildcard $(sysdirs:%=%/crti.S)))
vpath pt-initfini.c $(sysdirs)

$(objpfx)pt-initfini.s: pt-initfini.c
$(compile.c) -S $(CFLAGS-pt-initfini.s) -finhibit-size-directive \
$(patsubst -f%,-fno-%,$(exceptions)) -o $@
endif

$(objpfx)tst-cleanup0.out: /dev/null $(objpfx)tst-cleanup0
$(make-test-out) 2>&1 | cmp - tst-cleanup0.expect > $@

ifneq (,$(wildcard $(sysdirs:%=%/crti.S)))

$(objpfx)crti.o: $(objpfx)pt-crti.o
ln -f $< $@

else

# We only have one kind of startup code files. Static binaries and
# shared libraries are build using the PIC version.
$(objpfx)crti.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@
$(objpfx)crtn.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@

$(objpfx)defs.h: $(objpfx)pt-initfini.s
sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
$(AWK) -f ../csu/defs.awk > $@

$(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
$(compile.S) -g0 $(ASFLAGS-.os) -o $@

$(objpfx)crtn.o: $(objpfx)crtn.S $(objpfx)defs.h
$(compile.S) -g0 $(ASFLAGS-.os) -o $@

endif

ifneq ($(multidir),.)
$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/
ln -f $< $@
Expand All @@ -600,7 +553,7 @@ $(objpfx)$(multidir)/crtn.o: $(objpfx)crtn.o $(objpfx)$(multidir)/
ln -f $< $@
endif

generated += crti.S crtn.S defs.h pt-initfini.s libpthread_nonshared.a \
generated += libpthread_nonshared.a \
multidir.mk tst-atfork2.mtrace tst-cancel-wrappers.out \
tst-tls6.out

Expand Down
124 changes: 0 additions & 124 deletions nptl/sysdeps/pthread/pt-initfini.c

This file was deleted.

Loading

0 comments on commit 0e7dfae

Please sign in to comment.