This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ cross distro compilation problem
On Wed, Jan 19, 2011 at 7:47 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 19 January 2011 23:27, Nick Stokes wrote:
>>
>> Ian, ?you are right on. The versions are different:
>> compute node (where gcc is built): ?/lib64/libc-2.5.so
>> login node (where gcc is used): ?/lib64/libc-2.11.2.so
>>
>> Jonathan, I looked at the config.logs (attached). Both seem to use gnu.
>
> Yes, both your distros have a new enough glibc, so the problem might be simpler:
> does it make any difference if you define _GNU_SOURCE when compiling?
>
Assuming you are referring to compiling a code with g++ (and not
compiling gcc itself), then no it doesn't make a difference. (in fact,
g++ -v shows that _GNU_SOURCE is already defined).
Could it be some other silly mistake on my part, e.g forgetting to set
an environment variable or something? Indeed there is the distro's g++
compiler installed on the login node, and most of these headers --
that are potentially incompatible with the gcc versions I am trying to
install under /opt -- are under common places /usr/include etc.
>
> The GNU model, which requires glibc 2.3 or later, supports a
> per-thread locale (via the uselocale function) so that the locale can
> be changed temporarily by the C++ runtime library without affecting
> the global process-wide locale. ?I believe this avoids possible race
> conditions in multithreaded programs which make use of locales.
>
I see. Thanks for this info, it seems I should not be using generic
locale then.
- Nick