This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Disable libcpp With GCC 4.8?
- From: Cyd Haselton <chaselton at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2013 09:20:38 -0500
- Subject: Re: Disable libcpp With GCC 4.8?
- Authentication-results: sourceware.org; auth=none
- References: <CAHu5PrbCvk8Vkt2byYu84tuAsb0vHE9PnQxp-Z7Fgyg2NGvwyQ at mail dot gmail dot com> <CAKOQZ8yzFWEskJ7F0+k7OYgF5v4Os-eL7ET-hK5wZmY2fUObyA at mail dot gmail dot com>
Ergh...sorry about the reply to individual...stupid gmail defaults.
Copy paste of that email below:
First off, thanks for getting back to me so quickly...I very much appreciate it.
On Fri, Oct 25, 2013 at 8:47 AM, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, Oct 25, 2013 at 4:05 AM, Cyd Haselton <chaselton@gmail.com> wrote:
>>
>> I've cross-built a native version of GCC 4.7 to run on an android device
>> using
>> configure --build=redhat-linux-x86_64 --host=arm-linux-androideabi
>> --target=arm-linux-androideabi (options)
*snip*
>>
>> Is there a way to build without libcpp? Or, remove the dependencies on
>> libcpp that are causing the later portions of the build to fail?
>
> libcpp is an essential part of the compiler; there is no way to
> disable it.
Thanks...that's good to know.
>
> This error looks to me to be a bug in the Android header files. The
> code in libcpp is
> tb = localtime (&st->st_mtime);
> That should be fine.
Hmmm.
I'm *very* new to developing for Android...and building compilers in
general...but
<wild guess mode on>
If this library is for the C/C++ preprocessor, is it possible that the
error could be due to Android's very limited support for C++?
</wild guess mode off>
>
> If you are convinced that the Android header files are correct, then
> please file a bug against GCC; see http://gcc.gnu.org/bugs/ .
>
Probably an error on my part...or a problem that's been fixed in the
bleeding edge source.
At any rate, I'll check the headers...once I figure out which ones to review.
> In the meantime you can fix the problem by editing the GCC sources to
> do something like
> time_t t = (time_t) st->st_mtime;
> tb = localtime (&t);
Ergh. Adding just this throws an 'undeclared in scope' error.
Guessing the correct declaration is something like this
struct time_t *t = NULL;
throws another 'cannot convert' error...specifically cannot convert
'int**' to 'const time_t*.
The overall problem here is that I need familiarity with C, which I
decidedly do not have.
Off to grep the error and try alternate declarations. Maybe 'const
long int' instead of 'struct'...
>
> Ian
On Fri, Oct 25, 2013 at 8:47 AM, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, Oct 25, 2013 at 4:05 AM, Cyd Haselton <chaselton@gmail.com> wrote:
>>
>> I've cross-built a native version of GCC 4.7 to run on an android device
>> using
>> configure --build=redhat-linux-x86_64 --host=arm-linux-androideabi
>> --target=arm-linux-androideabi (options)
>> make -d configure-target-libgcc
>> make -d all-host all-target
>>
>> In (options) I basically disable everything except for
>> --enable-languages=c.
>>
>> However, when I attempt the same with GCC 4.8, I consistently run into the
>> following error:
>>
>> ../../gcc-4.8/libcpp/macro.c:249:34: error: invalid conversion from 'long
>> unsigned int*' to 'const time_t* {aka const long int*}' [-fpermissive]
>>
>> Adding -fpermissive allows the build to continue for a while, but it fails
>> later on with a bunch of undefined references.
>> Disabling libcpp by using --disable-libcpp or --disable-cpplib or
>> --enable-libcpp=no allows the build to continue for a while, but then it
>> fails because of a dependency on libcpp further along in the build.
>>
>> Is there a way to build without libcpp? Or, remove the dependencies on
>> libcpp that are causing the later portions of the build to fail?
>
> libcpp is an essential part of the compiler; there is no way to
> disable it.
>
> This error looks to me to be a bug in the Android header files. The
> code in libcpp is
> tb = localtime (&st->st_mtime);
> That should be fine.
>
> If you are convinced that the Android header files are correct, then
> please file a bug against GCC; see http://gcc.gnu.org/bugs/ .
>
> In the meantime you can fix the problem by editing the GCC sources to
> do something like
> time_t t = (time_t) st->st_mtime;
> tb = localtime (&t);
>
> Ian