public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nick Stokes <randomaccessiterator@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: g++ cross distro compilation problem
Date: Fri, 21 Jan 2011 02:03:00 -0000	[thread overview]
Message-ID: <AANLkTinS7Y-mvFENz3Oi5Gu9YBtCHtGOH6HvQaZ3y4nb@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimSW2u-fYR7xGLgzPE1ksMs1N4_mnC0iCuNs1m5@mail.gmail.com>

On Thu, Jan 20, 2011 at 7:57 PM, Nick Stokes
<randomaccessiterator@gmail.com> wrote:
> On Thu, Jan 20, 2011 at 3:01 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> On 20 January 2011 19:57, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>> On 20 January 2011 19:28, Nick Stokes wrote:
>>>>
>>>> Great! This indeed revealed it.  In /usr/include/locale.h (same
>>>> location, line  133, in both distros actually)  there is #ifdef
>>>> __USE_GNU  on CentOS version, which is  #ifdef __USE_XOPEN2K8 in
>>>> SUSE's version.   So, in fact if I define `__USE_XOPEN2K8'  while
>>>> compiling on SUSE, it works. Hmm, go figure.. This can not be the
>>>> right way to do this. What am I missing?
>>>
>>> I don't know why they're different (on my glibc 2.12 system the
>>> uselocale definition is guarded by __USE_GNU, just like your CentOS
>>> system) but it looks like you've found the solution.
>>>
>>> Users are not supposed to use the __USE_XXX macros, instead you should
>>> define _GNU_SOURCE to enable __USE_GNU and _POSIX_C_SOURCE=200809L (or
>>> greater) to enable __USE_XOPEN2K8.
>>
>> It looks as though you can also define _XOPEN_SOURCE=700 (or greater)
>> to set __USE_XOPEN2K8
>>
>> Either way, you should use one of those standard feature test macros,
>> not the __USE_XOPEN2K8 one which is an internal implementation
>> details, see man feature_test_macros for more details.
>>
>
> Thanks, these are great leads!
>
> But unfortunately this didn't work either. The reason is subtle (and
> elusive!): On CentOS (where gcc is built) the GCC features.h header is
> defining __USE_XOPEN2K, and not __USE_XOPEN2K8  conditioned on
> _XOPEN_SOURCE (or _POSIX_C_SOURCE) being defined.   But on the
> front-end SUSE, the /usr/include/locale.h is expecting __USE_XOPEN2K8,
> hence fails.
>
> - nick
>

I guess I can sweep under the rug for now by defining __USE_XOPEN2K8.
Incidentally, I need to make this transparent for users. Is it
possible to add such "custom" definitions to gcc at configure time (or
is there some other way to accomplish this)?

Thanks,
- Nick

  reply	other threads:[~2011-01-21  2:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19  0:39 Nick Stokes
2011-01-19  0:57 ` Ian Lance Taylor
2011-01-19  1:14 ` Jonathan Wakely
2011-01-19  1:17   ` Jonathan Wakely
2011-01-19 23:27     ` Nick Stokes
2011-01-20  0:47       ` Jonathan Wakely
2011-01-20 15:53         ` Nick Stokes
2011-01-20 16:40           ` Jonathan Wakely
2011-01-20 19:29             ` Nick Stokes
2011-01-20 19:58               ` Jonathan Wakely
2011-01-20 20:01                 ` Jonathan Wakely
2011-01-21  0:57                   ` Nick Stokes
2011-01-21  2:03                     ` Nick Stokes [this message]
2011-01-21  9:16                       ` Jonathan Wakely
2011-01-21 14:35                         ` Nick Stokes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinS7Y-mvFENz3Oi5Gu9YBtCHtGOH6HvQaZ3y4nb@mail.gmail.com \
    --to=randomaccessiterator@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).