Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 10338
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: svein.seldal@solidas.com
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 10338 depends on: Show dependency tree
Show dependency graph
Bug 10338 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2003-04-07 12:56
Compilation of cross target fails on cygwin. Tested cross targets are tic4x and
avr. Tested gcc-3.3 versions are 20030407, 20030404, 20030315 and 20030302.
Please note that this bug does not occur when building a native compiler.

I configure gcc with:
configure --target=tic4x --disable-nls --enable-languages="c,c++"

configure detect that mempcpy exists, but fails when it tries to link
fixincl.exe. The cause of the error is located in gcc/fixinc/gnu-regex.c:5723. 

    #if defined HAVE_MEMPCPY || defined _LIBC
        *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
    #else
          memcpy (errbuf, msg, errbuf_size - 1);
          errbuf[errbuf_size - 1] = 0;
    #endif

configure tests and detects that mempcpy() exists (which it does). However in
the gcc/fixinc/gnu-regex.c file the function __mempcpy() is used (which does
_not_ exist in cygwin).

I need to comment that this bug is likely a bug or change in the cygwin libc,
because the gcc-3.3 20030315 and 20030302 *has* worked on cygwin earlier. I
dont know what changes I have made to my local cygwin installation that causes
the failures. -- In either cases either cygwin or gcc need to change some code
to get this up and working.

Release:
gcc version 3.3 release 20030407

Environment:
Windows XP/Cygwin 1.3.22. Native compiler gcc 3.2 20020907

How-To-Repeat:
configure --target=tic4x --disable-nls --enable-languages="c,c++"
make

------- Comment #1 From svein.seldal@solidas.com 2003-04-07 12:56 -------
Fix:
Comment out the #if section in gcc/fixinc/gnu-regex.c:5723, and use the code in the #else section instead.

------- Comment #2 From garen@wsu.edu 2003-04-10 18:12 -------
From: Garen <garen@wsu.edu>
To: gcc-gnats@gcc.gnu.org, Svein.Seldal@solidas.com,
	gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: target/10338: [3.3 regression?] [Cygwin -> tic4x | avr] cross target compilation error
Date: Thu, 10 Apr 2003 18:12:59 -0700

 I ran into the same problem here (PR10198):
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10198
 
 So I don't think it's a regression.  It seems to be present on all of the 
 3.2.x branches, so I'm guessing it's a Cygwin problem.  I worked around it 
 similarly by just not using __memcpy(), and instead memcpy() in the #else 
 branch.
 
 


------- Comment #3 From DJ Delorie 2003-04-10 22:08 -------
From: DJ Delorie <dj@redhat.com>
To: garen@wsu.edu
Cc: gcc-gnats@gcc.gnu.org, Svein.Seldal@solidas.com, gcc-bugs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Subject: Re: target/10338: [3.3 regression?] [Cygwin -> tic4x | avr] cross target compilation error
Date: Thu, 10 Apr 2003 22:08:55 -0400

 > So I don't think it's a regression.  It seems to be present on all of the 
 > 3.2.x branches, so I'm guessing it's a Cygwin problem.  I worked around it 
 > similarly by just not using __memcpy(), and instead memcpy() in the #else 
 > branch.
 
 It looks like it's always been a bug, but until now there hasn't been
 an OS that defined mempcpy (not memcpy) and not also __mempcpy, so we
 just didn't trip over it.


------- Comment #4 From svein.seldal@solidas.com 2003-04-11 03:57 -------
From: "Svein E. Seldal" <Svein.Seldal@solidas.com>
To: Garen <garen@wsu.edu>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
   gcc-prs@gcc.gnu.org
Subject: Re: target/10338: [3.3 regression?] [Cygwin -> tic4x | avr] cross
 target compilation error
Date: Fri, 11 Apr 2003 03:57:02 +0200

 Garen wrote:
 > I ran into the same problem here (PR10198):
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10198
 > 
 > So I don't think it's a regression.  It seems to be present on all of the 
 > 3.2.x branches, so I'm guessing it's a Cygwin problem.  I worked around it 
 > similarly by just not using __memcpy(), and instead memcpy() in the #else 
 > branch.
 > 
 
 Yes its the same bug...
 
 Well it depend on how you define regression. It seems like this is a 
 Cygwin regression and not a gcc one, because it *did* work on the 
 gcc-3.3-branch at 20030315, and now it dont (using that date's 
 snapshot). The same applies to the 3.2.x branches.
 
 But my point is, that if this is caused by a Cygwin thing, what approach 
 should we take to fix it? Fix Cygwin or fix gcc?
 
 
 Svein
 


------- Comment #5 From Kaveh Ghazi 2003-04-15 14:24 -------
From: ghazi@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/10338
Date: 15 Apr 2003 14:24:26 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	ghazi@gcc.gnu.org	2003-04-15 14:24:26
 
 Modified files:
 	gcc            : ChangeLog 
 	libiberty      : ChangeLog getopt.c regex.c 
 	gcc/fixinc     : gnu-regex.c 
 
 Log message:
 	gcc:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
 	
 	libiberty:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* getopt.c (exchange, _getopt_initialize): Use mempcpy not
 	__mempcpy.
 	* regex.c (regerror): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.17456&r2=1.17457
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&r1=1.431&r2=1.432
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/getopt.c.diff?cvsroot=gcc&r1=1.7&r2=1.8
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/regex.c.diff?cvsroot=gcc&r1=1.13&r2=1.14
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fixinc/gnu-regex.c.diff?cvsroot=gcc&r1=1.15&r2=1.16
 


------- Comment #6 From Kaveh Ghazi 2003-04-15 14:24 -------
From: ghazi@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/10338
Date: 15 Apr 2003 14:24:26 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	ghazi@gcc.gnu.org	2003-04-15 14:24:26
 
 Modified files:
 	gcc            : ChangeLog 
 	libiberty      : ChangeLog getopt.c regex.c 
 	gcc/fixinc     : gnu-regex.c 
 
 Log message:
 	gcc:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
 	
 	libiberty:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* getopt.c (exchange, _getopt_initialize): Use mempcpy not
 	__mempcpy.
 	* regex.c (regerror): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.17456&r2=1.17457
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&r1=1.431&r2=1.432
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/getopt.c.diff?cvsroot=gcc&r1=1.7&r2=1.8
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/regex.c.diff?cvsroot=gcc&r1=1.13&r2=1.14
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fixinc/gnu-regex.c.diff?cvsroot=gcc&r1=1.15&r2=1.16
 


------- Comment #7 From Kaveh Ghazi 2003-04-15 14:29 -------
From: ghazi@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/10338
Date: 15 Apr 2003 14:29:55 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	ghazi@gcc.gnu.org	2003-04-15 14:29:55
 
 Modified files:
 	gcc            : ChangeLog 
 	libiberty      : ChangeLog getopt.c regex.c 
 	gcc/fixinc     : gnu-regex.c 
 
 Log message:
 	gcc:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
 	
 	libiberty:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* getopt.c (exchange, _getopt_initialize): Use mempcpy not
 	__mempcpy.
 	* regex.c (regerror): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.442&r2=1.16114.2.443
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.398.2.19&r2=1.398.2.20
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/getopt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.7&r2=1.7.38.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/regex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.13&r2=1.13.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fixinc/gnu-regex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.15&r2=1.15.20.1
 


------- Comment #8 From Kaveh Ghazi 2003-04-15 14:29 -------
From: ghazi@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/10338
Date: 15 Apr 2003 14:29:55 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	ghazi@gcc.gnu.org	2003-04-15 14:29:55
 
 Modified files:
 	gcc            : ChangeLog 
 	libiberty      : ChangeLog getopt.c regex.c 
 	gcc/fixinc     : gnu-regex.c 
 
 Log message:
 	gcc:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
 	
 	libiberty:
 	PR target/10338
 	PR bootstrap/10198
 	PR bootstrap/10140
 	* getopt.c (exchange, _getopt_initialize): Use mempcpy not
 	__mempcpy.
 	* regex.c (regerror): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.442&r2=1.16114.2.443
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.398.2.19&r2=1.398.2.20
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/getopt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.7&r2=1.7.38.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/regex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.13&r2=1.13.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fixinc/gnu-regex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.15&r2=1.15.20.1
 

------- Comment #9 From Kaveh Ghazi 2003-04-25 15:15 -------
State-Changed-From-To: open->closed
State-Changed-Why: Fixed in 3.3, too late for 3.2.3.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug