From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10681 invoked by alias); 19 Jan 2011 01:17:13 -0000 Received: (qmail 10673 invoked by uid 22791); 19 Jan 2011 01:17:12 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Jan 2011 01:17:06 +0000 Received: by wwe15 with SMTP id 15so283196wwe.8 for ; Tue, 18 Jan 2011 17:17:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.4.2 with SMTP id 2mr39066wei.51.1295399824040; Tue, 18 Jan 2011 17:17:04 -0800 (PST) Received: by 10.216.160.131 with HTTP; Tue, 18 Jan 2011 17:17:03 -0800 (PST) In-Reply-To: References: Date: Wed, 19 Jan 2011 01:17:00 -0000 Message-ID: Subject: Re: g++ cross distro compilation problem From: Jonathan Wakely To: Nick Stokes Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00271.txt.bz2 On 19 January 2011 01:14, Jonathan Wakely wrote: > On 19 January 2011 00:39, Nick Stokes =A0wrote: >> >> We stage the compilers, install, and test them on the compute nodes. >> Everything seems ok. But on the login node the C++ compiler spits out >> the following errors (for a simple hello world program): >> >> $ g++ hello.cpp >> In file included from >> /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../..= /include/c++/4.4.3/bits/localefwd.h:42, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from >> /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../..= /include/c++/4.4.3/ios:42, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from >> /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../..= /include/c++/4.4.3/ostream:40, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from >> /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../..= /include/c++/4.4.3/iostream:40, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from main.cpp:1: >> /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../..= /include/c++/4.4.3/x86_64-unknown-linux-gnu/bits/c++locale.h:52: >> error: 'uselocale' was not declared in this scope > > This indicates that the compiler was built on a system which had the > necessary pieces for the C++ runtime library to be configured with > --enable-clocale=3Dgnu (it will be used automatically if configure > detects it is supported) > > Apparently on the system where it's installed something is missing. > Probably something in glibc, as Ian suggests. I would try to build gcc on both systems, with the same options, and compare the $TARGET/libstdc++-v3/config.log files to see what choice of locale model is used. I expect you'll find a difference. You could force the basic model to be used with --enable-clocale=3Dgeneric, which should work the same everywhere. Ideally though you'd want to find out why the gnu model doesn't work, and fix that.