glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).
In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree. This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles). (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so. But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)
To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files. This patch just deals with straightforward cases
where such variables already exist.
It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries. I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).
Tested x86_64.
* benchtests/Makefile
($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
not $(common-objpfx)math/libm.so.
($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
($(objpfx)tst-audit8): Depend on $(libm), not
$(common-objpfx)math/libm.so.
* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
not $(common-objpfx)dlfcn/libdl.so.
* math/Makefile
($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
Depend on $(libm), not $(objpfx)libm.so. Do not condition on
[$(build-shared) = yes].
($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
$(common-objpfx)nptl/libpthread.so.
* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
$(common-objpfx)math/libm.so$(libm.so-version) or
$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
* setjmp/Makefile (link-libm): Remove variable.
($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
* stdio-common/Makefile (link-libm): Remove variable.
($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
* stdlib/Makefile (link-libm): Remove variable.
($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
($(objpfx)tst-strtod-round): Likewise.
($(objpfx)tst-tininess): Likewise.
($(objpfx)tst-strtod-underflow): Likewise.
($(objpfx)tst-strtod6): Likewise.
($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
$(libdl), not $(common-objpfx)nptl/libpthread.so and
$(common-objpfx)dlfcn/libdl.so.
In <https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html> I
noted it was necessary to add includes of Makeconfig early in various
subdirectory makefiles for the tests-special variable settings added
by that patch to be conditional on configuration information. No-one
commented on the general question there of whether Makeconfig should
always be included immediately after the definition of subdir.
This patch implements that early inclusion of Makeconfig in each
directory (which is a lot easier than consistent placement of includes
of Rules). Includes are added if needed, or moved up if already
present. Subdirectory "all:" targets are removed, since Makeconfig
provides one.
There is potential for further cleanups I haven't done. Rules and
Makerules have code such as
ifneq "$(findstring env,$(origin headers))" ""
headers :=
endif
to override to empty any value of various variables that came from the
environment. I think there is a case for Makeconfig setting all the
subdirectory variables (other than subdir) to empty to ensure no
outside value is going to take effect if a subdirectory fails to
define a variable. (A list of such variables, possibly out of date
and incomplete, is in manual/maint.texi.) Rules and Makerules would
give errors if Makeconfig hadn't already been included, instead of
including it themselves. The special code to override values coming
from the environment would then be obsolete and could be removed.
Tested x86_64, including that installed binaries are identical before
and after the patch.
* argp/Makefile: Include Makeconfig immediately after defining
subdir.
* assert/Makefile: Likewise.
* benchtests/Makefile: Likewise.
* catgets/Makefile: Likewise.
* conform/Makefile: Likewise.
* crypt/Makefile: Likewise.
* csu/Makefile: Likewise.
(all): Remove target.
* ctype/Makefile: Include Makeconfig immediately after defining
subdir.
* debug/Makefile: Likewise.
* dirent/Makefile: Likewise.
* dlfcn/Makefile: Likewise.
* gmon/Makefile: Likewise.
* gnulib/Makefile: Likewise.
* grp/Makefile: Likewise.
* gshadow/Makefile: Likewise.
* hesiod/Makefile: Likewise.
* hurd/Makefile: Likewise.
(all): Remove target.
* iconvdata/Makefile: Include Makeconfig immediately after
defining subdir.
* inet/Makefile: Likewise.
* intl/Makefile: Likewise.
* io/Makefile: Likewise.
* libio/Makefile: Likewise.
(all): Remove target.
* locale/Makefile: Include Makeconfig immediately after defining
subdir.
* login/Makefile: Likewise.
* mach/Makefile: Likewise.
(all): Remove target.
* malloc/Makefile: Include Makeconfig immediately after defining
subdir.
(all): Remove target.
* manual/Makefile: Include Makeconfig immediately after defining
subdir.
* math/Makefile: Likewise.
* misc/Makefile: Likewise.
* nis/Makefile: Likewise.
* nss/Makefile: Likewise.
* po/Makefile: Likewise.
(all): Remove target.
* posix/Makefile: Include Makeconfig immediately after defining
subdir.
* pwd/Makefile: Likewise.
* resolv/Makefile: Likewise.
* resource/Makefile: Likewise.
* rt/Makefile: Likewise.
* setjmp/Makefile: Likewise.
* shadow/Makefile: Likewise.
* signal/Makefile: Likewise.
* socket/Makefile: Likewise.
* soft-fp/Makefile: Likewise.
* stdio-common/Makefile: Likewise.
* stdlib/Makefile: Likewise.
* streams/Makefile: Likewise.
* string/Makefile: Likewise.
* sunrpc/Makefile: Likewise.
(all): Remove target.
* sysvipc/Makefile: Include Makeconfig immediately after defining
subdir.
* termios/Makefile: Likewise.
* time/Makefile: Likewise.
* timezone/Makefile: Likewise.
(all): Remove target.
* wcsmbs/Makefile: Include Makeconfig immediately after defining
subdir.
* wctype/Makefile: Likewise.
libidn/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
localedata/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
(all): Remove target.
nptl/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
nptl_db/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
If longjmp restores the stack frame to an address which is beyond
the stack frame at the time of the longjmp call it would install
an uninitialized stack frame. If compiled with _FORTIFY_SOURCE
defined, longjmp will now bail out in this situation.
Update.
2004-07-16 Steven Munroe <sjmunroe@us.ibm.com>
[BZ #269]
* setjmp/Makefile (tests): Add bug269-setjmp.
* setjmp/bug269-setjmp.c: New file.
* sysdeps/powerpc/powerpc64/__longjmp-common.S [SHARED && !IS_IN_rtld]:
Store R2 from jmpbuf in callers TOC save area.
* sysdeps/powerpc/powerpc64/bsd-_setjmp.S [SHARED && !IS_IN_rtld]:
Store R2 in TOC save area.
* sysdeps/powerpc/powerpc64/setjmp-common.S [SHARED && !IS_IN_rtld]:
Copy TOC save area from previous frame as R2 (TOC) in jmpbuf.
2001-07-06 Paul Eggert <eggert@twinsun.com>
* manual/argp.texi: Remove ignored LGPL copyright notice; it's
not appropriate for documentation anyway.
* manual/libc-texinfo.sh: "Library General Public License" ->
"Lesser General Public License".
2001-07-06 Andreas Jaeger <aj@suse.de>
* All files under GPL/LGPL version 2: Place under LGPL version
2.1.
Mon Jan 20 03:02:50 1997 Ulrich Drepper <drepper@cygnus.com>
* Make-dist: Update and reformat copyright.
* Makeconfig: Likewise.
* assert/Makefile: Likewise.
* bare/Makefile: Likewise.
* ctype/Makefile: Likewise.
* dirent/Makefile: Likewise.
* gmon/Makefile: Likewise.
* gnulib/Makefile: Likewise.
* grp/Makefile: Likewise.
* hurd/Makefile: Likewise.
* intl/Makefile: Likewise.
* mach/Makefile: Likewise.
* malloc/Makefile: Likewise.
* manual/Makefile: Likewise.
* math/Makefile: Likewise.
* po/Makefile: Likewise.
* pwd/Makefile: Likewise.
* resource/Makefile: Likewise.
* setjmp/Makefile: Likewise.
* socket/Makefile: Likewise.
* string/Makefile: Likewise.
* sunrpc/Makefile: Likewise.
* sysdeps/alpha/Makefile: Likewise.
* sysdeps/gnu/Makefile: Likewise.
* sysdeps/m68k/fpu/switch/Makefile: Likewise.
* sysdeps/m68k/fpu/switch/68881-sw.h: Likewise.
* sysdeps/m68k/fpu/switch/switch.c: Likewise.
* sysdeps/mach/Makefile: Likewise.
* sysdeps/hurd/Makefile: Likewise.
* sysdeps/sparc/Makefile: Likewise.
* sysdeps/standalone/i960/nindy960/Makefile: Likewise.
* sysdeps/standalone/m68k/m68020/mvme136/Makefile: Likewise.
* sysdeps/unix/common/Makefile: Likewise.
* sysdeps/unix/sysv/Makefile: Likewise.
* sysdeps/unix/sysv/irix4/Makefile: Likewise.
* sysdeps/unix/sysv/sco3.2/Makefile: Likewise.
* sysdeps/unix/sysv/sysv4/Makefile: Likewise.
* sysdeps/vax/Makefile: Likewise.
* sysvipc/Makefile: Likewise.
* wcsmbs/Makefile: Likewise.
* wctype/Makefile: Likewise.
* elf/rtld.c (dl_main): Objects in LD_PRELOAD environment variable
are separated according to Sun docs by white space not colon.
* locale/C-time.c (_nl_C_LC_TIME): Use empty string to initialize
fields which are not defined for the C locale.
* sysdeps/m68k/fpu/switch/Makefile: Don't use ansidecl.h in constructed
files.
* sysdeps/m68k/fpu/switch/68881-sw.h: Likewise.
* sysdeps/m68k/fpu/switch/switch.c: Likewise.
Sun Jan 19 19:43:31 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* time/strptime.c: Provide prototype for strptime_internal.
Sun Jan 19 23:46:27 1997 Ulrich Drepper <drepper@cygnus.com>
* glibcbug.in: We don't guarantee confidential handling. Set
field to always contain `no'.
Sun Jan 19 21:28:01 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* intl/explodename.c: Include sys/types.h.
* intl/l10nflist.c: Likewise.
Sat Jan 18 22:15:26 1997 Richard Henderson <rth@tamu.edu>
* config.make.in (install_root): New variable to make it easy to
install glibc somewhere other than /.
* shlib-versions: alpha-*-linux-* libc=6.1.
Since sigset_t no longer fits in a register, we can't pass in the
thread's initial mask so easily. Take this opportunity to simplify
the clone implementation by only accepting a single void* argument.
* sysdeps/unix/sysv/linux/alpha/clone.S: Only take one argument.
* sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/clone.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/clone.S: Likewise.
* sysdeps/unix/sysv/linux/schedbits.h: Update clone prototypes.
* sysdeps/unix/sysv/linux/alpha/ioctl-types.h: Remove.
Default Linux version should be sufficient.
* sysdeps/unix/sysv/linux/alpha/sigprocmask.c: The osf_sigprocmask
system call wants the sigset dereferenced.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add entries for
__syscall_ustat and __syscall_xmknod.
* sysdeps/unix/sysv/linux/alpha/xmknod.c: Include sys/sysmacros.h.
* sysdeps/unix/sysv/linux/sigset.h: Use longs instead of ints.
* sysdeps/unix/sysv/linux/tcsetattr.c: Fix pointer dereferences.
* sysdeps/unix/sysv/linux/alpha/sigsuspend.c: Add comment about
dependency to kernel type.
* sysdeps/unix/sysv/linux/alpha/termbits.h: Correct comment.
* posix/unistd.h [__USE_BSD] (ttyslot): Declare it.
* posix/unistd.h [__USE_BSD] (L_SET, L_INCR, L_XTND): Define
unless L_SET already defined.
* misc/sys/file.h (L_SET, L_INCR, L_XTND): Don't define if L_SET
already defined.
Incorporated -lutil library from 4.4-Lite.
* misc/Makefile (extra-libs, libutil-routines): New variables.
* misc/login.c, misc/login_tty.c, misc/logout.c, misc/logwtmp.c,
sysdeps/generic/pty.c: New files for -lutil incorporated from 4.4-Lite.
Support simple, light-weight unwind-protect mechanism for longjmp.
* setjmp/longjmp.c: Call _longjmp_unwind first thing.
* sysdeps/mach/hurd/jmp-unwind.c: New file.
* sysdeps/stub/jmp-unwind.c: New file.
* sysdeps/i386/jmp_buf.h (_JMPBUF_UNWINDS): New macro.
* sysdeps/mips/jmp_buf.h (_JMPBUF_UNWINDS): New macro.
* setjmp/Makefile (routines): Add jmp-unwind.
* hurd/hurd/userlink.h (struct hurd_userlink): Move `next' and
`prevp' members into new substructure `resource'; add another such
substructure `thread' and members `cleanup' (function ptr) and
`cleanup_data' (generic ptr).
(_hurd_userlink_link, _hurd_userlink_unlink): Insert/remove LINK
into the `_hurd_self_sigstate ()->active_resources' list via the
`thread' substructure.
* hurd/hurd/port.h (_hurd_port_cleanup): Declare it.
(_hurd_port_locked_get): Set LINK->cleanup to _hurd_port_cleanup and
LINK->cleanup_data' to the port extracted.
* hurd/hurd/signal.h (struct hurd_sigstate): New member
`active_resources'.
* hurd/port-cleanup.c: New file.
* hurd/Makefile (routines): Add port-cleanup.
* malloc/malloc.c: Include errno.h.
Sat Mar 25 18:24:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/loadlocale.c (_nl_load_locale): Avoid */ inside comment.