mirror of git://gcc.gnu.org/git/gcc.git
re PR bootstrap/71400 (profiledbootstrap failed)
PR libgcc/71400 * libgcov-driver-system.c (__gcov_error_file): Disable if IN_GCOV_TOOL. (get_gcov_error_file): Check __gcov_error_file before trying to initialize it. (gcov_error): Always use get_gcov_error_file. Co-Authored-By: Nathan Sidwell <nathan@acm.org> From-SVN: r237135
This commit is contained in:
parent
93671519e2
commit
0a0ec53d12
|
|
@ -1,3 +1,12 @@
|
||||||
|
2016-06-05 Aaron Conole <aconole@redhat.com>
|
||||||
|
Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
PR libgcc/71400
|
||||||
|
* libgcov-driver-system.c (__gcov_error_file): Disable if IN_GCOV_TOOL.
|
||||||
|
(get_gcov_error_file): Check __gcov_error_file before trying to
|
||||||
|
initialize it.
|
||||||
|
(gcov_error): Always use get_gcov_error_file.
|
||||||
|
|
||||||
2016-06-02 Aaron Conole <aconole@redhat.com>
|
2016-06-02 Aaron Conole <aconole@redhat.com>
|
||||||
|
|
||||||
* libgcov-driver-system.c (__gcov_error_file): New.
|
* libgcov-driver-system.c (__gcov_error_file): New.
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,13 @@ a copy of the GCC Runtime Library Exception along with this program;
|
||||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#if !IN_GCOV_TOOL
|
||||||
/* Configured via the GCOV_ERROR_FILE environment variable;
|
/* Configured via the GCOV_ERROR_FILE environment variable;
|
||||||
it will either be stderr, or a file of the user's choosing.
|
it will either be stderr, or a file of the user's choosing.
|
||||||
Non-static to prevent multiple gcov-aware shared objects from
|
Non-static to prevent multiple gcov-aware shared objects from
|
||||||
instantiating their own copies. */
|
instantiating their own copies. */
|
||||||
FILE *__gcov_error_file = NULL;
|
FILE *__gcov_error_file = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* A utility function to populate the __gcov_error_file pointer.
|
/* A utility function to populate the __gcov_error_file pointer.
|
||||||
This should NOT be called outside of the gcov system driver code. */
|
This should NOT be called outside of the gcov system driver code. */
|
||||||
|
|
@ -35,19 +37,18 @@ FILE *__gcov_error_file = NULL;
|
||||||
static FILE *
|
static FILE *
|
||||||
get_gcov_error_file (void)
|
get_gcov_error_file (void)
|
||||||
{
|
{
|
||||||
#if !IN_GCOV_TOOL
|
#if IN_GCOV_TOOL
|
||||||
return stderr;
|
return stderr;
|
||||||
#else
|
#else
|
||||||
char *gcov_error_filename = getenv ("GCOV_ERROR_FILE");
|
if (!__gcov_error_file)
|
||||||
|
{
|
||||||
|
const char *gcov_error_filename = getenv ("GCOV_ERROR_FILE");
|
||||||
|
|
||||||
if (gcov_error_filename)
|
if (gcov_error_filename)
|
||||||
{
|
__gcov_error_file = fopen (gcov_error_filename, "a");
|
||||||
FILE *openfile = fopen (gcov_error_filename, "a");
|
|
||||||
if (openfile)
|
|
||||||
__gcov_error_file = openfile;
|
|
||||||
}
|
|
||||||
if (!__gcov_error_file)
|
if (!__gcov_error_file)
|
||||||
__gcov_error_file = stderr;
|
__gcov_error_file = stderr;
|
||||||
|
}
|
||||||
return __gcov_error_file;
|
return __gcov_error_file;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -60,11 +61,8 @@ gcov_error (const char *fmt, ...)
|
||||||
int ret;
|
int ret;
|
||||||
va_list argp;
|
va_list argp;
|
||||||
|
|
||||||
if (!__gcov_error_file)
|
|
||||||
__gcov_error_file = get_gcov_error_file ();
|
|
||||||
|
|
||||||
va_start (argp, fmt);
|
va_start (argp, fmt);
|
||||||
ret = vfprintf (__gcov_error_file, fmt, argp);
|
ret = vfprintf (get_gcov_error_file (), fmt, argp);
|
||||||
va_end (argp);
|
va_end (argp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue