public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
@ 2011-12-02 14:11 Pablo Barrio
  2011-12-02 15:10 ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Barrio @ 2011-12-02 14:11 UTC (permalink / raw)
  To: gcc-help

Hi all,

I´m trying to install gcc-4.6.1 on an Ubuntu 11.10, I hope you can help...

I have the stock gcc-4.6.1 installed from the Ubuntu repositories via apt-get. However, I want another gcc installed so I can apply a few patches. This is how I'm trying to compile:

$> cd gcc-build
$> ../gcc-v4.6.1/configure --program-prefix=-wpatch --prefix=/usr/local/gcc-wpatch
$> make

It goes through the compilation for a while, but then I get these errors:


------------------------------------

In file included from ../../gcc-v4.6.1/gcc/c-lang.c:24:0:
../../gcc-v4.6.1/gcc/system.h:462:20: error: conflicting types for ‘strsignal’
/usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here
In file included from ../../gcc-v4.6.1/gcc/input.h:25:0,
                 from ../../gcc-v4.6.1/gcc/tree.h:27,
                 from ../../gcc-v4.6.1/gcc/c-lang.c:27:
../../gcc-v4.6.1/gcc/../libcpp/include/line-map.h:64:38: error: ‘CHAR_BIT’ undeclared here (not in a function)
../../gcc-v4.6.1/gcc/../libcpp/include/line-map.h:64:3: error: bit-field ‘reason’ width not an integer constant
../../gcc-v4.6.1/gcc/../libcpp/include/line-map.h:64:3: warning: ‘reason’ is narrower than values of its type [enabled by default]
In file included from ../../gcc-v4.6.1/gcc/tree.h:32:0,
                 from ../../gcc-v4.6.1/gcc/c-lang.c:27:
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/hwint.h:17:39: error: division by zero in #if
../../gcc-v4.6.1/gcc/real.h:105:9: error: #error "REAL_WIDTH > 6 not supported"
In file included from ../../gcc-v4.6.1/gcc/c-family/c-common.h:26:0,
                 from ../../gcc-v4.6.1/gcc/c-tree.h:25,
                 from ../../gcc-v4.6.1/gcc/c-lang.c:28:
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:215:3: error: bit-field ‘type’ width not an integer constant
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:215:3: warning: ‘type’ is narrower than values of its type [enabled by default]
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:257:3: error: #error "Cannot find a least-32-bit signed integer type"
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:259:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cppchar_t’
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:260:1: error: unknown type name ‘CPPCHAR_SIGNED_T’
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:739:1: error: unknown type name ‘cppchar_t’
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:750:1: error: unknown type name ‘cppchar_t’
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:750:58: error: unknown type name ‘cppchar_t’
../../gcc-v4.6.1/gcc/../libcpp/include/cpplib.h:916:1: error: unknown type name ‘cppchar_t’
make[3]: *** [c-lang.o] Error 1
make[3]: Leaving directory `/home/pbarrio/apps/gcc-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/pbarrio/apps/gcc-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pbarrio/apps/gcc-build'
make: *** [all] Error 2

--------------------------------------

Any clue? I also have LLVM installed. I found some related threads about the "conflicting types for strsignal" error, but they are a few years old.

Thanks ahead,

Pablo
DIE-UPM
Madrid

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-02 14:11 error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu Pablo Barrio
@ 2011-12-02 15:10 ` Ian Lance Taylor
  2011-12-02 17:50   ` Pablo Barrio
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-12-02 15:10 UTC (permalink / raw)
  To: Pablo Barrio; +Cc: gcc-help

Pablo Barrio <pbarrio@die.upm.es> writes:

> In file included from ../../gcc-v4.6.1/gcc/c-lang.c:24:0:
> ../../gcc-v4.6.1/gcc/system.h:462:20: error: conflicting types for ‘strsignal’
> /usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here

Look in gcc/config.h.  I predict that HAVE_STRSIGNAL is not defined,
although your system does have strsignal.  Look in gcc/config.log and
try to find out why the test for strsignal failed.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-02 15:10 ` Ian Lance Taylor
@ 2011-12-02 17:50   ` Pablo Barrio
  2011-12-02 18:36     ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Barrio @ 2011-12-02 17:50 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

In config.log:

-----------------

configure:8845: checking for strsignal
configure:8845: result: yes
...
configure:10068: checking whether strsignal is declared
configure:10100: result: yes
...
ac_cv_func_strsignal=yes
...
gcc_cv_have_decl_strsignal=yes

------------------

So... the strsignal test didn't fail. In auto-host.h, included by config.h:

/* Define to 1 if you have the `strsignal' function. */
#ifndef USED_FOR_TARGET
#define HAVE_STRSIGNAL 1
#endif

I've tried to edit auto-host.h to see if HAVE_STRSIGNAL was defined at preprocessing, but the file seems to be autogenerated so my modifications are lost.

Any ideas?
Thanks ahead,
Pablo

On 02/12/2011, at 16:09, Ian Lance Taylor wrote:

> Pablo Barrio <pbarrio@die.upm.es> writes:
> 
>> In file included from ../../gcc-v4.6.1/gcc/c-lang.c:24:0:
>> ../../gcc-v4.6.1/gcc/system.h:462:20: error: conflicting types for ‘strsignal’
>> /usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here
> 
> Look in gcc/config.h.  I predict that HAVE_STRSIGNAL is not defined,
> although your system does have strsignal.  Look in gcc/config.log and
> try to find out why the test for strsignal failed.
> 
> Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-02 17:50   ` Pablo Barrio
@ 2011-12-02 18:36     ` Ian Lance Taylor
  2011-12-07 14:41       ` Pablo Barrio
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-12-02 18:36 UTC (permalink / raw)
  To: Pablo Barrio; +Cc: gcc-help

Pablo Barrio <pbarrio@die.upm.es> writes:

> In config.log:
>
> -----------------
>
> configure:8845: checking for strsignal
> configure:8845: result: yes
> ...
> configure:10068: checking whether strsignal is declared
> configure:10100: result: yes
> ...
> ac_cv_func_strsignal=yes
> ...
> gcc_cv_have_decl_strsignal=yes
>
> ------------------
>
> So... the strsignal test didn't fail. In auto-host.h, included by config.h:
>
> /* Define to 1 if you have the `strsignal' function. */
> #ifndef USED_FOR_TARGET
> #define HAVE_STRSIGNAL 1
> #endif
>
> I've tried to edit auto-host.h to see if HAVE_STRSIGNAL was defined at preprocessing, but the file seems to be autogenerated so my modifications are lost.
>
> On 02/12/2011, at 16:09, Ian Lance Taylor wrote:
>
>> Pablo Barrio <pbarrio@die.upm.es> writes:
>> 
>>> In file included from ../../gcc-v4.6.1/gcc/c-lang.c:24:0:
>>> ../../gcc-v4.6.1/gcc/system.h:462:20: error: conflicting types for ‘strsignal’
>>> /usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here
>> 
>> Look in gcc/config.h.  I predict that HAVE_STRSIGNAL is not defined,
>> although your system does have strsignal.  Look in gcc/config.log and
>> try to find out why the test for strsignal failed.


(Please don't top-post.  Thanks.)

Interesting.  The lines from system.h are

#if !defined (HAVE_STRSIGNAL) \
    || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
# ifndef strsignal
extern const char *strsignal (int);
# endif
#endif

You show above that HAVE_STRSIGNAL is defined.  Also setting
gcc_cv_have_decl_strsignal implies that HAVE_DECL_STRSIGNAL is defined
to 1.  In that case I have no idea why that declaration will be
compiled.  Clearly it is being compiled because you are getting an error
about it.

I guess I would suggest running the failing compile command with -E and
see if you can see what is happening.  If you are compiling gcc with
another version of gcc, then it may help to use -dD with -E to see where
HAVE_STRSIGNAL and HAVE_DECL_STRSIGNAL are being defined.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-02 18:36     ` Ian Lance Taylor
@ 2011-12-07 14:41       ` Pablo Barrio
  2011-12-07 15:06         ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Barrio @ 2011-12-07 14:41 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

El 02/12/11 19:36, Ian Lance Taylor escribió:
> Pablo Barrio<pbarrio@die.upm.es>  writes:
>
>> In config.log:
>>
>> -----------------
>>
>> configure:8845: checking for strsignal
>> configure:8845: result: yes
>> ...
>> configure:10068: checking whether strsignal is declared
>> configure:10100: result: yes
>> ...
>> ac_cv_func_strsignal=yes
>> ...
>> gcc_cv_have_decl_strsignal=yes
>>
>> ------------------
>>
>> On 02/12/2011, at 16:09, Ian Lance Taylor wrote:
>>
>>> Pablo Barrio<pbarrio@die.upm.es>  writes:
>>>
>>>> In file included from ../../gcc-v4.6.1/gcc/c-lang.c:24:0:
>>>> ../../gcc-v4.6.1/gcc/system.h:462:20: error: conflicting types for ‘strsignal’
>>>> /usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here
>>> Look in gcc/config.h.  I predict that HAVE_STRSIGNAL is not defined,
>>> although your system does have strsignal.  Look in gcc/config.log and
>>> try to find out why the test for strsignal failed.
>
> (Please don't top-post.  Thanks.)
Sorry about that.
> Interesting.  The lines from system.h are
>
> #if !defined (HAVE_STRSIGNAL) \
>      || (defined (HAVE_DECL_STRSIGNAL)&&  !HAVE_DECL_STRSIGNAL)
> # ifndef strsignal
> extern const char *strsignal (int);
> # endif
> #endif
>
> You show above that HAVE_STRSIGNAL is defined.  Also setting
> gcc_cv_have_decl_strsignal implies that HAVE_DECL_STRSIGNAL is defined
> to 1.  In that case I have no idea why that declaration will be
> compiled.  Clearly it is being compiled because you are getting an error
> about it.
>
> I guess I would suggest running the failing compile command with -E and
> see if you can see what is happening.  If you are compiling gcc with
> another version of gcc, then it may help to use -dD with -E to see where
> HAVE_STRSIGNAL and HAVE_DECL_STRSIGNAL are being defined.
>
> Ian
For some reason, the include files that were on the build directory, 
"gcc-build" for me, weren't included properly (funny, as the compilation 
command includes them with "-I."). The include files in the source 
directory, "gcc-4.6.2", were included. Funniest of all, compiling in 
superuser mode (sudo) got rid of all these error messages. But I think 
it should compile without being superuser, as both build and source 
folders are located in my home directory (not the case for the install 
directory, but that one is only used by "make install"). Is that a bug? 
Am I missing something?

Thanks ahead,
Pablo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-07 14:41       ` Pablo Barrio
@ 2011-12-07 15:06         ` Ian Lance Taylor
  2011-12-07 15:11           ` Pablo Barrio
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2011-12-07 15:06 UTC (permalink / raw)
  To: Pablo Barrio; +Cc: gcc-help

Pablo Barrio <pbarrio@die.upm.es> writes:

> For some reason, the include files that were on the build directory,
> "gcc-build" for me, weren't included properly (funny, as the
> compilation command includes them with "-I.").

Did you by any chance run ./configure, rather than running the configure
script in an empty directory as directed by the docs?

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-07 15:06         ` Ian Lance Taylor
@ 2011-12-07 15:11           ` Pablo Barrio
  2011-12-07 15:16             ` Ian Lance Taylor
  2011-12-07 15:55             ` Jonathan Wakely
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo Barrio @ 2011-12-07 15:11 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

El 07/12/11 16:05, Ian Lance Taylor escribió:
> Pablo Barrio<pbarrio@die.upm.es>  writes:
>
>> For some reason, the include files that were on the build directory,
>> "gcc-build" for me, weren't included properly (funny, as the
>> compilation command includes them with "-I.").
> Did you by any chance run ./configure, rather than running the configure
> script in an empty directory as directed by the docs?
>
> Ian
No, I ran configure as follows:

$> mkdir gcc-build
$> cd gcc-build
$> ../gcc-4.6.2/configure --program-suffix=4patches --disable-multilib

And then "make" without arguments.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-07 15:11           ` Pablo Barrio
@ 2011-12-07 15:16             ` Ian Lance Taylor
  2011-12-07 15:55             ` Jonathan Wakely
  1 sibling, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2011-12-07 15:16 UTC (permalink / raw)
  To: Pablo Barrio; +Cc: gcc-help

Pablo Barrio <pbarrio@die.upm.es> writes:

> El 07/12/11 16:05, Ian Lance Taylor escribió:
>> Pablo Barrio<pbarrio@die.upm.es>  writes:
>>
>>> For some reason, the include files that were on the build directory,
>>> "gcc-build" for me, weren't included properly (funny, as the
>>> compilation command includes them with "-I.").
>> Did you by any chance run ./configure, rather than running the configure
>> script in an empty directory as directed by the docs?
>>
>> Ian
> No, I ran configure as follows:
>
> $> mkdir gcc-build
> $> cd gcc-build
> $> ../gcc-4.6.2/configure --program-suffix=4patches --disable-multilib
>
> And then "make" without arguments.

Hmmm, no idea, then.  Sorry.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu
  2011-12-07 15:11           ` Pablo Barrio
  2011-12-07 15:16             ` Ian Lance Taylor
@ 2011-12-07 15:55             ` Jonathan Wakely
  1 sibling, 0 replies; 9+ messages in thread
From: Jonathan Wakely @ 2011-12-07 15:55 UTC (permalink / raw)
  To: Pablo Barrio; +Cc: gcc-help

Someone else reported odd behaviour on this list the other day, which
turned out to be a missing (or badly set) $PATH in the user's
environment.  That fact it works for you as root but not another user
might suggest a similar problem. Compare the output of 'env' for the
two users.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-12-07 15:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02 14:11 error: conflicting types for ‘strsignal’... et al, while installing in Ubuntu Pablo Barrio
2011-12-02 15:10 ` Ian Lance Taylor
2011-12-02 17:50   ` Pablo Barrio
2011-12-02 18:36     ` Ian Lance Taylor
2011-12-07 14:41       ` Pablo Barrio
2011-12-07 15:06         ` Ian Lance Taylor
2011-12-07 15:11           ` Pablo Barrio
2011-12-07 15:16             ` Ian Lance Taylor
2011-12-07 15:55             ` Jonathan Wakely

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).