Bug 11096 - i686-linux to sh-linux cross compiler fails to compile C++ files
Summary: i686-linux to sh-linux cross compiler fails to compile C++ files
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P2 critical
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-05 04:41 UTC by dank
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: sh-linux
Target: sh-linux
Build: i686-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Patch that seems to resolve the problem (272 bytes, patch)
2003-06-05 04:43 UTC, dank
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dank 2003-06-05 04:41:19 UTC
This is the same as bug 3774, but for SH instead of arm.
Compiling a 'hello, world' c++ program spews errors of the sort

.../g++-v3/bits/std_cstdio.h:145: `vfscanf' not declared

unless -D_ISOC9X_SOURCE is passed to the compiler.
The fix for arm appears to have been
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/linux-elf.h.diff?r1=1.31&r2=1.32
which predefines _GNU_SOURCE, with the comment
/* The GNU C++ standard library currently requires _GNU_SOURCE *

Looks like other architectures might need this, too.  I'm attaching a patch
for sh4.  No idea if it's actually right yet, but it seems logical.
Comment 1 dank 2003-06-05 04:43:18 UTC
Created attachment 4172 [details]
Patch that seems to resolve the problem
Comment 2 dank 2003-06-05 14:27:42 UTC
Kaz says:

> OK for 3.3 as an sh-linux specific regression fix. Thanks.
> Ugh. Again, 3.4 includes this already.

See http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00424.html
Comment 3 Dara Hazeghi 2003-06-08 01:51:05 UTC
Patch committed: http://gcc.gnu.org/ml/gcc-cvs/2003-06/msg00242.html. Thanks for fixing this 
Dan.