This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: arc profiling broken (Was: [4.1 patch] relocate profile data file)
- From: "Lu, Hongjiu" <hongjiu dot lu at intel dot com>
- To: "Joern RENNECKE" <joern dot rennecke at st dot com>, "Zagorodnev, Grigory" <grigory dot zagorodnev at intel dot com>
- Cc: "Nathan Sidwell" <nathan at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Jul 2005 10:35:24 -0700
- Subject: RE: arc profiling broken (Was: [4.1 patch] relocate profile data file)
How does autoconf check target functions before compiler and/or C
library have been built? I guess those targets should provide dummy
access and mkdir to support gcov. We can do
--- libgcov.c 2005-06-25 17:02:49.000000000 -0700
+++ libgcov.c 2005-07-04 10:33:17.642298513 -0700
@@ -91,6 +91,15 @@ static gcov_unsigned_t gcov_crc32;
/* Size of the longest file name. */
static size_t gcov_max_filename = 0;
+#ifndef HAVE_access
+#define HAVE_access 1
+#endif
+
+#ifndef HAVE_mkdir
+#define HAVE_mkdir 1
+#endif
+
+if HAVE_access && HAVE_mkdir
/* Make sure path component of the given FILENAME exists, create
missing directories. FILENAME must be writable.
Returns zero on success, or -1 if an error occurred. */
@@ -122,6 +131,9 @@ create_file_directory (char *filename)
};
return 0;
}
+#else
+#define create_file_directory(filename) 0
+#endif
/* Check if VERSION of the info block PTR matches libgcov one.
Return 1 on success, or zero in case of versions mismatch.
And arc.h can define
#define HAVE_access 0
#define HAVE_mkdir 0
H.J. Lu
Intel Corporation
>-----Original Message-----
>From: Joern RENNECKE [mailto:joern.rennecke@st.com]
>Sent: Monday, July 04, 2005 5:35 AM
>To: Zagorodnev, Grigory; Lu, Hongjiu
>Cc: Nathan Sidwell; gcc-patches@gcc.gnu.org
>Subject: arc profiling broken (Was: [4.1 patch] relocate profile data
>file)
>
>2005-05-10 Grigory Zagorodnev <grigory.zagorodnev@intel.com>
> H.J. Lu <hongjiu.lu@intel.com>
>
> * libgcov.c (create_file_directory): New function. Create
> directory for the given file name.
>
>This patch breaks arc profiling on sh-elf, and most likely on all other
>newlib
>targets as well. Please guard calls to non-portable functions with
>autoconf macros,
>or find a way to implement your feature without them.
>
>Executing on host:
>/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/gcc/xgcc
>-B/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/gcc/
>/mnt/scratch/nightly/2005-07-01-22258/srcw/gcc/testsuite/gcc.dg/tree-
>prof/inliner-1.c
>-O2 -fdump-tree-optimized -fdump-tree-all -ftree-based-profiling
>-fprofile-generate -DSTACK_SIZE=16384 -fno-show-column -isystem
>/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/sh-elf/./newlib/targ-
>include
>-isystem /mnt/scratch/nightly/2005-07-01-22258/srcw/newlib/libc/include
>-L/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/ld
>-B/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/sh-elf/./newlib/
>-L/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/sh-elf/./newlib -lm
>-Wl,--defsym,_stack=0xff000 -o
>/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/gcc/testsuite/inliner-
>1.x01
>(timeout = 300)
>/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/gcc/libgcov.a(_gcov.o):
>In function `create_file_directory':^M
>../../srcw/gcc/libgcov.c:104: undefined reference to `_access'^M
>../../srcw/gcc/libgcov.c:104: undefined reference to `_mkdir'^M
>collect2: ld returned 1 exit status^M
>compiler exited with status 1
>output is:
>/mnt/scratch/nightly/2005-07-01-22258/sh-elf-2/gcc/libgcov.a(_gcov.o):
>In function `create_file_directory':^M
>../../srcw/gcc/libgcov.c:104: undefined reference to `_access'^M
>../../srcw/gcc/libgcov.c:104: undefined reference to `_mkdir'^M
>collect2: ld returned 1 exit status^M
>
>FAIL: gcc.dg/tree-prof/inliner-1.c compilation, -ftree-based-profiling
>-fprofile-generate
>UNRESOLVED: gcc.dg/tree-prof/inliner-1.c execution,
>-ftree-based-profiling -fprofile-generate
>UNRESOLVED: gcc.dg/tree-prof/inliner-1.c compilation,
>-ftree-based-profiling -fprofile-use
>UNRESOLVED: gcc.dg/tree-prof/inliner-1.c execution,
>-ftree-based-profiling -fprofile-use
>