diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-04 19:11:21 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-04 19:11:21 +0000 |
commit | c3c8d76890b592bf5acc1a9b7faeabd9b829dd71 (patch) | |
tree | 6358a23d0df9de73b6d5d6d3a75545ff35f05b47 /gnu/usr.bin/binutils/gprof | |
parent | 4ba440a6e788da3a64fa29b782c37150a3f5cc18 (diff) |
Merge the Cygnus 960904 sources
Diffstat (limited to 'gnu/usr.bin/binutils/gprof')
-rw-r--r-- | gnu/usr.bin/binutils/gprof/ChangeLog | 56 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/Makefile.in | 19 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/configure | 130 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/configure.in | 36 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/core.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/gmon.h | 4 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/gprof.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/hertz.c | 13 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gprof/source.c | 2 |
9 files changed, 230 insertions, 37 deletions
diff --git a/gnu/usr.bin/binutils/gprof/ChangeLog b/gnu/usr.bin/binutils/gprof/ChangeLog index 8551292f67c..3c1612936cd 100644 --- a/gnu/usr.bin/binutils/gprof/ChangeLog +++ b/gnu/usr.bin/binutils/gprof/ChangeLog @@ -1,3 +1,59 @@ +Fri Aug 30 12:16:11 1996 Ian Lance Taylor <ian@cygnus.com> + + * gmon.h: Replace #elif with #else/#endif. + +Thu Aug 29 17:04:10 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * configure.in (i[345]86-*-*): Recognize i686 for pentium pro. + * configure: Regenerate. + +Thu Aug 22 17:12:30 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Set and substitute HLDENV. + * configure: Rebuild. + * Makefile.in (HLDENV): New variable. + (gprof): Use $(HLDENV). + +Wed Aug 7 14:43:51 1996 Philippe De Muyter <phdm@info.ucl.ac.be> + + * core.c (read_function_mappings): Cast xmalloc return. + +Thu Jul 4 12:01:42 1996 Ian Lance Taylor <ian@cygnus.com> + + * gprof.c (VERSION): Define as "2.7.1". + + * Released binutils 2.7. + + * bb_exit_func.c: Rename from __bb_exit_func.c, so that it can be + stored on a System V file system. + +Thu Jun 27 11:36:22 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Call AC_ISC_POSIX. + * configure: Rebuild. + * Makefile.in (gprof): Pass $(CFLAGS) during link. + * hertz.c: Don't include <sys/time.h>; let sysdep.h handle that. + If HAVE_SETITIMER is not defined, try using sysconf. + +Mon Jun 24 18:27:28 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (exec_prefix, bindir, libdir, mandir, infodir, datadir, + INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values. + * configure.in (AC_PREREQ): autoconf 2.5 or higher. + (AC_PROG_INSTALL): added. + * configure: Rebuilt. + +Mon Jun 24 12:03:09 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: On alpha*-*-osf*, link against libbfd.a if not + using shared libraries. + * configure: Rebuild with autoconf 2.10. + +Tue Jun 18 17:35:58 1996 Ian Lance Taylor <ian@cygnus.com> + + * core.c (core_create_line_syms): Use xstrdup rather than strdup. + * source.c (source_file_lookup_path): Likewise. + Mon Apr 8 14:44:33 1996 Ian Lance Taylor <ian@cygnus.com> * configure.in: Permit --enable-shared to specify a list of diff --git a/gnu/usr.bin/binutils/gprof/Makefile.in b/gnu/usr.bin/binutils/gprof/Makefile.in index 1f5e0f02a57..a9bce7a3063 100644 --- a/gnu/usr.bin/binutils/gprof/Makefile.in +++ b/gnu/usr.bin/binutils/gprof/Makefile.in @@ -6,23 +6,23 @@ VPATH = @srcdir@ srcdir = @srcdir@ prefix = @prefix@ -exec_prefix = $(prefix) +exec_prefix = @exec_prefix@ program_transform_name = @program_transform_name@ -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib +bindir = @bindir@ +libdir = @libdir@ tooldir = $(libdir) -mandir = $(prefix)/man +mandir = @mandir@ man1dir = $(mandir)/man1 -infodir = $(prefix)/info -datadir = $(prefix)/lib +infodir = @infodir@ +datadir = @datadir@ SHELL = /bin/sh INSTALL = `cd $(srcdir); pwd`/../install.sh -c -INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 MAKEINFO = makeinfo @@ -54,6 +54,7 @@ GEN_FILES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c CFLAGS=-g -DDEBUG LDFLAGS= HLDFLAGS = @HLDFLAGS@ +HLDENV = @HLDENV@ .c.o: $(CC) -c $(CFLAGS) -I. -I$(srcdir) -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd -DMACHINE_H=\"$(MY_TARGET).h\" $(TCFLAGS) $(HCFLAGS) $< @@ -103,7 +104,7 @@ install: all $(INSTALL_XFORM1) $(srcdir)/gprof.1 $(man1dir)/gprof.1 gprof: $(OBJS) $(LIBDEPS) - $(CC) -o $(PROG) $(HLDFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) + $(HLDENV) $(CC) -o $(PROG) $(CFLAGS) $(HLDFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) mostlyclean: -rm -f *.o core gprof nohup.out \ diff --git a/gnu/usr.bin/binutils/gprof/configure b/gnu/usr.bin/binutils/gprof/configure index 282bbe2ebbd..9e786db7463 100644 --- a/gnu/usr.bin/binutils/gprof/configure +++ b/gnu/usr.bin/binutils/gprof/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.8 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Generated automatically using autoconf version 2.10 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -332,7 +332,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.8" + echo "configure generated by autoconf version 2.10" exit 0 ;; -with-* | --with-*) @@ -649,7 +649,6 @@ else test "${CFLAGS+set}" = set || CFLAGS="-g" fi - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -669,6 +668,87 @@ ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + + # Do some error checking and defaulting for the host and target type. # The inputs are: @@ -777,7 +857,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," case "${target}" in alpha-*-*) MY_TARGET=alpha ;; -i[345]86-*-*) MY_TARGET=i386 ;; +i[3456]86-*-*) MY_TARGET=i386 ;; sparc-*-*) MY_TARGET=sparc ;; tahoe-*-*) MY_TARGET=tahoe ;; vax-*-*) MY_TARGET=vax ;; @@ -790,18 +870,31 @@ esac BFDLIB='-L../bfd -lbfd' # We need to handle some special cases if BFD was built shared. -if test "${shared}" = "true"; then - case "${host}" in +case "${host}" in *-*-sunos*) # On SunOS, we must link against the name we are going to install, # not -lbfd, since SunOS does not support SONAME. - BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`' + if test "${shared}" = "true"; then + BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`' + fi ;; - esac -fi +alpha*-*-osf*) + # On Alpha OSF/1, the native linker searches all the -L + # directories for any LIB.so files, and only then searches for any + # LIB.a files. That means that if there is an installed + # libbfd.so, but this build is not done with --enable-shared, the + # link will wind up being against the install libbfd.so rather + # than the newly built libbfd. To avoid this, we must explicitly + # link against libbfd.a when --enable-shared is not used. + if test "${shared}" != "true"; then + BFDLIB='../bfd/libbfd.a' + fi + ;; +esac HLDFLAGS= +HLDENV= # If we have shared libraries, try to set rpath reasonably. if test "${shared}" = "true"; then case "${host}" in @@ -816,9 +909,12 @@ if test "${shared}" = "true"; then *-*-linux*) HLDFLAGS='-Wl,-rpath,$(libdir)' ;; - *-*-sysv4* | *-*-solaris*) + *-*-solaris*) HLDFLAGS='-R $(libdir)' ;; + *-*-sysv4*) + HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;' + ;; esac fi @@ -845,6 +941,7 @@ case "${host}" in esac + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -933,7 +1030,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.8" + echo "$CONFIG_STATUS generated by autoconf version 2.10" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -942,6 +1039,7 @@ do done ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF @@ -974,6 +1072,8 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g @@ -992,6 +1092,7 @@ s%@build_os@%$build_os%g s%@MY_TARGET@%$MY_TARGET%g s%@BFDLIB@%$BFDLIB%g s%@HLDFLAGS@%$HLDFLAGS%g +s%@HLDENV@%$HLDENV%g CEOF EOF @@ -1032,6 +1133,10 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1044,6 +1149,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done rm -f conftest.subs diff --git a/gnu/usr.bin/binutils/gprof/configure.in b/gnu/usr.bin/binutils/gprof/configure.in index 4b0a616b59a..074ace72661 100644 --- a/gnu/usr.bin/binutils/gprof/configure.in +++ b/gnu/usr.bin/binutils/gprof/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.3)dnl +AC_PREREQ(2.5)dnl AC_INIT(gprof.c) AC_ARG_ENABLE(shared, @@ -12,6 +12,9 @@ AC_ARG_ENABLE(shared, esac])dnl AC_PROG_CC +AC_PROG_INSTALL + +AC_ISC_POSIX AC_CANONICAL_SYSTEM AC_ARG_PROGRAM @@ -19,7 +22,7 @@ AC_ARG_PROGRAM case "${target}" in alpha-*-*) MY_TARGET=alpha ;; changequote(,)dnl -i[345]86-*-*) MY_TARGET=i386 ;; +i[3456]86-*-*) MY_TARGET=i386 ;; changequote([,])dnl sparc-*-*) MY_TARGET=sparc ;; tahoe-*-*) MY_TARGET=tahoe ;; @@ -33,18 +36,31 @@ AC_SUBST(MY_TARGET) BFDLIB='-L../bfd -lbfd' # We need to handle some special cases if BFD was built shared. -if test "${shared}" = "true"; then - case "${host}" in +case "${host}" in *-*-sunos*) # On SunOS, we must link against the name we are going to install, # not -lbfd, since SunOS does not support SONAME. - BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`' + if test "${shared}" = "true"; then + BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`' + fi ;; - esac -fi +alpha*-*-osf*) + # On Alpha OSF/1, the native linker searches all the -L + # directories for any LIB.so files, and only then searches for any + # LIB.a files. That means that if there is an installed + # libbfd.so, but this build is not done with --enable-shared, the + # link will wind up being against the install libbfd.so rather + # than the newly built libbfd. To avoid this, we must explicitly + # link against libbfd.a when --enable-shared is not used. + if test "${shared}" != "true"; then + BFDLIB='../bfd/libbfd.a' + fi + ;; +esac AC_SUBST(BFDLIB) HLDFLAGS= +HLDENV= # If we have shared libraries, try to set rpath reasonably. if test "${shared}" = "true"; then case "${host}" in @@ -59,9 +75,12 @@ if test "${shared}" = "true"; then *-*-linux*) HLDFLAGS='-Wl,-rpath,$(libdir)' ;; - *-*-sysv4* | *-*-solaris*) + *-*-solaris*) HLDFLAGS='-R $(libdir)' ;; + *-*-sysv4*) + HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;' + ;; esac fi @@ -87,5 +106,6 @@ case "${host}" in ;; esac AC_SUBST(HLDFLAGS) +AC_SUBST(HLDENV) AC_OUTPUT(Makefile) diff --git a/gnu/usr.bin/binutils/gprof/core.c b/gnu/usr.bin/binutils/gprof/core.c index 3117599eba0..3103dc281fc 100644 --- a/gnu/usr.bin/binutils/gprof/core.c +++ b/gnu/usr.bin/binutils/gprof/core.c @@ -66,7 +66,8 @@ DEFUN (read_function_mappings, (filename), const char *filename) } /* Now we know how big we need to make our table. */ - symbol_map = xmalloc (count * sizeof (struct function_map)); + symbol_map = ((struct function_map *) + xmalloc (count * sizeof (struct function_map))); /* Rewind the input file so we can read it again. */ rewind (file); @@ -589,7 +590,7 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd) } /* make name pointer a malloc'ed string: */ - ltab.limit->name = strdup (ltab.limit->name); + ltab.limit->name = xstrdup (ltab.limit->name); ltab.limit->file = source_file_lookup_path (filename); ltab.limit->addr = core_text_sect->vma + offset; diff --git a/gnu/usr.bin/binutils/gprof/gmon.h b/gnu/usr.bin/binutils/gprof/gmon.h index 488f11ef8af..4d45704a3de 100644 --- a/gnu/usr.bin/binutils/gprof/gmon.h +++ b/gnu/usr.bin/binutils/gprof/gmon.h @@ -47,11 +47,13 @@ struct raw_phdr * a size that is a multiple of 8. */ char pad[4]; -#elif defined (BSD44_FORMAT) +#else +#ifdef BSD44_FORMAT char version[4]; /* version number */ char profrate[4]; /* profiling clock rate */ char spare[3*4]; /* reserved */ #endif +#endif }; /* diff --git a/gnu/usr.bin/binutils/gprof/gprof.c b/gnu/usr.bin/binutils/gprof/gprof.c index e99f2d25caf..7128aa9b340 100644 --- a/gnu/usr.bin/binutils/gprof/gprof.c +++ b/gnu/usr.bin/binutils/gprof/gprof.c @@ -30,7 +30,7 @@ #include "source.h" #include "sym_ids.h" -#define VERSION "2.6" +#define VERSION "2.7.1" const char *whoami; const char *function_mapping_file; diff --git a/gnu/usr.bin/binutils/gprof/hertz.c b/gnu/usr.bin/binutils/gprof/hertz.c index 9dbc89ffc61..75314acc0c3 100644 --- a/gnu/usr.bin/binutils/gprof/hertz.c +++ b/gnu/usr.bin/binutils/gprof/hertz.c @@ -16,7 +16,6 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#include <sys/time.h> #include "hertz.h" @@ -29,7 +28,8 @@ hertz () { #ifdef HERTZ return HERTZ; -#else +#else /* ! defined (HERTZ) */ +#ifdef HAVE_SETITIMER struct itimerval tim; tim.it_interval.tv_sec = 0; @@ -43,5 +43,12 @@ hertz () return HZ_WRONG; } return 1000000 / tim.it_interval.tv_usec; -#endif +#else /* ! defined (HAVE_SETITIMER) */ +#if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK) + return sysconf (_SC_CLK_TCK); +#else /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */ + return HZ_WRONG; +#endif /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */ +#endif /* ! defined (HAVE_SETITIMER) */ +#endif /* ! defined (HERTZ) */ } diff --git a/gnu/usr.bin/binutils/gprof/source.c b/gnu/usr.bin/binutils/gprof/source.c index b0c6ecdb479..4421e3f757e 100644 --- a/gnu/usr.bin/binutils/gprof/source.c +++ b/gnu/usr.bin/binutils/gprof/source.c @@ -36,7 +36,7 @@ DEFUN (source_file_lookup_path, (path), const char *path) sf = (Source_File *) xmalloc (sizeof (*sf)); memset (sf, 0, sizeof (*sf)); - sf->name = strdup (path); + sf->name = xstrdup (path); sf->next = first_src_file; first_src_file = sf; } |