Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2020 16:47:25 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r356447 - stable/12/usr.bin/gprof
Message-ID:  <202001071647.007GlPHa080518@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jan  7 16:47:25 2020
New Revision: 356447
URL: https://svnweb.freebsd.org/changeset/base/356447

Log:
  MFC r351329:
  
    gprof: disable building of a.out components
  
    On arm64, riscv, and s390x disable building of aout components.
    This allows gprof to build on these architectures which never supported
    the legacy a.out binary format.
  
  Note: there might be more work needed for arm64 or risv and the MACHINE_
  checks are based on what was use elsewhere in the tree at that time.  Other
  will fix these parts with follow-up work.

Modified:
  stable/12/usr.bin/gprof/Makefile
  stable/12/usr.bin/gprof/gprof.c
  stable/12/usr.bin/gprof/gprof.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/gprof/Makefile
==============================================================================
--- stable/12/usr.bin/gprof/Makefile	Tue Jan  7 16:44:19 2020	(r356446)
+++ stable/12/usr.bin/gprof/Makefile	Tue Jan  7 16:47:25 2020	(r356447)
@@ -2,8 +2,14 @@
 #	$FreeBSD$
 
 PROG=	gprof
-SRCS=	gprof.c aout.c arcs.c dfn.c elf.c lookup.c hertz.c \
+SRCS=	gprof.c arcs.c dfn.c elf.c lookup.c hertz.c \
 	printgprof.c printlist.c kernel.c
+
+.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_ARCH} != "riscv" && \
+    ${MACHINE_ARCH} != "s390x"
+SRCS+=	aout.c
+CFLAGS+=	-DWITH_AOUT
+.endif
 FILES=	gprof.flat gprof.callg
 FILESDIR=	${SHAREDIR}/misc
 

Modified: stable/12/usr.bin/gprof/gprof.c
==============================================================================
--- stable/12/usr.bin/gprof/gprof.c	Tue Jan  7 16:44:19 2020	(r356446)
+++ stable/12/usr.bin/gprof/gprof.c	Tue Jan  7 16:47:25 2020	(r356447)
@@ -160,8 +160,11 @@ main(int argc, char **argv)
 	 *	get information from the executable file.
 	 */
     if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) ||
-      (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 &&
-      aout_getnfile(a_outname, &defaultEs) == -1))
+      (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1
+#ifdef WITH_AOUT
+      && aout_getnfile(a_outname, &defaultEs) == -1
+#endif
+      ))
 	errx(1, "%s: bad format", a_outname);
 	/*
 	 *	sort symbol table.

Modified: stable/12/usr.bin/gprof/gprof.h
==============================================================================
--- stable/12/usr.bin/gprof/gprof.h	Tue Jan  7 16:44:19 2020	(r356446)
+++ stable/12/usr.bin/gprof/gprof.h	Tue Jan  7 16:47:25 2020	(r356447)
@@ -256,7 +256,9 @@ void		addarc(nltype *, nltype *, long);
 bool		addcycle(arctype **, arctype **);
 void		addlist(struct stringlist *, char *);
 void		alignentries(void);
+#ifdef WITH_AOUT
 int		aout_getnfile(const char *, char ***);
+#endif
 int		arccmp(arctype *, arctype *);
 arctype		*arclookup(nltype *, nltype *);
 void		asgnsamples(void);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001071647.007GlPHa080518>