This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arc profiling broken (Was: [4.1 patch] relocate profile data file)


Lu, Hongjiu wrote:

How does autoconf check target functions before compiler and/or C
library have been built?


For newlib targets and a unified tree build,, you could peek at the headers;
but in general, this is indeed not solvable in a clean autoconf manner.

I guess those targets should provide dummy
access and mkdir to support gcov. We can do


There are lots of these targets. This simply doesn't scale.

--- 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



For F_SETLKW, we have instead TARGET_HAS_F_SETLKW, which is provided by the targets that support it. Incidentally the F_SETLKW fcntl is POSIX, just as mkdir and access. So maybe we shoould replace all the defines / undefs of TARGET_HAS_F_SETLKW with defines / undefs of POSIX_IO, and then have in defaults.h : #ifdef TARGET_POSIX_IO #ifndef TARGET_HAS_access #define TARGET_HAS_access 1 #endif #ifndef TARGET_HAS_mkdir #define TARGET_HAS_mkdir 1 #endif #ifndef TARGET_HAS_F_SETLKW #define TARGET_HAS_F_SETLKW 1 #endif #else /* ! TARGET_POSIX_IO */ #ifndef TARGET_HAS_access #define TARGET_HAS_access 0 #endif #ifndef TARGET_HAS_mkdir #define TARGET_HAS_mkdir 0 #endif #ifndef TARGET_HAS_F_SETLKW #define TARGET_HAS_F_SETLKW 0 #endif And change gcov-io.h to use #if TARGET_HAS_F_SETLKW instead of #if defined(TARGET_HAS_F_SETLKW).

So if any fine-tuning needs to be done, it can be done with the individual macros, but I
suspect most or all targets will have either all of the relevant POSIX_IO, or none of it.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]