public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol)
@ 2004-02-25 15:03 xtrochu at yahoo dot com
  2004-02-25 15:49 ` [Bug target/14291] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: xtrochu at yahoo dot com @ 2004-02-25 15:03 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
@ 2004-02-25 15:49 ` pinskia at gcc dot gnu dot org
  2004-03-16  5:22 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-25 15:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-25 15:49 -------
Confirmed, a regression from 3.3.3 which did not use ftruncate at all.
Could you send your patch (with a changelog) to gcc-patches@gcc.gnu.org ____after____ reading
<http://gcc.gnu.org/contribute.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-25 15:49:12
               date|                            |
            Summary|-fprofile-arcs fails        |[3.4/3.5 Regression] -
                   |(unresolved symbol)         |fprofile-arcs fails
                   |                            |(unresolved symbol)
   Target Milestone|---                         |3.4.0


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
  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
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-16  5:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-16 05:22 -------
*** Bug 14594 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stl at caltech dot edu


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
  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
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: stl at caltech dot edu @ 2004-03-16  5:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From stl at caltech dot edu  2004-03-16 05:26 -------
Didn't notice this bug, thanks Andrew.

This bug should be critical severity as it is a regression.

-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (2 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-16  5:30 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (3 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dannysmith at gcc dot gnu dot org @ 2004-03-16  9:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dannysmith at gcc dot gnu dot org  2004-03-16 09:41 -------
Umm, the mingw runtime has a function 

int  _chsize (int, long);

declared in io.h (could also include unistd.h, which basically maps to io.h)

It does exactly the same thing as ftruncate, at least as used
by gcov.

So a simple
#ifdef __MINGW32__ 
# define ftruncate _chsize
#endif

works.

I've been using that for awhile but had forgotten about it.

Danny

 

-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (4 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-21 18:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-03-21 18:33 -------
Danny, the obvious patch using _chsize is OK for 3.4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dannysmith at gcc dot gnu
                   |                            |dot org


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (5 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: stl at caltech dot edu @ 2004-03-21 18:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From stl at caltech dot edu  2004-03-21 18:40 -------
(Wanted to point out that PR14595 is still unresolved.)

-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (6 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dannysmith at gcc dot gnu dot org @ 2004-03-21 22:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dannysmith at gcc dot gnu dot org  2004-03-21 22:11 -------
Mark, just to be clear, are asking that the following patch be applied to
gcc-3.4.0 branch _only_?

Danny

Index: gcov-io.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcov-io.h,v
retrieving revision 1.47
diff -c -3 -p -r1.47 gcov-io.h
*** gcov-io.h	10 Oct 2003 17:04:45 -0000	1.47
--- gcov-io.h	21 Mar 2004 22:02:24 -0000
*************** gcov_rewrite (void)
*** 584,589 ****
--- 584,592 ----
    fseek (gcov_var.file, 0L, SEEK_SET);
  }
  
+ #ifdef __MINGW32__
+ #define ftruncate _chsize
+ #endif
  static inline void
  gcov_truncate (void)
  {

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (7 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mark at codesourcery dot com @ 2004-03-22  1:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2004-03-22 01:40 -------
Subject: Re:  [3.4/3.5 Regression] -fprofile-arcs fails
 (unresolved symbol)

dannysmith at gcc dot gnu dot org wrote:
> ------- Additional Comments From dannysmith at gcc dot gnu dot org  2004-03-21 22:11 -------
> Mark, just to be clear, are asking that the following patch be applied to
> gcc-3.4.0 branch _only_?

No, you may apply to both 3.4.0 and mainline.



-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (8 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-22  2:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-22 02:24 -------
Subject: Bug 14291

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	dannysmith@gcc.gnu.org	2004-03-22 02:24:34

Modified files:
	gcc            : ChangeLog gcov-io.h 

Log message:
	PR target/14291
	* gcov-io.h (gcov_truncate): Define ftruncate as _chsize for
	__MINGW32__.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.358&r2=2.2326.2.359
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcov-io.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.47&r2=1.47.10.1



-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (9 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-22  2:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-22 02:33 -------
Subject: Bug 14291

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dannysmith@gcc.gnu.org	2004-03-22 02:33:31

Modified files:
	gcc            : ChangeLog gcov-io.h 

Log message:
	PR target/14291
	* gcov-io.h (gcov_truncate): Define ftruncate as _chsize for
	__MINGW32__.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3248&r2=2.3249
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcov-io.h.diff?cvsroot=gcc&r1=1.47&r2=1.48



-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/14291] [3.4/3.5 Regression] -fprofile-arcs fails (unresolved symbol)
  2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
                   ` (10 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: dannysmith at gcc dot gnu dot org @ 2004-03-22  2:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dannysmith at gcc dot gnu dot org  2004-03-22 02:34 -------
Fixed on 3.40 and trunk.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-03-22  2:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 15:03 [Bug target/14291] New: -fprofile-arcs fails (unresolved symbol) xtrochu at yahoo dot com
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

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