Bug 3774 - i686-linux to arm-linux cross compiler fails to compile C++ files
Summary: i686-linux to arm-linux cross compiler fails to compile C++ files
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.0
: P2 critical
Target Milestone: ---
Assignee: Philip Blundell
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2001-07-23 05:36 UTC by j.a.k.mouw
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: arm-unknown-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description j.a.k.mouw 2001-07-23 05:36:00 UTC
GCC fails to generate C++ binaries with the cross compiler. This still
worked with the 20010409 prerelease snapshot which was compiled in exactly
the same way, and it also works with a native (i686-linux) g++-3.0 compiler.

Release:
3.0

Environment:
System: Linux arthur 2.4.7-pre8 #1 Fri Jul 20 10:02:46 CEST 2001 i686 unknown
Architecture: i686
Linux distribution: Debian GNU/Linux 2.2 (glibc 2.1.3)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: arm-unknown-linux-gnu
configured with: ../../src/gcc-3.0/configure --target=arm-linux --prefix=/usr/local/arm/3.0 --enable-languages=c,c++ --enable-threads --enable-shared
target libc: glibc-2.2.3 with glibc-linuxthreads-2.2.3
target binutils: binutils-2.11.2

How-To-Repeat:
Example code:

#include <iostream>

using namespace std;

int main(void)
{
	cout<< "Hello, world!"<< endl;
	return 0;
}

Compiling it:

erik@arthur:/tmp/test> arm-linux-g++ -o hello hello.cc
In file included from /usr/local/arm/3.0/include/g++-v3/cstdio:31,
                 from /usr/local/arm/3.0/include/g++-v3/arm-linux/bits/c++io.h:35,
                 from /usr/local/arm/3.0/include/g++-v3/bits/fpos.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iosfwd.h:41,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ios.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ostream.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/local/arm/3.0/include/g++-v3/iostream:31,
                 from hello.cc:1:
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:145: `vfscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:146: `vscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:148: `vsscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:154: `vfscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:155: `vscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdio.h:157: `vsscanf' not declared
In file included from /usr/local/arm/3.0/include/g++-v3/bits/fpos.h:40,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iosfwd.h:41,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ios.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ostream.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/local/arm/3.0/include/g++-v3/iostream:31,
                 from hello.cc:1:
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:130: `fwide' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:131: `fwprintf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:132: `fwscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:141: `swprintf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:142: `swscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:144: `vfwprintf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:145: `vfwscanf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:146: `vswprintf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:147: `vswscanf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:148: `vwprintf' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:149: `vwscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:164: `wcstof' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:174: `wprintf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:175: `wscanf' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:216: `wcstold' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:217: `wcstoll' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:218: `wcstoull' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:223: `wcstold' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:224: `wcstoll' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cwchar.h:225: `wcstoull' not 
   declared
In file included from /usr/local/arm/3.0/include/g++-v3/bits/stl_algobase.h:44,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_memory.h:20,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_string.h:43,
                 from /usr/local/arm/3.0/include/g++-v3/bits/localefwd.h:42,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ios.h:43,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ostream.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/local/arm/3.0/include/g++-v3/iostream:31,
                 from hello.cc:1:
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:127: `lldiv_t' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:128: `_Exit' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:137: syntax error before `
   (' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:138: syntax error before `
   .' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:138: syntax error before `
   .' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:141: syntax error before `
   (' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:142: syntax error before `
   .' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:142: syntax error before `
   .' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:145: `strtof' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:148: `strtold' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:149: parse error before `}
   ' token
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:153: `lldiv_t' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:154: `_Exit' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:157: `div' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:158: `lldiv' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:159: `atoll' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:160: `strtof' not declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:161: `strtoll' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:162: `strtoull' not 
   declared
/usr/local/arm/3.0/include/g++-v3/bits/std_cstdlib.h:163: `strtold' not 
   declared
In file included from /usr/local/arm/3.0/include/g++-v3/bits/locale_facets.h:45,
                 from /usr/local/arm/3.0/include/g++-v3/bits/basic_ios.h:36,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ios.h:46,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_ostream.h:39,
                 from /usr/local/arm/3.0/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/local/arm/3.0/include/g++-v3/iostream:31,
                 from hello.cc:1:
/usr/local/arm/3.0/include/g++-v3/bits/std_cwctype.h:69: `iswblank' not 
   declared
Comment 1 j.a.k.mouw 2001-07-23 05:36:00 UTC
Fix:
none known
Comment 2 zhenya 2001-11-02 13:47:31 UTC
From: Zhenya Yourlo <zhenya@silverbrook.com.au>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
	nobody@gcc.gnu.org, J.A.K.Mouw@ITS.TUDelft.NL
Cc:  
Subject: Re: c++/3774
Date: Fri, 2 Nov 2001 13:47:31 +1100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=3774&database=gcc
 
 This problem can be avoided by adding -D_ISOC9X_SOURCE to the flags passed to
 g++. If _ISOC9X_SOURCE is not defined, required portions of some header files
 are omitted.
 
 Zhenya.
Comment 3 Philip Blundell 2002-02-13 14:45:10 UTC
Responsible-Changed-From-To: unassigned->pb
Responsible-Changed-Why: .
Comment 4 Philip Blundell 2002-02-13 14:45:10 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Believed fixed in 3.0 branch now.
Comment 5 Benjamin Kosnik 2002-03-28 15:42:50 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: Fixed.