+2017-04-19 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/80435
+ * Makefile.in: Install gcov.h.
+ * gcov.h: New file.
+ * libgcov.h: Use the header and make __gcov_flush publicly
+ visible.
+
2017-04-18 Martin Liska <mliska@suse.cz>
PR gcov-profile/78783
libgcov-objects = $(libgcov-merge-objects) $(libgcov-profiler-objects) \
$(libgcov-interface-objects) $(libgcov-driver-objects)
-$(libgcov-merge-objects): %$(objext): $(srcdir)/libgcov-merge.c $(srcdir)/libgcov.h
+$(libgcov-merge-objects): %$(objext): $(srcdir)/libgcov-merge.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
$(gcc_compile) -DL$* -c $(srcdir)/libgcov-merge.c
-$(libgcov-profiler-objects): %$(objext): $(srcdir)/libgcov-profiler.c $(srcdir)/libgcov.h
+$(libgcov-profiler-objects): %$(objext): $(srcdir)/libgcov-profiler.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
$(gcc_compile) -DL$* -c $(srcdir)/libgcov-profiler.c
-$(libgcov-interface-objects): %$(objext): $(srcdir)/libgcov-interface.c $(srcdir)/libgcov.h
+$(libgcov-interface-objects): %$(objext): $(srcdir)/libgcov-interface.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
$(gcc_compile) -DL$* -c $(srcdir)/libgcov-interface.c
$(libgcov-driver-objects): %$(objext): $(srcdir)/libgcov-driver.c \
- $(srcdir)/libgcov-driver-system.c $(srcdir)/libgcov.h
+ $(srcdir)/libgcov-driver-system.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
$(gcc_compile) -DL$* -c $(srcdir)/libgcov-driver.c
all: install-unwind_h-forbuild
+install-gcov_h:
+ $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
+ $(INSTALL_DATA) $(srcdir)/gcov.h $(DESTDIR)$(libsubdir)/include
+
# Documentation targets (empty).
.PHONY: info html dvi pdf install-info install-html install-pdf
esac; \
done
-install: install-leaf install-unwind_h
+install: install-leaf install-unwind_h install-gcov_h
@: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
install-strip: install
.PHONY: install install-shared install-libunwind install-strip
.PHONY: install-unwind_h install-unwind_h-forbuild
+.PHONY: install-gcov_h
# Don't export variables to the environment, in order to not confuse
# configure.
--- /dev/null
+/* GCOV interface routines.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+
+ GCC 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 General Public License
+ for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_GCOV_H
+#define GCC_GCOV_H
+
+/* Set all counters to zero. */
+
+extern void __gcov_reset (void);
+
+/* Write profile information to a file. */
+
+extern void __gcov_dump (void);
+
+/* Write profile information to a file and reset counters to zero.
+ The function does operations under a mutex. */
+
+extern void __gcov_flush (void);
+
+#endif /* GCC_GCOV_H */
#include "coretypes.h"
#include "tm.h"
#include "libgcc_tm.h"
+#include "gcov.h"
#if __CHAR_BIT__ == 8
typedef unsigned gcov_unsigned_t __attribute__ ((mode (SI)));
/* GCOV exit function registered via a static destructor. */
extern void __gcov_exit (void) ATTRIBUTE_HIDDEN;
-/* Called before fork, to avoid double counting. */
-extern void __gcov_flush (void) ATTRIBUTE_HIDDEN;
-
/* Function to reset all counters to 0. Both externally visible (and
overridable) and internal version. */
-extern void __gcov_reset (void);
extern void __gcov_reset_int (void) ATTRIBUTE_HIDDEN;
/* User function to enable early write of profile information so far. */
-extern void __gcov_dump (void);
extern void __gcov_dump_int (void) ATTRIBUTE_HIDDEN;
/* The merge function that just sums the counters. */