[have-initfini=yes] (CPPFLAGS): Append -DHAVE_INITFINI. (initfini): Compile initfini.c with -fPIC.

This commit is contained in:
Roland McGrath 1996-01-16 22:37:27 +00:00
parent d008bcf32c
commit 294897f4a6
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# Makefile for csu code for GNU C library. # Makefile for csu code for GNU C library.
# Copyright (C) 1995 Free Software Foundation, Inc. # Copyright (C) 1995, 1996 Free Software Foundation, Inc.
# This file is part of the GNU C Library. # This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or # The GNU C Library is free software; you can redistribute it and/or
@ -48,7 +48,7 @@ start-installed-name = crt0.o
else else
# In the ELF universe, crt0.o is called crt1.o, and there are # In the ELF universe, crt0.o is called crt1.o, and there are
# some additional bizarre files. # some additional bizarre files.
start-installed-name = crt1.o start-installed-name = crt1.o
have-initfini = yes have-initfini = yes
@ -57,6 +57,8 @@ endif
ifeq (yes,$(have-initfini)) ifeq (yes,$(have-initfini))
CPPFLAGS += -DHAVE_INITFINI
# These are the special initializer/finalizer files. They are always the # These are the special initializer/finalizer files. They are always the
# first and last file in the link. crti.o ... crtn.o define the global # first and last file in the link. crti.o ... crtn.o define the global
# "functions" _init and _fini to run the .init and .fini sections. # "functions" _init and _fini to run the .init and .fini sections.
@ -77,7 +79,7 @@ define initfini
-rm -f $(objpfx)crtcommon.tmp -rm -f $(objpfx)crtcommon.tmp
(echo 'cat > crtcommon.tmp <<\EOF_common'; \ (echo 'cat > crtcommon.tmp <<\EOF_common'; \
$(CC) $< $(CPPFLAGS) $(CFLAGS) \ $(CC) $< $(CPPFLAGS) $(CFLAGS) \
-finhibit-size-directive -g0 -S -o -; \ -fPIC -finhibit-size-directive -g0 -S -o -; \
echo 'EOF_common') | (cd $(@D); $(SHELL)) echo 'EOF_common') | (cd $(@D); $(SHELL))
cat $(objpfx)crtcommon.tmp >> $(objpfx)crti.s-new cat $(objpfx)crtcommon.tmp >> $(objpfx)crti.s-new
cat $(objpfx)crtcommon.tmp >> $(objpfx)crtn.s-new cat $(objpfx)crtcommon.tmp >> $(objpfx)crtn.s-new