mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
50304ef057
1998-07-16 10:23 Ulrich Drepper <drepper@cygnus.com> * argp/argp-fmtstream.c: Unify names of used global functions. * argp/argp-help.c: Likewise. * assert/assert-perr.c: Likewise * assert/assert.c: Likewise * dirent/scandir.c: Likewise * dirent/scandir64.c: Likewise * dirent/versionsort.c: Likewise * dirent/versionsort64.c: Likewise * gmon/bb_exit_func.c: Likewise. * gmon/gmon.c: Likewise. * grp/initgroups.c: Likewise. * iconv/gconv_conf.c: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent_r.c: Likewise. * inet/inet_ntoa.c: Likewise. * inet/rcmd.c: Likewise. * inet/rexec.c: Likewise. * inet/ruserpass.c: Likewise. * io/fts.c: Likewise. * io/ftw.c: Likewise. * io/ftw64.c: Likewise. * io/getdirname.c: Likewise. * io/getwd.c: Likewise. * io/lockf.c: Likewise. * libio/iofdopen.c: Likewise. * libio/iopopen.c: Likewise. * login/utmp_daemon.c: Likewise. * malloc/mtrace.c: Likewise. * malloc/obstack.c * misc/daemon.c: Likewise. * misc/efgcvt_r.c: Likewise. * misc/err.c: Likewise. * misc/error.c: Likewise. * misc/fstab.c: Likewise. * misc/getpass.c: Likewise. * misc/getttyent.c: Likewise. * misc/mntent_r.c: Likewise. * misc/search.h: Likewise. * misc/syslog.c: Likewise. * nscd/nscd_getgr_r.c: Likewise. * nscd/nscd_getpw_r.c: Likewise. * posix/getpgrp.c: Likewise. * posix/wordexp.c: Likewise. * pwd/fgetpwent_r.c: Likewise. * pwd/getpw.c: Likewise. * resolv/herror.c: Likewise. * resolv/res_init.c: Likewise. * shadow/fgetspent_r.c: Likewise. * shadow/lckpwdf.c: Likewise. * signal/sigrelse.c: Likewise. * stdio-common/asprintf.c: Likewise. * stdio-common/dprintf.c: Likewise. * stdio-common/getw.c: Likewise. * stdio-common/putw.c: Likewise. * stdio-common/snprintf.c: Likewise. * stdio-common/sprintf.c: Likewise. * stdio-common/sscanf.c: Likewise. * stdlib/lrand48_r.c: Likewise. * stdlib/mrand48_r.c: Likewise. * string/argz-replace.c: Likewise. * string/envz.c: Likewise. * sunrpc/auth_des.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/clnt_gen.c: Likewise. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_simp.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/get_myaddr.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/netname.c: Likewise. * sunrpc/openchild.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/rpc_dtable.c: Likewise. * sunrpc/rtime.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/svcauth_des.c: Likewise. * sunrpc/xdr_array.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * sunrpc/xdr_stdio.c: Likewise. * sysdeps/generic/abort.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/generic/fstatfs64.c: Likewise. * sysdeps/generic/ftruncate64.c: Likewise. * sysdeps/generic/getrlimit64.c: Likewise. * sysdeps/generic/glob.c: Likewise. * sysdeps/generic/prof-freq.c: Likewise. * sysdeps/generic/putenv.c: Likewise. * sysdeps/generic/statfs64.c: Likewise. * sysdeps/generic/ttyname_r.c: Likewise. * sysdeps/generic/utmp_file.c: Likewise. * sysdeps/generic/vlimit.c: Likewise. * sysdeps/generic/vtimes.c: Likewise. * sysdeps/posix/cuserid.c: Likewise. * sysdeps/posix/euidaccess.c: Likewise. * sysdeps/posix/mkstemp.c: Likewise. * sysdeps/posix/mktemp.c: Likewise. * sysdeps/posix/pread.c: Likewise. * sysdeps/posix/pread64.c: Likewise. * sysdeps/posix/profil.c: Likewise. * sysdeps/posix/pwrite.c: Likewise. * sysdeps/posix/pwrite64.c: Likewise. * sysdeps/posix/sigblock.c: Likewise. * sysdeps/posix/sigpause.c: Likewise. * sysdeps/posix/ttyname.c: Likewise. * sysdeps/posix/ttyname_r.c: Likewise. * sysdeps/posix/waitid.c: Likewise. * sysdeps/unix/getlogin_r.c: Likewise. * sysdeps/unix/grantpt.c: Likewise. * sysdeps/unix/rewinddir.c: Likewise. * sysdeps/unix/sysv/linux/gethostid.c: Likewise. * sysdeps/unix/sysv/linux/getpt.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * sysdeps/unix/sysv/linux/ptsname.c: Likewise. * sysdeps/unix/sysv/linux/sendmsg.c: Likewise. * sysdeps/unix/sysv/linux/statvfs.c: Likewise. * sysdeps/unix/sysv/linux/ttyname.c: Likewise. * sysdeps/unix/sysv/linux/ttyname_r.c: Likewise. * sysdeps/unix/sysv/linux/ulimit.c: Likewise. * sysdeps/unix/sysv/linux/unlockpt.c: Likewise. * sysvipc/sys/shm.h: Likewise. * time/ctime_r.c: Likewise. * time/strptime.c: Likewise. * wcsmbs/mbrlen.c: Likewise. * wcsmbs/wcsdup.c: Likewise. * wcsmbs/wcsxfrm.c: Likewise. * wctype/wcfuncs.c: Likewise. * sysdeps/unix/sysv/linux/i386/socker.S: Change to honor NO_WEAK_ALIAS. * sysdeps/unix/sysv/linux/accept.S: Don't generate __ name. * sysdeps/unix/sysv/linux/bind.S: Likewise. * sysdeps/unix/sysv/linux/getsockname.S: Likewise. * sysdeps/unix/sysv/linux/listen.S: Likewise. * sysdeps/unix/sysv/linux/recvfrom.S: Likewise. * sysdeps/unix/sysv/linux/sendto.S: Likewise. * sysdeps/unix/sysv/linux/setsockopt.S: Likewise. * grp/fgetgrent_r.c: Use explicit locking of the stream. * elf/Makefile (rtld-routines): Add dl-environ. * sysdeps/generic/dl-environ.c: New file. * libio/Makefile [REENTRANT] (routines): Add iofputs_u. * libio/Versions: Add fputs_unlocked. * libio/iofputs_u.c: New file. * libio/stdio.h: Add prototype for fputs_unlocked. * sunrpc/rpc/auth.h: Use __PMT instead of __P in type definitions. * sunrpc/rpc/clnt.h: Likewise. * sunrpc/rpc/pmap_clnt.h: Likewise. * sunrpc/rpc/svc.h: Likewise. * sunrpc/rpc/xdr.h: Likewise. * sysdeps/i386/memchr.S: Correct for more strict gas. * sysdeps/i386/fpu/bits/mathinline.h: Likewise. * sysdeps/libm-i387/i686/s_fdim.S: Likewise. * sysdeps/libm-i387/i686/s_fdimf.S: Likewise. * sysdeps/libm-i387/i686/s_fdiml.S: Likewise. 1998-07-15 Andreas Jaeger <aj@arthur.rhein-neckar.de> * configure.in: Change message for binutils version from 2.8.1.0.17->2.8.1.0.23. 1998-07-15 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h: Define LOC. Patch by John Tobey <jtobey@banta-im.com>.
204 lines
6.6 KiB
Makefile
204 lines
6.6 KiB
Makefile
# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||
# This file is part of the GNU C Library.
|
||
|
||
# The GNU C Library is free software; you can redistribute it and/or
|
||
# modify it under the terms of the GNU Library General Public License as
|
||
# published by the Free Software Foundation; either version 2 of the
|
||
# License, or (at your option) any later version.
|
||
|
||
# The GNU C Library is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
# Library General Public License for more details.
|
||
|
||
# You should have received a copy of the GNU Library General Public
|
||
# License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||
# Boston, MA 02111-1307, USA.
|
||
|
||
# Makefile for elf subdirectory of GNU C Library.
|
||
|
||
subdir := elf
|
||
|
||
headers = elf.h bits/elfclass.h bits/dlfcn.h link.h dlfcn.h
|
||
routines = $(dl-routines) dl-open dl-close dl-symbol dl-support \
|
||
dl-addr enbl-secure dl-profstub
|
||
|
||
# The core dynamic linking functions are in libc for the static and
|
||
# profiled libraries.
|
||
dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
|
||
runtime error init fini debug misc \
|
||
version profile)
|
||
# But they are absent from the shared libc, because that code is in ld.so.
|
||
elide-routines.os = $(dl-routines) dl-support enbl-secure
|
||
|
||
# ld.so uses those routines, plus some special stuff for being the program
|
||
# interpreter and operating independent of libc.
|
||
rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal
|
||
ld-map = $(common-objpfx)libc.map
|
||
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
|
||
dl-hash.h soinit.c sofini.c ldd.sh.in ldd.bash.in eval.c \
|
||
genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
|
||
dl-librecon.h interp.c
|
||
|
||
extra-libs = libdl
|
||
extra-libs-others = $(extra-libs)
|
||
libdl-routines := dlopen dlclose dlsym dlvsym dlerror dladdr
|
||
|
||
before-compile = $(objpfx)trusted-dirs.h
|
||
|
||
|
||
all: # Make this the default target; it will be defined in Rules.
|
||
|
||
include ../Makeconfig
|
||
|
||
ifeq (yes,$(build-shared))
|
||
extra-objs = $(rtld-routines:=.os) soinit.os sofini.os eval.os interp.os
|
||
generated = librtld.os dl-allobjs.os ld.so trusted-dirs.h trusted-dirs.st
|
||
install-others = $(inst_slibdir)/$(rtld-installed-name)
|
||
install-bin = ldd
|
||
generated += ldd
|
||
endif
|
||
|
||
others = sprof
|
||
install-bin += sprof
|
||
|
||
ifeq (yes,$(has-ldconfig))
|
||
others-static += ldconfig
|
||
others += ldconfig
|
||
install-rootsbin = ldconfig
|
||
endif
|
||
|
||
include ../Rules
|
||
|
||
|
||
ifeq (yes,$(build-shared))
|
||
# Make sure these things are built in the `make lib' pass so they can be used
|
||
# to run programs during the `make others' pass.
|
||
lib-noranlib: $(objpfx)$(rtld-installed-name) \
|
||
$(addprefix $(objpfx),$(extra-objs))
|
||
endif
|
||
|
||
# Command to link into a larger single relocatable object.
|
||
reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@
|
||
|
||
$(objpfx)dl-allobjs.os: $(rtld-routines:%=$(objpfx)%.os)
|
||
$(reloc-link) $^
|
||
|
||
# Link together the dynamic linker into a single relocatable object.
|
||
$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
|
||
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
|
||
|
||
# Do we need a linker script?
|
||
rtld-ldscript-in := $(firstword $(wildcard $(+sysdep_dirs:%=%/rtld-ldscript.in)))
|
||
|
||
ifneq (,$(rtld-ldscript-in))
|
||
rtld-ldscript = $(objpfx)rtld-ldscript
|
||
generated += rtld-ldscript
|
||
|
||
LDFLAGS-rtld = -T $(rtld-ldscript)
|
||
before-compile += $(rtld-ldscript)
|
||
|
||
rtld-parms = $(wildcard $(+sysdep_dirs:%=%/rtld-parms))
|
||
include $(rtld-parms)
|
||
|
||
$(rtld-ldscript): $(rtld-ldscript-in) $(rtld-parms)
|
||
sed -e 's#@@rtld-oformat@@#$(rtld-oformat)#' \
|
||
-e 's#@@rtld-arch@@#$(rtld-arch)#' \
|
||
-e 's#@@rtld-entry@@#$(rtld-entry)#' \
|
||
-e 's#@@rtld-base@@#$(rtld-base)#' $< >$@
|
||
endif
|
||
|
||
$(objpfx)ld.so: $(objpfx)librtld.os $(addprefix $(objpfx),$(rtld-ldscript)) \
|
||
$(ld-map)
|
||
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
|
||
-Wl,-rpath=$(default-rpath) $(LDFLAGS-rtld) \
|
||
$(filter-out $(rtld-ldscript) $(map-file),$^) \
|
||
$(load-map-file) -Wl,-soname=$(rtld-installed-name)
|
||
|
||
# The dl code in the static libc needs a default library path.
|
||
CFLAGS-dl-support.c = -D'DEFAULT_RPATH="$(default-rpath)"'
|
||
|
||
# interp.c exists just to get this string into the libraries.
|
||
CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
|
||
|
||
ifneq (ld.so,$(rtld-installed-name))
|
||
# Make sure ld.so.1 exists in the build directory so we can link
|
||
# against it.
|
||
$(objpfx)$(rtld-installed-name): $(objpfx)ld.so
|
||
rm -f $@
|
||
ln -s $(<F) $@
|
||
generated += $(rtld-installed-name)
|
||
endif
|
||
|
||
# Build a file mentioning all trustworthy directories to look for shared
|
||
# libraries when using LD_LIBRARY_PATH in a setuid program. The user can
|
||
# add directories to the list by defining $(user-defined-trusted-dirs)
|
||
# before starting make.
|
||
$(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
|
||
$(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
|
||
$(make-target-directory)
|
||
dirs="$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))"; \
|
||
for dir in $$dirs; do \
|
||
echo " \"$$dir/\","; \
|
||
done > ${@:st=T}
|
||
$(move-if-change) ${@:st=T} ${@:st=h}
|
||
touch $@
|
||
CPPFLAGS-dl-load.c = -I$(objpfx).
|
||
CFLAGS-dl-load.c += -Wno-uninitialized
|
||
|
||
# Specify the dependencies of libdl.so; its commands come from the generic
|
||
# rule to build a shared library.
|
||
$(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
|
||
|
||
$(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
|
||
$(do-install-program)
|
||
|
||
$(inst_slibdir)/$(rtld-installed-name): \
|
||
$(inst_slibdir)/$(rtld-version-installed-name)
|
||
$(make-shlib-link)
|
||
|
||
# Special target called by parent to install just the dynamic linker.
|
||
.PHONY: ldso_install
|
||
ldso_install: $(inst_slibdir)/$(rtld-installed-name)
|
||
|
||
|
||
sh-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
|
||
-e 's%@VERSION@%$(version)%g'
|
||
bash-ldd-rewrite = $(sh-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \
|
||
-e 's%@TEXTDOMAINDIR@%$(localedir)%g'
|
||
|
||
ifneq ($(have-bash2),yes)
|
||
ldd-shell = sh
|
||
else
|
||
ldd-shell = bash
|
||
endif
|
||
|
||
ifeq ($(ldd-rewrite-script),no)
|
||
define gen-ldd
|
||
sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
|
||
endef
|
||
else
|
||
define gen-ldd
|
||
sed $($(ldd-shell)-ldd-rewrite) < $< | sed -f $(ldd-rewrite-script) > $@.new
|
||
endef
|
||
endif
|
||
|
||
$(objpfx)ldd: ldd.$(ldd-shell).in $(common-objpfx)soversions.mk \
|
||
$(common-objpfx)config.make
|
||
$(gen-ldd)
|
||
chmod 555 $@.new
|
||
mv -f $@.new $@
|
||
|
||
|
||
ifeq ($(build-shared),yes)
|
||
$(objpfx)sprof: $(objpfx)libdl.so$(libdl.so-version)
|
||
else
|
||
$(objpfx)sprof: $(objpfx)libdl.a
|
||
endif
|
||
|
||
# muwahaha
|
||
|
||
LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name)
|
||
$(objpfx)libdl.so: $(objpfx)eval.os
|