This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR/target 14291 -fprofile-arcs fails (unresolved symbol)
- From: Xavier Trochu <xtrochu at yahoo dot com>
- To: gcc-patches at gnu dot org
- Date: Wed, 25 Feb 2004 09:18:40 -0800 (PST)
- Subject: [PATCH] PR/target 14291 -fprofile-arcs fails (unresolved symbol)
This patch fix an unresolved symbol link error
occuring when compiling with -fprofile-arcs, the
reason being that ftruncate() does not exist in
msvcrt. It also fixes profiledbootstrap.
No testcase because dejagnu is not available for
mingw.
Bootstraped (and profiledbootstrap) on mingw32.
ChangeLog
2004-02-25 Xavier Trochu <xtrochu@yahoo.com>
* gcov-io.h (gcov_truncate) Fix for missing
ftruncate()
diff -u5 -rNdw gcc-cvs/gcc/gcc/gcov-io.h
src/gcc/gcov-io.h
--- gcc-cvs/gcc/gcc/gcov-io.h Fri Oct 10 17:04:45 2003
+++ src/gcc/gcov-io.h Tue Feb 24 09:25:16 2004
@@ -585,11 +585,17 @@
}
static inline void
gcov_truncate (void)
{
+#ifndef __MINGW32__
ftruncate (fileno (gcov_var.file), 0L);
+#else
+ /* ftruncate() is not available in msvcrt */
+ fpos_t pos = 0L;
+ fsetpos(gcov_var.file, &pos);
+#endif
}
#endif
#endif /* IN_LIBGCOV >= 0 */
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools