mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 21:10:07 +00:00
11bf311edc
2007-01-11 Jakub Jelinek <jakub@redhat.com> * sysdeps/i386/soft-fp/sfp-machine.h: Remove. * sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise. 2007-01-10 Ulrich Drepper <drepper@redhat.com> * io/fts.c: Make sure fts_cur is always valid after return from fts_read. Patch by Miloslav Trmac <mitr@redhat.com>. 2006-10-27 Richard Sandiford <richard@codesourcery.com> * elf/elf.h (R_MIPS_GLOB_DAT): Define. (R_MIPS_NUM): Bump by 1. 2007-01-03 Jakub Jelinek <jakub@redhat.com> * posix/execvp.c: Include alloca.h. (allocate_scripts_argv): Renamed to... (scripts_argv): ... this. Don't allocate buffer here nor count arguments. (execvp): Use alloca if possible. * posix/Makefile: Add rules to build and run tst-vfork3 test. * posix/tst-vfork3.c: New test. * stdlib/Makefile (tst-strtod3-ENV): Define. 2007-01-02 Ulrich Drepper <drepper@redhat.com> * posix/getconf.c: Update copyright year. * nss/getent.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c: Likewise. * elf/ldconfig.c: Likewise. * catgets/gencat.c: Likewise. * csu/version.c: Likewise. * elf/ldd.bash.in: Likewise. * elf/sprof.c (print_version): Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * nscd/nscd.c (print_version): Likewise. * debug/xtrace.sh: Likewise. * malloc/memusage.sh: Likewise. * malloc/mtrace.pl: Likewise. * debug/catchsegv.sh: Likewise. 2006-12-24 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (sYSMALLOc): Remove some unnecessary alignment attempts. 2006-12-23 Ulrich Drepper <drepper@redhat.com> * posix/wordexp.c: Remove some unnecessary tests. 2006-12-20 SUGIOKA Toshinobu <sugioka@itonet.co.jp> * sysdeps/unix/sysv/linux/sh/bits/shm.h: New file. * nss/getXXbyYY_r.c: Include atomic.h. (INTERNAL (REENTRANT_NAME)): Write startp after start_fct, add atomic_write_barrier () in between. 2006-11-28 Jakub Jelinek <jakub@redhat.com> * elf/dl-support.c: Include dl-procinfo.h. * sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4, PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS, PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X): Define. (_dl_string_platform): Use PPC_PLATFORM_* macros instead of hardcoded constants. * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use PPC_PLATFORM_* macros for array designators. 2006-11-11 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap names to the beginning. (_dl_powerpc_platforms): Add "power6x". * sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease. (HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP. (_DL_PLATFORMS_COUNT): Increase. (_dl_string_platform): Handle power6x case. * sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP, PPC_FEATURE_POWER6_EXT): Define. (PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment. [-2^31 .. 2^31) range. * sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME. * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags): Handle relatime mount option. 2006-12-13 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include kernel-features.h. 2006-12-11 Ulrich Drepper <drepper@redhat.com> * stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand separators also if no non-zero digits found. * stdlib/Makefile (tests): Add tst-strtod3. [BZ #3664] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize empty parsed strings. * stdlib/Makefile (tests): Add tst-strtod2. * stdlib/tst-strtod2.c: New file. [BZ #3673] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit computation. * stdlib/Makefile (tests): Add tst-atof2. * stdlib/tst-atof2.c: New file. [BZ #3674] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value correctly if removing trailing zero of hex-float. * stdlib/Makefile (tests): Add tst-atof1. * stdlib/tst-atof1.c: New file. * misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest. Start searching for next comma at p rather than rest. * misc/Makefile (tests): Add tst-mntent2. * misc/tst-mntent2.c: New test. 2006-12-08 Ulrich Drepper <drepper@redhat.com> * malloc/memusage.c: Handle realloc with new size of zero and non-NULL pointer correctly. (me): Really write first record twice. (struct entry): Make format bi-arch safe. (dest): Write out more realloc statistics. * malloc/memusagestat.c (struct entry): Make format bi-arch safe. 2006-12-05 Jakub Jelinek <jakub@redhat.com> * nis/nis_subr.c (nis_getnames): Revert last change. 2006-12-03 Kaz Kojima <kkojima@rr.iij4u.or.jp> * sysdeps/unix/sysv/linux/sh/sys/io.h: Removed. 2006-11-30 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/i386/i686/memcmp.S: Use jump table as the base of jump table entries. 2006-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/i386/clone.S: Provide CFI for the outermost `clone' function to ensure proper unwinding stop of gdb. * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise. 2006-12-01 Ulrich Drepper <drepper@redhat.com> * nscd/nscd.init: Remove obsolete and commented-out -S option handling. 2006-11-23 Jakub Jelinek <jakub@redhat.com> [BZ #3514] * manual/string.texi (strncmp): Fix pastos from wcscmp description. [BZ #3515] * manual/string.texi (strtok): Remove duplicate paragraph. 2006-12-01 Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Fix compatibility with libgcc not supporting `rflags' unwinding (register # >= 17). 2006-11-30 Jakub Jelinek <jakub@redhat.com> * sunrpc/svc_run.c (svc_run): Set my_pollfd to new_pollfd if realloc succeeded. 2006-11-29 Daniel Jacobowitz <dan@codesourcery.com> Jakub Jelinek <jakub@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/x86_64/sigaction.c (restore_rt): Add correct unwind information. * sysdeps/unix/sysv/linux/x86_64/Makefile: Provide symbols for 'restore_rt' even in the 'signal' directory. * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: Extend the regs list. malloc crashed. Don't allocate memory unnecessarily in each loop. 2006-10-21 Jakub Jelinek <jakub@redhat.com> * resolv/mapv4v6addr.h (map_v4v6_address): Fix last change. 2006-11-20 Ulrich Drepper <drepper@redhat.com> * resolv/mapv4v6addr.h (map_v4v6_address): Optimize a bit. 2006-11-18 Bruno Haible <bruno@clisp.org> * sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke __sysconf only after having tried to call getgroups32. 2006-11-19 Ulrich Drepper <drepper@redhat.com> * nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style addresses for IPv4 queries if they can be mapped. 2006-11-16 Jakub Jelinek <jakub@redhat.com> * sysdeps/x86_64/fpu/s_copysignf.S (__copysignf): Switch to .text. * sysdeps/x86_64/fpu/s_copysign.S (__copysign): Likewise. (signmask): Add .size directive. (othermask): Add .type directive. 2006-11-14 Ulrich Drepper <drepper@redhat.com> * po/nl.po: Update from translation team. * timezone/zdump.c: Redo fix for BZ #3137. 2006-11-14 Jakub Jelinek <jakub@redhat.com> * nss/nss_files/files-alias.c (get_next_alias): Set line back to first_unused after parsing :include: file. * timezone/africa: Update from tzdata2006o. * timezone/antarctica: Likewise. * timezone/asia: Likewise. * timezone/australasia: Likewise. * timezone/backward: Likewise. * timezone/europe: Likewise. * timezone/iso3166.tab: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * timezone/zone.tab: Likewise. * time/tzfile.c (__tzfile_read): Extend to handle new file format on machines with 64-bit time_t. * timezone/checktab.awk: Update from tzcode2006o. * timezone/ialloc.c: Likewise. * timezone/private.h: Likewise. * timezone/scheck.c: Likewise. * timezone/tzfile.h: Likewise. * timezone/tzselect.ksh: Likewise. * timezone/zdump.c: Likewise. * timezone/zic.c: Likewise. [BZ #3483] * elf/ldconfig.c (main): Call setlocale and textdomain. Patch mostly by Benno Schulenberg <bensberg@justemail.net>. [BZ #3480] * manual/argp.texi: Fix typos. * manual/charset.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/lang.texi: Likewise. * manual/maint.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/time.texi: Likewise. Patch by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>. [BZ #3465] * sunrpc/clnt_raw.c: Minimal message improvements. * sunrpc/pm_getmaps.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/charmap.c: Likewise. * malloc/memusage.sh: Likewise. * elf/dl-deps.c: Likewise. * locale/programs/ld-collate.c: Likewise. * libio/vswprintf.c: Likewise. * malloc/memusagestat.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/rpc_main.c: Likewise. * nscd/cache.c: Likewise. * locale/programs/repertoire.c: Unify output messages. * locale/programs/charmap.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-time.c: Likewise. * elf/ldconfig.c: Likewise. * nscd/selinux.c: Likewise. * elf/cache.c: Likewise. Patch mostly by Benno Schulenberg <bensberg@justemail.net>. 2006-11-10 Jakub Jelinek <jakub@redhat.com> * string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization if N is one bigger than return value. * string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1 and l1 last arguments, if buf is defined, verify the return value equals to strlen (buf) and verify no byte beyond passed length is modified. 2006-11-10 Ulrich Drepper <drepper@redhat.com> * po/sv.po: Update from translation team. * sysdeps/gnu/siglist.c (__old_sys_siglist, __old_sys_sigabbrev): Use __new_sys_siglist instead of _sys_siglist_internal as second macro argument. (_old_sys_siglist): Use declare_symbol_alias macro instead of strong_alias. 2006-11-09 Ulrich Drepper <drepper@redhat.com> [BZ #3493] * posix/unistd.h (sysconf): Remove const attribute. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for temporary or deprecated addresses. Patch by Sridhar Samudrala <sri@us.ibm.com>. * string/Makefile (tests): Add tst-strxfrm2. * string/tst-strxfrm2.c: New file. 2006-10-09 Jakub Jelinek <jakub@redhat.com> * elf/dl-debug.c (_dl_debug_initialize): Check r->r_map for 0 rather than r->r_brk. * string/strxfrm_l.c (STRXFRM): Do the trailing \1 removal optimization even if needed > n. 2006-11-07 Jakub Jelinek <jakub@redhat.com> * include/libc-symbols.h (declare_symbol): Rename to... (declare_symbol_alias): ... this. Add ORIGINAL argument, imply strong_alias (ORIGINAL, SYMBOL) in asm to make sure it preceedes .size directive. * sysdeps/gnu/errlist-compat.awk: Adjust for declare_symbol_alias changes. * sysdeps/gnu/siglist.c: Likewise. 2006-11-03 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/fpu/bits/mathinline.h [__LIBC_INTERNAL_MATH_INLINES]: Moved to ... * sysdeps/powerpc/fpu/math_private.h: ...here. New file. 2006-11-05 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): Update handling of cache descriptor 0x49 for new models. * sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word): Likewise. 2006-11-02 Ulrich Drepper <drepper@redhat.com> * configure.in: Work around ld --help change and avoid -z relro test completely if the architecture doesn't care about security. 2006-11-01 Ulrich Drepper <drepper@redhat.com> * po/sv.po: Update from translation team. 2006-10-31 Ulrich Drepper <drepper@redhat.com> * stdlib/atexit.c (atexit): Don't mark as hidden when used to generate compatibility version. 2006-10-29 Ulrich Drepper <drepper@redhat.com> * configure.in: Relax -z relro requirement a bit. * po/sv.po: Update from translation team. 2006-10-29 Jakub Jelinek <jakub@redhat.com> * elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P. * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise. * elf/dl-close.c (_dl_close_worker): Likewise. * elf/dl-open.c (_dl_open_worker): Likewise. * sysdeps/generic/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): Define. * configure.in: Require assembler support for visibility, compiler support for visibility and aliases, linker support for various -z options. * Makeconfig: Remove conditional code which now is unnecessary. * config.h.in: Likewise. * config.make.in: Likewise. * dlfcn/Makefile: Likewise. * elf/Makefile: Likewise. * elf/dl-load.c: Likewise. * elf/rtld.c: Likewise. * include/libc-symbols.h: Likewise. * include/stdio.h: Likewise. * io/Makefile: Likewise. * io/fstat.c: Likewise. * io/fstat64.c: Likewise. * io/fstatat.c: Likewise. * io/fstatat64.c: Likewise. * io/lstat.c: Likewise. * io/lstat64.c: Likewise. * io/mknod.c: Likewise. * io/mknodat.c: Likewise. * io/stat.c: Likewise. * io/stat64.c: Likewise. * libio/stdio.c: Likewise. * nscd/Makefile: Likewise. * stdlib/Makefile: Likewise. * stdlib/atexit.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/i386/sysdep.h: Likewise. * sysdeps/i386/i686/memcmp.S: Likewise. * sysdeps/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise. * Makerules: USE_TLS support is now default. * tls.make.c: Likewise. * csu/Versions: Likewise. * csu/libc-start.c: Likewise. * csu/libc-tls.c: Likewise. * csu/version.c: Likewise. * dlfcn/dlinfo.c: Likewise. * elf/dl-addr.c: Likewise. * elf/dl-cache.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-iteratephdr.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-object.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-sysdep.c: Likewise. * elf/dl-tls.c: Likewise. * elf/ldconfig.c: Likewise. * elf/rtld.c: Likewise. * elf/tst-tls-dlinfo.c: Likewise. * elf/tst-tls1.c: Likewise. * elf/tst-tls10.h: Likewise. * elf/tst-tls14.c: Likewise. * elf/tst-tls2.c: Likewise. * elf/tst-tls3.c: Likewise. * elf/tst-tls4.c: Likewise. * elf/tst-tls5.c: Likewise. * elf/tst-tls6.c: Likewise. * elf/tst-tls7.c: Likewise. * elf/tst-tls8.c: Likewise. * elf/tst-tls9.c: Likewise. * elf/tst-tlsmod1.c: Likewise. * elf/tst-tlsmod13.c: Likewise. * elf/tst-tlsmod13a.c: Likewise. * elf/tst-tlsmod14a.c: Likewise. * elf/tst-tlsmod2.c: Likewise. * elf/tst-tlsmod3.c: Likewise. * elf/tst-tlsmod4.c: Likewise. * elf/tst-tlsmod5.c: Likewise. * elf/tst-tlsmod6.c: Likewise. * include/errno.h: Likewise. * include/link.h: Likewise. * include/tls.h: Likewise. * locale/global-locale.c: Likewise. * locale/localeinfo.h: Likewise. * malloc/arena.c: Likewise. * malloc/hooks.c: Likewise. * malloc/malloc.c: Likewise. * resolv/Versions: Likewise. * sysdeps/alpha/dl-machine.h: Likewise. * sysdeps/alpha/libc-tls.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/tls.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/ia64/libc-tls.c: Likewise. * sysdeps/mach/hurd/fork.c: Likewise. * sysdeps/mach/hurd/i386/tls.h: Likewise. * sysdeps/powerpc/powerpc32/dl-machine.c: Likwise. * sysdeps/powerpc/powerpc32/dl-machine.h: Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h: Likewise. * sysdeps/s390/libc-tls.c: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/x86_64/dl-machine.h: Likewise. [BZ #3426] * stdlib/stdlib.h: Adjust comment for canonicalize_file_name to reality. 2006-10-27 Jakub Jelinek <jakub@redhat.com> * elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope argument. (_dl_lookup_symbol_x): Adjust caller. * sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove _ns_global_scope. * elf/rtld.c (dl_main): Don't initialize _ns_global_scope. * elf/dl-libc.c: Revert l_scope name changes. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * elf/dl-close.c (_dl_close): Likewise. * elf/dl-open.c (dl_open_worker): Likewise. If not SINGLE_THREAD_P, always use __rtld_mrlock_{change,done}. Always free old scope list here if not l_scope_mem. * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name change. Never free scope list here. Just __rtld_mrlock_lock before the lookup and __rtld_mrlock_unlock it after the lookup. * elf/dl-sym.c: Likewise. * include/link.h (struct r_scoperec): Remove. (struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem with l_scope_mem and l_scoperec_lock with l_scope_lock. 2006-10-25 Ulrich Drepper <drepper@redhat.com> * sysdeps/gnu/netinet/tcp.h: Define TCP_CONGESTION. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * configure.in: Disable building profile libraries by default. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to _dl_lookup_symbol_x code. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * elf/dl-runtime.c: Include sysdep-cancel.h. (_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-sym.c: Include sysdep-cancel.h. (do_sym): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-close.c: Include sysdep-cancel.h. (_dl_close): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-open.c: Include sysdep-cancel.h. (dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. 2006-10-17 Jakub Jelinek <jakub@redhat.com> [BZ #3313] * malloc/malloc.c (malloc_consolidate): Set maxfb to address of last fastbin rather than end of fastbin array. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct body macro. * sysdeps/x86_64/bits/atomic.h (__arch_c_compare_and_exchange_val_64_acq): Add missing casts. (catomic_decrement): Use correct body macro. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * include/atomic.h: Add a unique prefix to all local variables in macros. * csu/tst-atomic.c (do_test): Test also catomic_* macros. 2006-10-14 Ulrich Drepper <drepper@redhat.com> * resolv/arpa/nameser.h: Document that ns_t_a6 is deprecated. [BZ #3313] * malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to determine highest fast bin to consolidate, always look into all of them. (do_check_malloc_state): Only require for empty bins for large sizes in main arena. * libio/stdio.h: Add more __wur attributes. 2006-11-12 Andreas Jaeger <aj@suse.de> [BZ #2510] * manual/search.texi (Hash Search Function): Clarify. (Array Search Function): Clarify. 2006-11-12 Joseph Myers <joseph@codesourcery.com> [BZ #2830] * math/atest-exp.c (main): Cast hex value to mp_limb_t before shifting. * math/atest-exp2.c (read_mpn_hex): Likewise. * math/atest-sincos.c (main): Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Add epoll_pwait. * sysdeps/unix/sysv/linux/sys/epoll.h: Declare epoll_pwait. * sysdeps/unix/sysv/linux/Versions (libc): Add epoll_pwait for version GLIBC_2.6. * Versions.def: Add GLIBC_2.6 for libc. * sysdeps/i386/i486/bits/atomic.h: Add catomic_* support. 2006-10-11 Jakub Jelinek <jakub@redhat.com> * malloc/malloc.c (_int_malloc): Remove unused any_larger variable. * nis/nis_defaults.c (__nis_default_access): Don't call getenv twice. * nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of getenv. * sysdeps/generic/unsecvars.h: Add NIS_PATH. 2006-10-11 Ulrich Drepper <drepper@redhat.com> * include/atomic.c: Define catomic_* operations. * sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems. * stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*. * malloc/memusage.c: Likewise. * gmon/mcount.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-fptr.c: Likewise. * resolv/res_libc.c: Likewise. 2006-10-10 Roland McGrath <roland@frob.com> * sysdeps/mach/hurd/utimes.c: Use a union to avoid an improper cast. * sysdeps/mach/hurd/futimes.c: Likewise. * sysdeps/mach/hurd/lutimes.c: Likewise. 2006-10-09 Ulrich Drepper <drepper@redhat.com> Jakub Jelinek <jakub@redhat.com> Implement reference counting of scope records. * elf/dl-close.c (_dl_close): Remove all scopes from removed objects from the list in objects which remain. Always allocate new scope record. * elf/dl-open.c (dl_open_worker): When growing array for scopes, don't resize, allocate a new one. * elf/dl-runtime.c: Update reference counters before using a scope array. * elf/dl-sym.c: Likewise. * elf/dl-libc.c: Adjust for l_scope name change. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * include/link.h: Include <rtld-lowlevel.h>. Define struct r_scoperec. Replace r_scope with pointer to r_scoperec structure. Add l_scoperec_lock. * sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>. * sysdeps/generic/rtld-lowlevel.h: New file. * include/atomic.h: Rename atomic_and to atomic_and_val and atomic_or to atomic_or_val. Define new macros atomic_and and atomic_or which do not return values. * sysdeps/x86_64/bits/atomic.h: Define atomic_and and atomic_or. Various cleanups. * sysdeps/i386/i486/bits/atomic.h: Likewise. * po/sv.po: Update from translation team. 2006-10-07 Ulrich Drepper <drepper@redhat.com> * Versions.def: Add GLIBC_2.6 to libpthread. * include/shlib-compat.h (SHLIB_COMPAT): Expand parameters before use. (versioned_symbol): Likewise. (compat_symbol): Likewise. * po/tr.po: Update from translation team. * nis/Banner: Removed. It's been integral part forever and the author info is incomplete anyway. * libio/Banner: Likewise. 2006-10-06 Ulrich Drepper <drepper@redhat.com> * version.h (VERSION): Bump to 2.5.90 for new development tree.
1434 lines
49 KiB
Plaintext
1434 lines
49 KiB
Plaintext
# Copyright (C) 1991-2002,2003,2004,2005,2006 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 Lesser General Public
|
||
# License as published by the Free Software Foundation; either
|
||
# version 2.1 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
|
||
# Lesser General Public License for more details.
|
||
|
||
# You should have received a copy of the GNU Lesser General Public
|
||
# License along with the GNU C Library; if not, write to the Free
|
||
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||
# 02111-1307 USA.
|
||
|
||
#
|
||
# Common rules for making the GNU C library. This file is included
|
||
# by the top-level Makefile and by all subdirectory makefiles
|
||
# (through Rules).
|
||
#
|
||
ifneq (,)
|
||
This makefile requires GNU Make.
|
||
endif
|
||
|
||
REQUIRED_MAKE_VERSION = 3.74
|
||
REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
|
||
|
||
ifneq ($(REQUIRED_MAKE_VERSION), \
|
||
$(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
|
||
Wrong GNU Make version. See above for the version needed.
|
||
endif
|
||
|
||
|
||
ifdef subdir
|
||
.. := ../
|
||
endif # subdir
|
||
|
||
# If `sources' was defined by the parent makefile, undefine it so
|
||
# we will later get it from wildcard search in this directory.
|
||
ifneq "$(findstring env,$(origin sources))" ""
|
||
sources :=
|
||
endif
|
||
|
||
oPATH := $(PATH)
|
||
PATH := this definition should take precedence over $(oPATH)
|
||
ifeq ($(PATH),$(oPATH))
|
||
You must not use the -e flag when building the GNU C library.
|
||
else
|
||
PATH := $(oPATH)
|
||
endif
|
||
|
||
ifndef +included-Makeconfig
|
||
include $(..)Makeconfig
|
||
endif
|
||
|
||
# This variable is used in ``include $(o-iterator)'' after defining
|
||
# $(o-iterator-doit) to produce some desired rule using $o for the object
|
||
# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
|
||
# is produced for each object suffix in use.
|
||
o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
|
||
|
||
# Include any system-specific makefiles.
|
||
|
||
# This is here so things in sysdep Makefiles can easily depend on foo.h as
|
||
# appropriate and not worry about where foo.h comes from, which may be
|
||
# system dependent and not known by that Makefile.
|
||
vpath %.h $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
|
||
$(+sysdep_dirs) $(..)))
|
||
|
||
# The same is true for RPC source files.
|
||
vpath %.x $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
|
||
$(+sysdep_dirs) $(..)))
|
||
|
||
# Some sysdep makefiles use this to distinguish being included here from
|
||
# being included individually by a subdir makefile (hurd/Makefile needs this).
|
||
in-Makerules := yes
|
||
|
||
sysdep-makefiles := $(wildcard $(sysdirs:=/Makefile))
|
||
ifneq (,$(sysdep-makefiles))
|
||
include $(sysdep-makefiles)
|
||
endif
|
||
|
||
|
||
# Reorder before-compile so that mach things come first, and hurd things
|
||
# second, before all else. The mach and hurd subdirectories have many
|
||
# generated header files which the much of rest of the library depends on,
|
||
# so it is best to build them first (and mach before hurd, at that).
|
||
before-compile := $(filter $(common-objpfx)mach% $(common-objpfx)hurd%,\
|
||
$(before-compile)) \
|
||
$(filter-out $(common-objpfx)mach% $(common-objpfx)hurd%,\
|
||
$(before-compile))
|
||
|
||
# Even before that, we need abi-versions.h which is generated right here.
|
||
ifeq ($(versioning),yes)
|
||
ifndef avoid-generated
|
||
before-compile := $(common-objpfx)abi-versions.h $(before-compile)
|
||
$(common-objpfx)abi-versions.h: $(..)scripts/abi-versions.awk \
|
||
$(common-objpfx)Versions.all
|
||
LC_ALL=C $(AWK) -v oldest_abi=$(oldest-abi) -f $^ > $@T
|
||
mv -f $@T $@
|
||
|
||
$(common-objpfx)%.latest: $(common-objpfx)abi-versions.h
|
||
sed -n '/ VERSION_$*_/{s/^.*_\([A-Z0-9_]*\).*$$/\1/;h;};$${g;p;}' \
|
||
$(common-objpfx)abi-versions.h > $@T
|
||
mv -f $@T $@
|
||
endif # avoid-generated
|
||
endif # $(versioning) = yes
|
||
|
||
# Make sure the subdirectory for object files gets created.
|
||
ifdef objpfx
|
||
ifeq (,$(wildcard $(objpfx).))
|
||
before-compile += $(objpfx).
|
||
$(objpfx).:
|
||
$(make-target-directory)
|
||
endif
|
||
endif
|
||
|
||
# Remove existing files from `before-compile'. Things are added there when
|
||
# they must exist for dependency generation to work right, but once they
|
||
# exist there is no further need for every single file to depend on them,
|
||
# and those gratuitous dependencies result in many gratuitous
|
||
# recompilations.
|
||
before-compile := $(filter-out $(wildcard $(before-compile)),$(before-compile))
|
||
|
||
# Don't let any before-compile file be an intermediate and get removed.
|
||
ifdef before-compile
|
||
$(before-compile):
|
||
endif
|
||
|
||
# We don't want $(common-objpfx) files to depend on miscellaneous stuff
|
||
# in subdirs.
|
||
ifdef subdir
|
||
common-before-compile := $(filter-out $(objpfx)%,$(before-compile))
|
||
else
|
||
common-before-compile = $(before-compile)
|
||
endif
|
||
|
||
ifndef subdir
|
||
# If a makefile needs to do something conditional on something that
|
||
# can only be figured out from headers, write a FOO.make.c input
|
||
# file that uses cpp contructs and contains @@@ LINE @@@ for each LINE
|
||
# to emit in the generated makefile, and use -include $(common-objpfx)FOO.make.
|
||
#
|
||
# We only generate these in the top-level makefile, to avoid any weirdness
|
||
# from subdir-specific makefile tweaks creeping in on an update.
|
||
$(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(common-before-compile)
|
||
rm -f $@T $@.dT
|
||
(echo '# Generated from $*.make.c by Makerules.'; \
|
||
$(CC) $(CFLAGS) $(CPPFLAGS) -E -DASSEMBLER $< \
|
||
-MD -MP -MT '$$(common-objpfx)$*.make' -MF $@.dT \
|
||
| sed -n '/@@@/{s/@@@[ ]*\(.*\)@@@/\1/;s/[ ]*$$//p;}'; \
|
||
echo 'common-generated += $(@F)'; \
|
||
sed $(sed-remove-objpfx) $(sed-remove-dotdot) $@.dT; \
|
||
rm -f $@.dT) > $@T
|
||
mv -f $@T $@
|
||
endif
|
||
|
||
ifdef subdir
|
||
sed-remove-dotdot := -e 's@ *\.\.\/\([^ \]*\)@ $$(..)\1@g' \
|
||
-e 's@^\.\.\/\([^ \]*\)@$$(..)\1@g'
|
||
else
|
||
sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' \
|
||
-e 's@^\([^ \/$$][^ \]*\)@$$(..)\1@g'
|
||
endif
|
||
|
||
|
||
ifdef gen-as-const-headers
|
||
# Generating headers for assembly constants.
|
||
# We need this defined early to get into before-compile before
|
||
# it's used in sysd-rules, below.
|
||
$(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
|
||
%.sym $(common-before-compile)
|
||
$(AWK) -f $< $(filter %.sym,$^) \
|
||
| $(CC) -S -o $(@:.h.d=.h)T3 $(CFLAGS) $(CPPFLAGS) -x c - \
|
||
-MD -MP -MF $(@:.h=.h.d)T -MT '$(@:.h=.h.d) $(@:.h.d=.h)'
|
||
sed -n 's/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$$/#define \1 \2/p' \
|
||
$(@:.h.d=.h)T3 > $(@:.h.d=.h)T
|
||
rm -f $(@:.h.d=.h)T3
|
||
sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
|
||
$(@:.h=.h.d)T > $(@:.h=.h.d)T2
|
||
rm -f $(@:.h=.h.d)T
|
||
mv -f $(@:.h=.h.d)T2 $(@:.h=.h.d)
|
||
mv -f $(@:.h.d=.h)T $(@:.h.d=.h)
|
||
vpath %.sym $(sysdirs)
|
||
before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
|
||
|
||
tests += $(gen-as-const-headers:%.sym=test-as-const-%)
|
||
generated += $(gen-as-const-headers:%.sym=test-as-const-%.c)
|
||
$(objpfx)test-as-const-%.c: $(..)scripts/gen-as-const.awk $(..)Makerules \
|
||
%.sym $(common-objpfx)%.h
|
||
($(AWK) '{ sub(/^/, "asconst_", $$2); print; }' $(filter %.h,$^); \
|
||
$(AWK) -v test=1 -f $< $(filter %.sym,$^); \
|
||
echo '#include "$(..)test-skeleton.c"') > $@T
|
||
mv -f $@T $@
|
||
endif
|
||
|
||
# Generate an ordered list of implicit rules which find the source files in
|
||
# each sysdep directory. The old method was to use vpath to search all the
|
||
# sysdep directories. However, that had the problem that a .S file in a
|
||
# later directory would be chosen over a .c file in an earlier directory,
|
||
# which does not preserve the desired sysdeps ordering behavior.
|
||
|
||
# System-dependent makefiles can put in `inhibit-sysdep-asm' wildcard
|
||
# patterns matching sysdep directories whose assembly source files should
|
||
# be suppressed.
|
||
ifdef inhibit-sysdep-asm
|
||
define open-check-inhibit-asm
|
||
case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) : ;; *)
|
||
endef
|
||
close-check-inhibit-asm = ;; esac ;
|
||
endif
|
||
|
||
-include $(common-objpfx)sysd-rules
|
||
ifneq ($(sysd-rules-sysdirs),$(config-sysdirs))
|
||
# The value of $(+sysdep_dirs) the sysd-rules was computed for
|
||
# differs from the one we are using now. So force a rebuild of sysd-rules.
|
||
sysd-rules-force = FORCE
|
||
FORCE:
|
||
endif
|
||
$(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
|
||
$(sysdep-makefiles) $(sysd-rules-force)
|
||
-@rm -f $@T
|
||
(echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \
|
||
for dir in $(config-sysdirs); do \
|
||
case "$$dir" in \
|
||
/*) ;; \
|
||
*) dir="\$$(..)$$dir" ;; \
|
||
esac; \
|
||
for o in $(all-object-suffixes); do \
|
||
$(open-check-inhibit-asm) \
|
||
echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
|
||
\$$(compile-command.S)"; \
|
||
echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \
|
||
\$$(compile-command.s)"; \
|
||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \
|
||
\$$(compile-command.S)"; \
|
||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \
|
||
\$$(compile-command.s)"; \
|
||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.S \$$(before-compile); \
|
||
\$$(compile-command.S)"; \
|
||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.s \$$(before-compile); \
|
||
\$$(compile-command.s)"; \
|
||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.S \$$(before-compile); \
|
||
\$$(compile-command.S)"; \
|
||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.s \$$(before-compile); \
|
||
\$$(compile-command.s)"; \
|
||
$(close-check-inhibit-asm) \
|
||
echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \
|
||
\$$(compile-command.c)"; \
|
||
echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \
|
||
\$$(compile-command.c)"; \
|
||
echo "\$$(objpfx)ptw-%$$o: $$dir/%.c \$$(before-compile); \
|
||
\$$(compile-command.c)"; \
|
||
echo "\$$(objpfx)m_%$$o: $$dir/s_%.c \$$(before-compile); \
|
||
\$$(compile-command.c)"; \
|
||
done; \
|
||
echo "\$$(inst_includedir)/%.h: $$dir/%.h \$$(+force); \
|
||
\$$(do-install)"; \
|
||
done; \
|
||
echo 'sysd-rules-done = t') > $@T
|
||
mv -f $@T $@
|
||
|
||
ifndef sysd-rules-done
|
||
# Don't do deps until this exists, because it provides rules to make the deps.
|
||
no_deps=t
|
||
endif
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: %.cc $(before-compile); $$(compile-command.cc)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
# Omit the objpfx rules when building in the source tree, because
|
||
# objpfx is empty and so these rules just override the ones above.
|
||
ifdef objpfx
|
||
# Define first rules to find the source files in $(objpfx).
|
||
# Generated source files will end up there.
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
|
||
endef
|
||
object-suffixes-left := $(all-object-suffixes)
|
||
include $(o-iterator)
|
||
endif
|
||
|
||
# Generate version maps, but wait until sysdep-subdirs is known
|
||
ifeq ($(sysd-sorted-done),t)
|
||
ifeq ($(versioning),yes)
|
||
-include $(common-objpfx)sysd-versions
|
||
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
|
||
common-generated += $(version-maps)
|
||
postclean-generated += sysd-versions Versions.all abi-versions.h \
|
||
Versions.def.v.i Versions.def.v Versions.v.i Versions.v
|
||
|
||
ifndef avoid-generated
|
||
ifneq ($(sysd-versions-subdirs),$(sorted-subdirs) $(config-sysdirs))
|
||
sysd-versions-force = FORCE
|
||
FORCE:
|
||
endif
|
||
# See %.v/%.v.i implicit rules in Makeconfig.
|
||
$(common-objpfx)Versions.def.v.i: $(..)Versions.def \
|
||
$(wildcard $(add-ons:%=$(..)%/Versions.def))
|
||
$(common-objpfx)Versions.all: $(..)scripts/firstversions.awk \
|
||
$(common-objpfx)soversions.i \
|
||
$(common-objpfx)Versions.def.v
|
||
{ while read which lib version setname; do \
|
||
test x"$$which" = xDEFAULT || continue; \
|
||
test -z "$$setname" || echo "$$lib : $$setname"; \
|
||
done < $(word 2,$^); \
|
||
cat $(word 3,$^); \
|
||
} | LC_ALL=C $(AWK) -f $< > $@T
|
||
mv -f $@T $@
|
||
# See %.v/%.v.i implicit rules in Makeconfig.
|
||
$(common-objpfx)Versions.v.i: $(wildcard $(subdirs:%=$(..)%/Versions)) \
|
||
$(wildcard $(sysdirs:%=%/Versions)) \
|
||
$(common-objpfx)abi-versions.h \
|
||
$(sysd-versions-force)
|
||
$(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
|
||
$(common-objpfx)Versions.v \
|
||
$(..)scripts/versions.awk
|
||
( echo 'sysd-versions-subdirs = $(subdirs) $(config-sysdirs)' ; \
|
||
cat $(word 2,$^) \
|
||
| LC_ALL=C $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
|
||
-v move_if_change='$(move-if-change)' \
|
||
-f $(word 3,$^); \
|
||
) > $@T
|
||
mv -f $@T $@
|
||
endif # avoid-generated
|
||
endif # $(versioning) = yes
|
||
endif # sysd-sorted-done
|
||
|
||
# Generate .dT files as we compile.
|
||
compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
|
||
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||
compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||
compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
|
||
|
||
# GCC can grok options after the file name, and it looks nicer that way.
|
||
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
|
||
compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
|
||
compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
|
||
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
|
||
COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
|
||
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
|
||
COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
|
||
|
||
# We need this for the output to go in the right place. It will default to
|
||
# empty if make was configured to work with a cc that can't grok -c and -o
|
||
# together. You can't compile the C library with such a compiler.
|
||
OUTPUT_OPTION = -o $@
|
||
|
||
# We need the $(CFLAGS) to be in there to have the right predefines during
|
||
# the dependency run for C sources. But having it for assembly sources can
|
||
# get the wrong predefines.
|
||
S-CPPFLAGS = -DASSEMBLER $(asm-CPPFLAGS)
|
||
|
||
define +make-deps
|
||
$(make-target-directory)
|
||
$(+mkdep) $< $(if $(filter %.c,$<),$(CFLAGS)) \
|
||
$(CPPFLAGS) $($(patsubst .%,%,$(suffix $(<F)))-CPPFLAGS) | sed -e\
|
||
's,$(subst .,\.,$(@F:.d=.o)),$(foreach o,$(all-object-suffixes),$(@:.d=$o)) $@,' \
|
||
$(sed-remove-objpfx) $(sed-remove-dotdot) > $(@:.d=.T)
|
||
mv -f $(@:.d=.T) $@ $(generate-md5)
|
||
endef
|
||
|
||
ifneq (,$(objpfx))
|
||
# Continuation lines here are dangerous because they introduce spaces!
|
||
define sed-remove-objpfx
|
||
-e 's@ $(subst .,\.,$(subst @,\@,$(common-objpfx)))@ $$(common-objpfx)@g' \
|
||
-e 's@^$(subst .,\.,$(subst @,\@,$(common-objpfx)))@$$(common-objpfx)@g'
|
||
endef
|
||
endif
|
||
|
||
# Modify the list of routines we build for different targets
|
||
|
||
ifeq (yesyes,$(build-shared)$(elf))
|
||
ifndef libc.so-version
|
||
# Undefine this because it can't work when we libc.so is unversioned.
|
||
static-only-routines =
|
||
endif
|
||
endif
|
||
|
||
# Bounded pointer thunks are only built for *.ob
|
||
elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
|
||
|
||
elide-routines.oS += $(filter-out $(static-only-routines),\
|
||
$(routines) $(aux) $(sysdep_routines)) \
|
||
$(elide-bp-thunks)
|
||
elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
|
||
|
||
# If we have versioned code we don't need the old versions in any of the
|
||
# static libraries.
|
||
elide-routines.o += $(shared-only-routines) $(elide-bp-thunks)
|
||
elide-routines.op += $(shared-only-routines) $(elide-bp-thunks)
|
||
elide-routines.og += $(shared-only-routines) $(elide-bp-thunks)
|
||
elide-routines.ob += $(shared-only-routines)
|
||
|
||
# Shared library building.
|
||
|
||
ifeq (yes,$(build-shared))
|
||
|
||
# Reference map file only when versioning is selected and a map file name
|
||
# is given.
|
||
ifeq ($(versioning),yes)
|
||
map-file = $(firstword $($(@F:.so=-map)) \
|
||
$(addprefix $(common-objpfx), \
|
||
$(filter $(@F:.so=.map),$(version-maps))))
|
||
load-map-file = $(map-file:%=-Wl,--version-script=%)
|
||
endif
|
||
|
||
# Pattern rule to build a shared object from an archive of PIC objects.
|
||
# This must come after the installation rules so Make doesn't try to
|
||
# build shared libraries in place from the installed *_pic.a files.
|
||
# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
|
||
# on other shared objects.
|
||
lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp)
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
(echo '#!'; \
|
||
dump -g $< | sed '1,6d' | cut -f2 | sort | uniq) > $(<:a=exp)
|
||
endif
|
||
$(build-shlib)
|
||
|
||
ifeq ($(elf),yes)
|
||
define build-shlib-helper
|
||
$(LINK.o) -shared $(static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) \
|
||
$(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(config-LDFLAGS) \
|
||
$(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
|
||
$(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
|
||
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
|
||
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
|
||
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
|
||
endef
|
||
else
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
define build-shlib-helper
|
||
$(LINK.o) -Wl,-G,-bM:SRE,-bnoentry,-bE:$(<:a=exp) \
|
||
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(extra-B-$(@F:lib%.so=%).so) \
|
||
$(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
|
||
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
|
||
-L$(subst :, -L,$(rpath-link))
|
||
endef
|
||
else
|
||
endif
|
||
endif
|
||
|
||
ifeq (yes,$(elf))
|
||
# binutils only position loadable notes into the first page for binaries,
|
||
# not for shared objects
|
||
$(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
|
||
$(LINK.o) -shared -Wl,-O1 \
|
||
-nostdlib -nostartfiles \
|
||
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
|
||
-Wl,--verbose 2>&1 | \
|
||
sed > $@T \
|
||
-e '/^=========/,/^=========/!d;/^=========/d' \
|
||
$(if $(filter yes,$(have-hash-style)), \
|
||
-e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
||
-e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \
|
||
-e '/DATA_SEGMENT_ALIGN/{H;g}' \
|
||
, \
|
||
-e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
||
) \
|
||
-e 's/^.*\*(\.dynbss).*$$/& \
|
||
PROVIDE(__start___libc_freeres_ptrs = .); \
|
||
*(__libc_freeres_ptrs) \
|
||
PROVIDE(__stop___libc_freeres_ptrs = .);/'\
|
||
-e 's@^.*\*(\.jcr).*$$@& \
|
||
PROVIDE(__start___libc_subfreeres = .);\
|
||
__libc_subfreeres : { *(__libc_subfreeres) }\
|
||
PROVIDE(__stop___libc_subfreeres = .);\
|
||
PROVIDE(__start___libc_atexit = .);\
|
||
__libc_atexit : { *(__libc_atexit) }\
|
||
PROVIDE(__stop___libc_atexit = .);\
|
||
PROVIDE(__start___libc_thread_subfreeres = .);\
|
||
__libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
|
||
PROVIDE(__stop___libc_thread_subfreeres = .);\
|
||
/DISCARD/ : { *(.gnu.glibc-stub.*) }@'
|
||
mv -f $@T $@
|
||
common-generated += shlib.lds
|
||
|
||
define build-shlib
|
||
$(build-shlib-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
||
$(csu-objpfx)abi-note.o $(build-shlib-objlist)
|
||
endef
|
||
else
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
define build-shlib
|
||
$(build-shlib-helper) \
|
||
-o $@ \
|
||
$(filter-out $(map-file) $(+preinit) $(+postinit),$^) \
|
||
$(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so)
|
||
endef
|
||
define build-shlib
|
||
$(build-shlib-helper) \
|
||
$(build-shlib-objlist)
|
||
endef
|
||
endif
|
||
endif
|
||
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
define build-module-helper
|
||
$(LINK.o) -Wl,-G -Wl,-bM:SRE -Wl,-bnoentry -Wl,-bexpall \
|
||
$(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||
$(load-map-file) \
|
||
$(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
|
||
-L$(subst :, -L,$(rpath-link)) -Wl,-L=$(rpath-link)
|
||
endef
|
||
else
|
||
define build-module-helper
|
||
$(LINK.o) -shared $(static-libgcc) $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||
$(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) \
|
||
-B$(csu-objpfx) $(load-map-file) \
|
||
$(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
|
||
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
|
||
endef
|
||
endif
|
||
|
||
# This macro is similar to build-shlib but it does not define a soname
|
||
# and it does not depend on the destination name to start with `lib'.
|
||
ifeq (yes,$(elf))
|
||
# binutils only position loadable notes into the first page for binaries,
|
||
# not for shared objects
|
||
define build-module
|
||
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
||
$(csu-objpfx)abi-note.o $(build-module-objlist)
|
||
endef
|
||
define build-module-asneeded
|
||
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
||
$(csu-objpfx)abi-note.o \
|
||
-Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed
|
||
endef
|
||
else
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
define build-module
|
||
$(build-module-helper) \
|
||
-o $@ \
|
||
$(filter-out $(map-file) $(+preinit) $(+postinit),$^) \
|
||
$(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so)
|
||
endef
|
||
else
|
||
define build-module
|
||
define build-module
|
||
$(build-module-helper) \
|
||
-o $@ \
|
||
$(build-module-objlist)
|
||
endef
|
||
endif
|
||
endif
|
||
|
||
build-module-helper-objlist = \
|
||
$(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
|
||
$(filter-out %.lds $(map-file) $(+preinit) $(+postinit),$^))
|
||
whole-archive := -Wl,--whole-archive
|
||
|
||
build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
|
||
build-shlib-objlist = $(build-module-helper-objlist) \
|
||
$(LDLIBS-$(@F:lib%.so=%).so)
|
||
|
||
# Don't try to use -lc when making libc.so itself.
|
||
# Also omits crti.o and crtn.o, which we do not want
|
||
# since we define our own `.init' section specially.
|
||
LDFLAGS-c.so = -nostdlib -nostartfiles
|
||
# But we still want to link libc.so against $(libc.so-gnulib).
|
||
LDLIBS-c.so += $(libc.so-gnulib)
|
||
# Give libc.so an entry point and make it directly runnable itself.
|
||
LDFLAGS-c.so += -e __libc_main
|
||
# If lazy relocation is disabled add the -z now flag.
|
||
ifeq ($(bind-now),yes)
|
||
LDFLAGS-c.so += -Wl,-z,now
|
||
endif
|
||
# Pre-link the objects of libc_pic.a so that we can locally resolve
|
||
# COMMON symbols before we link against ld.so. This is because ld.so
|
||
# contains some of libc_pic.a already, which will prevent the COMMONs
|
||
# from being allocated in libc.so, which introduces evil dependencies
|
||
# between libc.so and ld.so, which can make it impossible to upgrade.
|
||
ifeq ($(elf),yes)
|
||
$(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
|
||
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
|
||
$(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^
|
||
# Use our own special initializer and finalizer files for libc.so.
|
||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
|
||
$(common-objpfx)libc_pic.os \
|
||
$(elfobjdir)/sofini.os \
|
||
$(elfobjdir)/interp.os $(elfobjdir)/ld.so \
|
||
$(common-objpfx)shlib.lds
|
||
$(build-shlib)
|
||
ifeq ($(versioning),yes)
|
||
$(common-objpfx)libc.so: $(common-objpfx)libc.map
|
||
endif
|
||
common-generated += libc.so libc_pic.os
|
||
ifdef libc.so-version
|
||
$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
|
||
$(make-link)
|
||
common-generated += libc.so$(libc.so-version)
|
||
endif
|
||
endif
|
||
else
|
||
ifneq (,$(findstring aix,$(config-os)))
|
||
$(common-objpfx)libc.so: $(common-objpfx)libc_pic.a
|
||
@rm -f $@
|
||
(echo '#!'; \
|
||
dump -g $^ | sed '1,6d' | cut -f2 | sort | uniq) > $(^:a=exp)
|
||
sed '/__mulh/d;/__mull/d;/__divss/d;/__divus/d;/__quoss/d;/__quous/d' \
|
||
/lib/syscalls.exp > $(common-objpfx)syscalls.exp
|
||
$(LINK.o) -G -bM:SRE -bnoentry -bE:$(^:a=exp) \
|
||
-bE:$(common-objpfx)syscalls.exp \
|
||
-bI:$(common-objpfx)syscalls.exp \
|
||
-L$(common-objpfx) -o $@ $^
|
||
# AIX runtime ld wants libc.so to be libc.a(shr.o) hardwired
|
||
cp $@ $(common-objpfx)shr.o
|
||
$(AR) $(ARFLAGS) $(common-objpfx)libc.a $(common-objpfx)shr.o
|
||
endif
|
||
endif
|
||
|
||
# Figure out the source filenames in this directory.
|
||
|
||
override sources := $(addsuffix .c,\
|
||
$(filter-out $(elided-routines),\
|
||
$(routines) $(aux) \
|
||
$(sysdep_routines)))
|
||
sysdep_routines := $(sysdep_routines)
|
||
|
||
headers := $(headers) $(sysdep_headers)
|
||
|
||
# This is the list of all object files, gotten by
|
||
# replacing every ".c" in `sources' with a ".o".
|
||
# We also add bounded-pointer thunks, which are later
|
||
# elided for all suffixes except for `.ob'.
|
||
override objects := $(addprefix $(objpfx),$(sources:.c=.o) \
|
||
$(patsubst %,$(bppfx)%.o,\
|
||
$(filter $(routines) $(sysdep_routines),$(bp-thunks))))
|
||
|
||
|
||
# The makefile may define $(extra-libs) with `libfoo libbar'
|
||
# to build libfoo.a et al from the modules listed in $(libfoo-routines).
|
||
ifdef extra-libs
|
||
# extra-lib.mk is included once for each extra lib to define rules
|
||
# to build it, and to add its objects to the various variables.
|
||
# During its evaluation, $(lib) is set to the name of the library.
|
||
extra-libs-left := $(extra-libs)
|
||
include $(patsubst %,$(..)extra-lib.mk,$(extra-libs))
|
||
endif
|
||
|
||
|
||
# The makefile may define $(modules-names) to build additional modules.
|
||
# These are built with $(build-module), except any in $(modules-names-nobuild).
|
||
ifdef modules-names
|
||
# extra-lib.mk is included once for each extra lib to define rules
|
||
# to build it, and to add its objects to the various variables.
|
||
# During its evaluation, $(lib) is set to the name of the library.
|
||
extra-modules-left := $(modules-names)
|
||
include $(patsubst %,$(..)extra-modules.mk,$(modules-names))
|
||
|
||
extra-modules-build := $(filter-out $(modules-names-nobuild),$(modules-names))
|
||
$(extra-modules-build:%=$(objpfx)%.so): $(objpfx)%.so: \
|
||
$(objpfx)%.os $(common-objpfx)shlib.lds \
|
||
$(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
|
||
$(build-module)
|
||
endif
|
||
|
||
+depfiles := $(sources:.c=.d) \
|
||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
|
||
$(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
|
||
$(addsuffix .d,$(tests) $(xtests) $(test-srcs))
|
||
ifeq ($(build-programs),yes)
|
||
+depfiles += $(addsuffix .d,$(others) $(sysdep-others))
|
||
endif
|
||
+depfiles := $(addprefix $(objpfx),\
|
||
$(filter-out $(addsuffix .d,$(omit-deps)),\
|
||
$(+depfiles)))
|
||
all-dt-files := $(foreach o,$(object-suffixes-for-libc),$(+depfiles:.d=$o.dt))
|
||
+depfiles := $(patsubst %.dt,%.d,$(wildcard $(all-dt-files))) \
|
||
$(wildcard $(all-dt-files:.dt=.d))
|
||
|
||
# This is a funny rule in that it removes its input file.
|
||
%.d: %.dt
|
||
@sed $(sed-remove-objpfx) $< > $(@:.d=.T) && \
|
||
mv -f $(@:.d=.T) $@ && \
|
||
rm -f $<
|
||
|
||
# Avoid the .h.d files for any .sym files whose .h files don't exist yet.
|
||
# They will be generated when they're needed, and trying too early won't work.
|
||
+gen-as-const := $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
|
||
+depfiles += $(addsuffix .d,$(filter $(wildcard $(+gen-as-const)),\
|
||
$(+gen-as-const)))
|
||
|
||
ifdef +depfiles
|
||
ifneq ($(no_deps),t)
|
||
-include $(+depfiles)
|
||
endif
|
||
endif
|
||
|
||
# Maximize efficiency by minimizing the number of rules.
|
||
.SUFFIXES: # Clear the suffix list. We don't use suffix rules.
|
||
# Don't define any builtin rules.
|
||
MAKEFLAGS := $(MAKEFLAGS)r
|
||
|
||
# Generic rule for making directories.
|
||
%/:
|
||
# mkdir isn't smart enough to strip a trailing /.
|
||
mkdir $(@:%/=%)
|
||
|
||
# Make sure that object files are not removed
|
||
# when they are intermediates between sources and library members.
|
||
.PRECIOUS: $(addprefix $(objpfx)%,$(all-object-suffixes))
|
||
|
||
# Make sure that the parent library archive is never removed.
|
||
.PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
|
||
|
||
# Use the verbose option of ar and tar when not running silently.
|
||
ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
|
||
verbose := v
|
||
else # -s
|
||
verbose :=
|
||
endif # not -s
|
||
|
||
ARFLAGS := r$(verbose)
|
||
CREATE_ARFLAGS := cru$(verbose)
|
||
|
||
# This makes all the object files in the parent library archive.
|
||
|
||
.PHONY: lib lib-noranlib
|
||
lib: lib-noranlib $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
|
||
lib-noranlib: libobjs
|
||
|
||
# For object-suffix $o, the list of objects with that suffix.
|
||
# Makefiles can define `elide-routines.so = foo' to leave foo.so out.
|
||
o-objects = $(patsubst %.o,%$o,$(filter-out $(patsubst %,$(objpfx)%.o,\
|
||
$(elide-routines$o)),\
|
||
$(objects))) \
|
||
$(addprefix $(objpfx),$(o-objects$o))
|
||
|
||
others: $(addprefix $(objpfx),$(install-lib))
|
||
|
||
ifndef objects
|
||
|
||
# Create the stamp$o files to keep the parent makefile happy.
|
||
subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
|
||
$(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o):
|
||
$(make-target-directory)
|
||
rm -f $@; > $@
|
||
else
|
||
|
||
# Define explicit rules to update each $(objpfx)stamp.SUFFIX
|
||
# timestamp file; these rules (one explicit rule is generated for each
|
||
# object suffix) write a list of objects to update in the stamp file.
|
||
# The parent will then actually add them all to the archive in the
|
||
# archive rule, below.
|
||
define o-iterator-doit
|
||
$(objpfx)stamp$o: $(o-objects); $$(do-stamp)
|
||
endef
|
||
define do-stamp
|
||
$(make-target-directory)
|
||
echo '$(patsubst $(objpfx)%,$(addsuffix /,$(subdir))%,$^)' > $@T
|
||
mv -f $@T $@
|
||
endef
|
||
object-suffixes-left := $(object-suffixes-for-libc)
|
||
include $(o-iterator)
|
||
|
||
endif
|
||
|
||
# Now define explicit rules to build the library archives; these depend
|
||
# on the stamp files built above.
|
||
define o-iterator-doit
|
||
$(common-objpfx)$(patsubst %,$(libtype$o),c): \
|
||
$(subdirs-stamp-o) $(common-objpfx)stamp$o; $$(do-makelib)
|
||
endef
|
||
define do-makelib
|
||
cd $(common-objdir) && \
|
||
$(AR) $(CREATE_ARFLAGS) $(@F) `cat $(patsubst $(common-objpfx)%,%,$^)`
|
||
$(RANLIB) $@
|
||
endef
|
||
subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%)
|
||
subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
|
||
ifndef subdir
|
||
$(subdirs-stamps): subdir_lib;
|
||
endif
|
||
object-suffixes-left = $(object-suffixes-for-libc)
|
||
include $(o-iterator)
|
||
|
||
|
||
# This makes all the object files.
|
||
.PHONY: objects objs libobjs extra-objs
|
||
objects objs: libobjs extra-objs
|
||
libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
|
||
extra-objs: $(addprefix $(objpfx),$(extra-objs))
|
||
|
||
# Canned sequence for building an extra library archive.
|
||
define build-extra-lib
|
||
$(patsubst %/,cd % &&,$(objpfx)) \
|
||
$(AR) $(CREATE_ARFLAGS) $(@:$(objpfx)%=%) \
|
||
$(patsubst $(objpfx)%,%,$^)
|
||
$(RANLIB) $@
|
||
endef
|
||
|
||
# Installation.
|
||
|
||
.PHONY: force-install
|
||
force-install:
|
||
|
||
# $(install-lib) are installed from the object directory into $(libdir);
|
||
# files in $(install-lib) matching `lib%.a' are ranlib'd after installation
|
||
# unless they also appear in $(non-lib.a). $(install-data) are installed
|
||
# as they are into $(datadir). $(headers) are installed as they are in
|
||
# $(includedir). $(install-bin), $(install-bin-script) and $(install-sbin)
|
||
# are installed from the object directory into $(bindir), $(bindir) and
|
||
# $(sbindir), respectively. $(install-others) are absolute path names of
|
||
# files to install; rules to install them are defined elsewhere.
|
||
|
||
# The simple library name to install libc.a under.
|
||
# This could be defined by a sysdep Makefile.
|
||
ifndef libc-name
|
||
libc-name := c
|
||
endif
|
||
|
||
define do-install
|
||
$(make-target-directory)
|
||
$(INSTALL_DATA) $< $@
|
||
endef
|
||
|
||
# Make the target directory if it doesn't exist, using the `mkinstalldirs'
|
||
# script that does `mkdir -p' even if `mkdir' doesn't support that flag.
|
||
define make-target-directory
|
||
$(addprefix $(..)./scripts/mkinstalldirs ,\
|
||
$(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
|
||
endef
|
||
|
||
# Any directory (parent or subdir) should install libc.a; this way
|
||
# "make install" in a subdir is guaranteed to install everything it changes.
|
||
installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
|
||
$(inst_libdir)/$(patsubst %,$(libtype$o),\
|
||
$(libprefix)$(libc-name)))
|
||
install: $(installed-libcs)
|
||
$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
|
||
$(make-target-directory)
|
||
$(INSTALL_DATA) $(common-objpfx)lib$(*:$(libc-name)%=c%) $@
|
||
# Running ranlib after installing makes the __.SYMDEF time stamp up to
|
||
# date, which avoids messages from some linkers.
|
||
$(RANLIB) $@
|
||
|
||
define do-install-program
|
||
$(make-target-directory)
|
||
$(INSTALL_PROGRAM) $< $@.new
|
||
mv -f $@.new $@
|
||
endef
|
||
|
||
define do-install-script
|
||
$(make-target-directory)
|
||
$(INSTALL_SCRIPT) $< $@.new
|
||
mv -f $@.new $@
|
||
endef
|
||
|
||
install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
|
||
install-lib := $(filter-out %.so %_pic.a,$(install-lib))
|
||
|
||
ifeq (yes,$(build-shared))
|
||
# Find which .so's have versions.
|
||
versioned := $(strip $(foreach so,$(install-lib.so),\
|
||
$(patsubst %,$(so),$($(so)-version))))
|
||
|
||
install-lib.so-versioned := $(filter $(versioned), $(install-lib.so))
|
||
install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
|
||
|
||
# For versioned libraries, we install three files:
|
||
# $(inst_libdir)/libfoo.so -- for linking, symlink or ld script
|
||
# $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink
|
||
# $(inst_slibdir)/libfoo-X.Y.Z.so -- the real shared object file
|
||
V := $(firstword $($(subdir)-version) $(version))
|
||
install-lib-nosubdir: $(install-lib.so-unversioned:%=$(inst_slibdir)/%) \
|
||
$(foreach L,$(install-lib.so-versioned),\
|
||
$(inst_libdir)/$L \
|
||
$(inst_slibdir)/$(L:.so=)-$V.so \
|
||
$(inst_slibdir)/$L$($L-version))
|
||
|
||
# Install all the unversioned shared libraries.
|
||
$(install-lib.so-unversioned:%=$(inst_slibdir)/%): $(inst_slibdir)/%.so: \
|
||
$(objpfx)%.so $(+force)
|
||
$(do-install-program)
|
||
|
||
ifneq ($(findstring -s,$(LN_S)),)
|
||
define make-link
|
||
rm -f $@.new
|
||
$(SHELL) $(..)scripts/rellns-sh $< $@.new
|
||
mv -f $@.new $@
|
||
endef
|
||
else
|
||
# If we have no symbolic links don't bother with rellns-sh.
|
||
define make-link
|
||
rm -f $@.new
|
||
$(LN_S) $< $@.new
|
||
mv -f $@.new $@
|
||
endef
|
||
endif
|
||
|
||
ifeq (yes,$(build-shared))
|
||
ifeq (no,$(cross-compiling))
|
||
symbolic-link-prog := $(common-objpfx)elf/sln
|
||
symbolic-link-list := $(common-objpfx)elf/symlink.list
|
||
define make-shlib-link
|
||
echo $(<F) $@ >> $(symbolic-link-list)
|
||
endef
|
||
else # cross-compiling
|
||
# We need a definition that can be used by elf/Makefile's install rules.
|
||
symbolic-link-prog = $(LN_S)
|
||
endif
|
||
endif
|
||
ifndef make-shlib-link
|
||
define make-shlib-link
|
||
rm -f $@
|
||
$(LN_S) $(<F) $@
|
||
endef
|
||
endif
|
||
|
||
ifdef libc.so-version
|
||
# For a library specified to be version N, install three files:
|
||
# libc.so -> libc.so.N (e.g. libc.so.6)
|
||
# libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so)
|
||
|
||
$(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so \
|
||
$(+force)
|
||
$(make-shlib-link)
|
||
$(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so $(+force)
|
||
$(do-install-program)
|
||
install: $(inst_slibdir)/libc.so$(libc.so-version)
|
||
|
||
# This fragment of linker script gives the OUTPUT_FORMAT statement
|
||
# for the configuration we are building. We put this statement into
|
||
# the linker scripts we install for -lc et al so that they will not be
|
||
# used by a link for a different format on a multi-architecture system.
|
||
$(common-objpfx)format.lds: $(..)scripts/output-format.sed \
|
||
$(common-objpfx)config.make \
|
||
$(common-objpfx)config.h $(..)Makerules
|
||
$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
|
||
-x c /dev/null -o $@.so -Wl,--verbose -v 2>&1 \
|
||
| sed -n -f $< > $@.new
|
||
rm -f $@.so
|
||
mv -f $@.new $@
|
||
common-generated += format.lds
|
||
|
||
ifndef subdir
|
||
# What we install as libc.so for programs to link against is in fact a
|
||
# link script. It contains references for the various libraries we need.
|
||
# The libc.so object is not complete since some functions are only defined
|
||
# in libc_nonshared.a.
|
||
# We need to use absolute paths since otherwise local copies (if they exist)
|
||
# of the files are taken by the linker.
|
||
install: $(inst_libdir)/libc.so
|
||
$(inst_libdir)/libc.so: $(common-objpfx)format.lds \
|
||
$(common-objpfx)libc.so$(libc.so-version) \
|
||
$(inst_libdir)/$(patsubst %,$(libtype.oS),\
|
||
$(libprefix)$(libc-name)) \
|
||
$(+force)
|
||
(echo '/* GNU ld script';\
|
||
echo ' Use the shared library, but some functions are only in';\
|
||
echo ' the static library, so try that secondarily. */';\
|
||
cat $<; \
|
||
echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
|
||
'$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
|
||
' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
|
||
) > $@.new
|
||
mv -f $@.new $@
|
||
|
||
endif
|
||
|
||
else
|
||
install: $(inst_slibdir)/libc.so
|
||
$(inst_slibdir)/libc.so: $(common-objpfx)libc.so $(+force)
|
||
$(do-install-program)
|
||
endif
|
||
|
||
ifneq (,$(versioned))
|
||
# Produce three sets of rules as above for all the smaller versioned libraries.
|
||
|
||
define o-iterator-doit
|
||
$(inst_libdir)/$o: $(inst_slibdir)/$o$($o-version) $(+force); $$(make-link)
|
||
endef
|
||
object-suffixes-left := $(filter-out $(install-lib-ldscripts),$(versioned))
|
||
ifneq (,$(object-suffixes-left))
|
||
include $(o-iterator)
|
||
endif
|
||
|
||
# Make symlinks in the build directory, because the versioned names might
|
||
# be referenced by a DT_NEEDED in another library.
|
||
define o-iterator-doit
|
||
$(objpfx)$o$($o-version): $(objpfx)$o; $$(make-link)
|
||
endef
|
||
object-suffixes-left := $(versioned)
|
||
include $(o-iterator)
|
||
|
||
generated += $(foreach o,$(versioned),$o$($o-version))
|
||
|
||
ifeq (,$($(subdir)-version))
|
||
define o-iterator-doit
|
||
$(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so \
|
||
$(+force);
|
||
$$(make-shlib-link)
|
||
endef
|
||
object-suffixes-left := $(versioned)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o $(+force);
|
||
$$(do-install-program)
|
||
endef
|
||
object-suffixes-left := $(versioned)
|
||
include $(o-iterator)
|
||
else
|
||
define o-iterator-doit
|
||
$(inst_slibdir)/$o$($o-version): \
|
||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so $(+force);
|
||
$$(make-shlib-link)
|
||
endef
|
||
object-suffixes-left := $(versioned)
|
||
include $(o-iterator)
|
||
|
||
define o-iterator-doit
|
||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o $(+force);
|
||
$$(do-install-program)
|
||
endef
|
||
object-suffixes-left := $(versioned)
|
||
include $(o-iterator)
|
||
endif
|
||
endif
|
||
|
||
define do-install-so
|
||
$(do-install-program)
|
||
$(patsubst %,ln -s -f $(@F) $(@D)/$(patsubst %$*.so,%,$(<F))$(libprefix)$*.so,\
|
||
$(filter-out %.so,$@))
|
||
endef
|
||
|
||
so-versions := $(sort $(foreach so,$(install-lib.so),.so$($(so)-version)))
|
||
$(foreach v,$(so-versions),\
|
||
$(inst_slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so \
|
||
$(+force)
|
||
$(do-install-so)
|
||
$(foreach v,$(so-versions),\
|
||
$(inst_slibdir)/$(libprefix)%$v): $(common-objpfx)%.so $(+force)
|
||
$(do-install-so)
|
||
endif
|
||
|
||
ifdef install-bin
|
||
$(addprefix $(inst_bindir)/,$(install-bin)): \
|
||
$(inst_bindir)/%: $(objpfx)% $(+force)
|
||
$(do-install-program)
|
||
endif
|
||
ifdef install-bin-script
|
||
$(addprefix $(inst_bindir)/,$(install-bin-script)): \
|
||
$(inst_bindir)/%: $(objpfx)% $(+force)
|
||
$(do-install-script)
|
||
endif
|
||
ifdef install-rootsbin
|
||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin)): \
|
||
$(inst_rootsbindir)/%: $(objpfx)% $(+force)
|
||
$(do-install-program)
|
||
endif
|
||
ifdef install-sbin
|
||
$(addprefix $(inst_sbindir)/,$(install-sbin)): \
|
||
$(inst_sbindir)/%: $(objpfx)% $(+force)
|
||
$(do-install-program)
|
||
endif
|
||
ifdef install-lib
|
||
install-lib.a := $(filter lib%.a,$(install-lib))
|
||
install-lib-non.a := $(filter-out lib%.a,$(install-lib))
|
||
ifdef install-lib-non.a
|
||
$(addprefix $(inst_libdir)/$(libprefix),$(install-lib-non.a)): \
|
||
$(inst_libdir)/$(libprefix)%: $(objpfx)% $(+force)
|
||
$(do-install)
|
||
endif
|
||
ifdef install-lib.a
|
||
$(install-lib.a:lib%.a=$(inst_libdir)/lib$(libprefix)%.a): \
|
||
$(inst_libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a $(+force)
|
||
$(do-install)
|
||
$(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
|
||
endif
|
||
endif
|
||
ifdef install-data
|
||
$(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: % $(+force)
|
||
$(do-install)
|
||
endif
|
||
headers := $(strip $(headers))
|
||
ifdef headers
|
||
# This implicit rule installs headers from the source directory.
|
||
# It may be ignored in preference to rules from sysd-rules to find
|
||
# headers in the sysdeps tree.
|
||
$(inst_includedir)/%.h: $(objpfx)%.h $(+force)
|
||
$(do-install)
|
||
$(inst_includedir)/%.h: %.h $(+force)
|
||
$(do-install)
|
||
$(inst_includedir)/%.h: $(..)include/%.h $(+force)
|
||
$(do-install)
|
||
headers-nonh := $(filter-out %.h,$(headers))
|
||
ifdef headers-nonh
|
||
$(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
|
||
% $(+force)
|
||
$(do-install)
|
||
endif # headers-nonh
|
||
endif # headers
|
||
|
||
.PHONY: install-bin-nosubdir install-bin-script-nosubdir \
|
||
install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
|
||
install-data-nosubdir install-headers-nosubdir
|
||
install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
|
||
install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script))
|
||
install-rootsbin-nosubdir: \
|
||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin))
|
||
install-sbin-nosubdir: $(addprefix $(inst_sbindir)/,$(install-sbin))
|
||
install-lib-nosubdir: $(addprefix $(inst_libdir)/,\
|
||
$(patsubst lib%.a,lib$(libprefix)%.a,$(install-lib.a)) \
|
||
$(addprefix $(libprefix),$(install-lib-non.a)))
|
||
install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
|
||
install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
|
||
install-others-nosubdir: $(install-others)
|
||
|
||
# We need all the `-nosubdir' targets so that `install' in the parent
|
||
# doesn't depend on several things which each iterate over the subdirs.
|
||
# This rule makes `install-FOO' always use `install-FOO-nosubdir' as a
|
||
# subroutine. Then in the parent `install-FOO' also causes subdir makes.
|
||
install-%:: install-%-nosubdir ;
|
||
|
||
.PHONY: install install-no-libc.a-nosubdir
|
||
ifeq ($(build-programs),yes)
|
||
install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
|
||
install-bin-nosubdir install-bin-script-nosubdir \
|
||
install-lib-nosubdir install-others-nosubdir \
|
||
install-rootsbin-nosubdir install-sbin-nosubdir
|
||
else
|
||
install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
|
||
install-lib-nosubdir install-others-nosubdir
|
||
endif
|
||
install: install-no-libc.a-nosubdir
|
||
|
||
# Command to compile $< in $(objdir) using the native libraries.
|
||
define native-compile
|
||
$(make-target-directory)
|
||
$(patsubst %/,cd % &&,$(objpfx)) \
|
||
$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
|
||
$(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
|
||
endef
|
||
|
||
# Command to compile $< in $(common-objdir) using the native libraries.
|
||
# We must cd to $(objdir) anyway so that $(..)config.h is valid.
|
||
define common-objdir-compile
|
||
$(patsubst %/,cd % &&,$(objpfx)) \
|
||
$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
|
||
$(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(..)$(@F)
|
||
endef
|
||
|
||
# We always want to use configuration definitions.
|
||
# Note that this is only used for commands running in $(objpfx).
|
||
ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
|
||
|
||
# Support the GNU standard name for this target.
|
||
.PHONY: check
|
||
check: tests
|
||
# Special target to run tests which cannot be run unconditionally.
|
||
# Maintainers should use this target.
|
||
.PHONY: xcheck
|
||
xcheck: xtests
|
||
|
||
all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
|
||
ifneq (,$(all-nonlib))
|
||
cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
|
||
lib := nonlib
|
||
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
||
endif
|
||
|
||
# The include magic above causes those files to use this variable for flags.
|
||
CPPFLAGS-nonlib = -DNOT_IN_libc=1
|
||
|
||
|
||
ifeq ($(versioning),yes)
|
||
# Generate normalized lists of symbols, versions, and data sizes.
|
||
# This is handy for checking against existing library binaries.
|
||
|
||
%.symlist: $(..)scripts/abilist.awk %.dynsym
|
||
LC_ALL=C $(AWK) -f $^ > $@T
|
||
mv -f $@T $@
|
||
|
||
%.dynsym: %.so
|
||
$(OBJDUMP) --dynamic-syms $< > $@T
|
||
mv -f $@T $@
|
||
|
||
check-abi-%: $(..)scripts/extract-abilist.awk $(common-objpfx)config.make \
|
||
$(..)abilist/%.abilist $(objpfx)%.symlist
|
||
$(check-abi)
|
||
check-abi-%: $(..)scripts/extract-abilist.awk $(common-objpfx)config.make \
|
||
$(..)abilist/%.abilist $(common-objpfx)%.symlist
|
||
$(check-abi)
|
||
define check-abi
|
||
LC_ALL=C \
|
||
$(AWK) -f $< -v 'config=$(check-abi-config)' \
|
||
$(patsubst %,-v 'lastversion=%',$($*-abi-frozen)) \
|
||
$(filter %.abilist,$^) \
|
||
| { diff -p -U 0 - $(filter %.symlist,$^) $(check-abi-warn) ; }
|
||
endef
|
||
ifeq ($(enable-check-abi),warn)
|
||
check-abi-warn = || echo '*** WARNING: $*.so failed ABI check'
|
||
endif
|
||
|
||
ifeq ($(firstword $(sysd-sorted-done) f)$(firstword $(generating) f),tf)
|
||
-include $(common-objpfx)tls.make
|
||
config-tls := tls
|
||
ifeq ($(use-thread),yes)
|
||
config-tls := thread
|
||
endif
|
||
check-abi-config := \
|
||
$(config-machine)-$(config-vendor)-$(config-os)/$(config-tls)
|
||
endif
|
||
|
||
update-abi-%: $(..)scripts/merge-abilist.awk $(..)abilist/%.abilist \
|
||
$(objpfx)%.symlist
|
||
$(update-abi)
|
||
update-abi-%: $(..)scripts/merge-abilist.awk $(..)abilist/%.abilist \
|
||
$(common-objpfx)%.symlist
|
||
$(update-abi)
|
||
ifndef update-abi-config
|
||
define update-abi
|
||
@echo 'Run $(MAKE) $@ update-abi-config=REGEXP'; exit 2
|
||
endef
|
||
else
|
||
define update-abi
|
||
LC_ALL=C $(AWK) -v config='$(update-abi-config)' -f $^ \
|
||
> $(..)abilist/$*.abilist.new
|
||
@if cmp -s $(..)abilist/$*.abilist.new $(..)abilist/$*.abilist 2> /dev/null; \
|
||
then rm -f $(..)abilist/$*.abilist.new; \
|
||
echo '+++ $(..)abilist/$*.abilist is unchanged'; \
|
||
else mv -f $(..)abilist/$*.abilist.new $(..)abilist/$*.abilist; \
|
||
echo '*** Now check $*.abilist changes for correctness ***'; \
|
||
fi
|
||
endef
|
||
endif
|
||
|
||
.PHONY: update-abi check-abi
|
||
update-abi: $(patsubst %.so,update-abi-%,$(install-lib.so-versioned))
|
||
check-abi: $(patsubst %.so,check-abi-%,$(install-lib.so-versioned))
|
||
ifdef subdir
|
||
subdir_check-abi: check-abi
|
||
subdir_update-abi: update-abi
|
||
else
|
||
check-abi: subdir_check-abi
|
||
update-abi: subdir_update-abi
|
||
endif
|
||
|
||
ifeq ($(subdir),elf)
|
||
check-abi: check-abi-libc
|
||
update-abi: update-abi-libc
|
||
common-generated += libc.symlist
|
||
endif
|
||
|
||
ifeq ($(build-shared),yes)
|
||
ifneq ($(enable-check-abi),no)
|
||
ifdef subdir
|
||
tests: check-abi
|
||
endif
|
||
endif
|
||
endif
|
||
|
||
endif
|
||
|
||
# These will have been set by sysdeps/posix/Makefile.
|
||
L_tmpnam ?= 1
|
||
TMP_MAX ?= 0
|
||
L_ctermid ?= 1
|
||
L_cuserid ?= 1
|
||
|
||
stdio_lim = $(common-objpfx)bits/stdio_lim.h
|
||
|
||
$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
|
||
$(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
|
||
$(common-objpfx)config.make
|
||
$(make-target-directory)
|
||
{ echo '#include "$(..)posix/bits/posix1_lim.h"'; \
|
||
echo '#define _LIBC 1'; \
|
||
echo '#include "$(..)misc/sys/uio.h"'; } | \
|
||
$(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \
|
||
$(+includes) -xc - -o $(@:st=hT)
|
||
sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
|
||
$(@:st=dT) > $(@:st=dt)
|
||
mv -f $(@:st=dt) $(@:st=d)
|
||
fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \
|
||
filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \
|
||
iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`; \
|
||
fopen_max=$${fopen_max:-16}; \
|
||
filename_max=$${filename_max:-1024}; \
|
||
if [ -z "$$iov_max" ]; then \
|
||
define_iov_max="# undef IOV_MAX"; \
|
||
else \
|
||
define_iov_max="# define IOV_MAX $$iov_max"; \
|
||
fi; \
|
||
sed -e "s/@FOPEN_MAX@/$$fopen_max/" \
|
||
-e "s/@FILENAME_MAX@/$$filename_max/" \
|
||
-e "s/@L_tmpnam@/$(L_tmpnam)/" \
|
||
-e "s/@TMP_MAX@/$(TMP_MAX)/" \
|
||
-e "s/@L_ctermid@/$(L_ctermid)/" \
|
||
-e "s/@L_cuserid@/$(L_cuserid)/" \
|
||
-e "s/@define_IOV_MAX@/$$define_iov_max/" \
|
||
$< > $(@:st=h.new)
|
||
$(move-if-change) $(@:st=h.new) $(@:st=h)
|
||
# Remove these last so that they can be examined if something went wrong.
|
||
rm -f $(@:st=hT) $(@:st=dT) $(@:st=dt)
|
||
touch $@
|
||
# Get dependencies.
|
||
ifndef no_deps
|
||
-include $(stdio_lim:h=d)
|
||
endif
|
||
common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
|
||
|
||
FORCE:
|
||
|
||
.PHONY: echo-headers
|
||
echo-headers:
|
||
@echo $(headers)
|
||
|
||
%.bz2: %; bzip2 -9vk $<
|
||
%.gz: %; gzip -9vnc $< > $@.new && mv -f $@.new $@
|
||
|
||
# Common cleaning targets.
|
||
|
||
.PHONY: common-mostlyclean common-clean mostlyclean clean do-tests-clean
|
||
clean: common-clean
|
||
mostlyclean: common-mostlyclean
|
||
|
||
do-tests-clean:
|
||
-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) $(xtests) \
|
||
$(test-srcs)) \
|
||
$(addsuffix -bp.out,$(tests) $(xtests) \
|
||
$(test-srcs)))
|
||
|
||
# Remove the object files.
|
||
common-mostlyclean:
|
||
-rm -f $(addprefix $(objpfx),$(tests) $(xtests) $(test-srcs) \
|
||
$(others) $(sysdep-others) stubs \
|
||
$(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)))
|
||
-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
|
||
$(install-lib) $(install-lib.so) \
|
||
$(install-lib.so:%.so=%_pic.a))
|
||
-rm -f core
|
||
-rm -f $(objpfx)rtld-*.os
|
||
$(rmobjs)
|
||
define rmobjs
|
||
$(foreach o,$(object-suffixes-for-libc),
|
||
-rm -f $(objpfx)stamp$o $(o-objects))
|
||
endef
|
||
|
||
# Also remove the dependencies and generated source files.
|
||
common-clean: common-mostlyclean
|
||
-rm -f $(addprefix $(objpfx),$(generated))
|
||
-rm -f $(objpfx)*.d $(objpfx)*.dt
|
||
-rm -fr $(addprefix $(objpfx),$(generated-dirs))
|
||
-rm -f $(addprefix $(common-objpfx),$(common-generated))
|
||
|
||
# Produce a file `stubs' which contains `#define __stub_FUNCTION'
|
||
# for each function which is a stub. We grovel over all the .d files
|
||
# looking for references to <stub-tag.h>. Then we grovel over each
|
||
# referenced source file to see what stub function it defines.
|
||
|
||
ifdef objpfx
|
||
.PHONY: stubs # The parent Makefile calls this target.
|
||
stubs: $(objpfx)stubs
|
||
endif
|
||
objs-for-stubs := $(foreach o,$(object-suffixes-for-libc),$(o-objects)) \
|
||
$(addprefix $(objpfx),$(extra-objs))
|
||
$(objpfx)stubs: $(objs-for-stubs)
|
||
ifneq (,$(strip $(objs-for-stubs)))
|
||
(cd $(objpfx).; $(OBJDUMP) -h $(patsubst $(objpfx)%,%,$^)) | \
|
||
$(AWK) '/\.gnu\.glibc-stub\./ { \
|
||
sub(/\.gnu\.glibc-stub\./, "", $$2); \
|
||
stubs[$$2] = 1; } \
|
||
END { for (s in stubs) print "#define __stub_" s }' > $@T
|
||
mv -f $@T $@
|
||
else
|
||
> $@
|
||
endif
|
||
|
||
ifneq (,$(strip $(gpl2lgpl)))
|
||
ifneq (,$(wildcard $(..)gpl2lgpl.sed))
|
||
# Snarf from the master source and frob the copying notice.
|
||
$(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
|
||
sed -f $^ > $@-tmp
|
||
# So I don't edit them by mistake.
|
||
chmod a-w $@-tmp
|
||
mv -f $@-tmp $@
|
||
ifeq ($(with-cvs),yes)
|
||
test ! -d CVS || cvs $(CVSOPTS) commit -m'Updated from $^' $@
|
||
endif
|
||
endif
|
||
endif
|
||
|
||
# Local Variables:
|
||
# mode: makefile
|
||
# End:
|