public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xtrochu at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol)
Date: Wed, 25 Feb 2004 15:03:00 -0000	[thread overview]
Message-ID: <20040225150311.14291.xtrochu@yahoo.com> (raw)

C:\devel\gcc\testsuite>gcc -fprofile-arcs -o test test.c
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccE7aaaa.o(.text+0x38):test.c: undefined 
reference to `ftruncate'

The following patch correct the issue :

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 */
 
But maybe adding ftruncate to libiberty is preferable.

-- 
           Summary: -fprofile-arcs fails (unresolved symbol)
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xtrochu at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14291


             reply	other threads:[~2004-02-25 15:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25 15:03 xtrochu at yahoo dot com [this message]
2004-02-25 15:49 ` [Bug target/14291] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-03-16  5:22 ` pinskia at gcc dot gnu dot org
2004-03-16  5:26 ` stl at caltech dot edu
2004-03-16  5:30 ` pinskia at gcc dot gnu dot org
2004-03-16  9:41 ` dannysmith at gcc dot gnu dot org
2004-03-21 18:33 ` mmitchel at gcc dot gnu dot org
2004-03-21 18:40 ` stl at caltech dot edu
2004-03-21 22:12 ` dannysmith at gcc dot gnu dot org
2004-03-22  1:41 ` mark at codesourcery dot com
2004-03-22  2:24 ` cvs-commit at gcc dot gnu dot org
2004-03-22  2:33 ` cvs-commit at gcc dot gnu dot org
2004-03-22  2:34 ` dannysmith at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040225150311.14291.xtrochu@yahoo.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).