2012-09-03 28 views
8

Estoy tratando de compilar g ++ 4.7.1 desde el código fuente en Ubuntu 12.04 32 bits. Por el momento lo he hecho exactamente: https://askubuntu.com/questions/168947/how-to-upgrade-g-to-4-7-1 Excepto justo antes de la compilación de g ++ 4.7.1, me pide "desarmar LIBRARY_PATH" (así que lo hice). Así comienza la compilación, y después de un rato tengo el siguiente mensaje de error:g ++ 4.7.1 error de compilación: tipos conflictivos para 'strsignal'

In file included from ../.././gcc/c-lang.c:24:0: 
../.././gcc/system.h:499:20: erreur: conflicting types for ‘strsignal’ 
/usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here 
In file included from ./tm.h:19:0, 
       from ../.././gcc/c-lang.c:26: 
./options.h:3738:2: erreur: #error too many masks for ix86_isa_flags 
In file included from ../.././gcc/input.h:25:0, 
       from ../.././gcc/tree.h:27, 
       from ../.././gcc/c-lang.c:27: 
../.././gcc/../libcpp/include/line-map.h:208:38: erreur: ‘CHAR_BIT’ undeclared here (not in a function) 
../.././gcc/../libcpp/include/line-map.h:208:3: erreur: bit-field ‘reason’ width not an integer constant 
../.././gcc/../libcpp/include/line-map.h:208:3: attention : ‘reason’ is narrower than values of its type [enabled by default] 
In file included from ../.././gcc/tree.h:32:0, 
       from ../.././gcc/c-lang.c:27: 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if 
../.././gcc/real.h:105:9: erreur: #error "REAL_WIDTH > 6 not supported" 
In file included from ../.././gcc/c-family/c-common.h:26:0, 
       from ../.././gcc/c-tree.h:25, 
       from ../.././gcc/c-lang.c:28: 
../.././gcc/../libcpp/include/cpplib.h:225:3: erreur: bit-field ‘type’ width not an integer constant 
../.././gcc/../libcpp/include/cpplib.h:225:3: attention : ‘type’ is narrower than values of its type [enabled by default] 
../.././gcc/../libcpp/include/cpplib.h:267:3: erreur: #error "Cannot find a least-32-bit signed integer type" 
../.././gcc/../libcpp/include/cpplib.h:269:35: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cppchar_t’ 
../.././gcc/../libcpp/include/cpplib.h:270:1: erreur: unknown type name ‘CPPCHAR_SIGNED_T’ 
../.././gcc/../libcpp/include/cpplib.h:768:1: erreur: unknown type name ‘cppchar_t’ 
../.././gcc/../libcpp/include/cpplib.h:779:1: erreur: unknown type name ‘cppchar_t’ 
../.././gcc/../libcpp/include/cpplib.h:779:58: erreur: unknown type name ‘cppchar_t’ 
../.././gcc/../libcpp/include/cpplib.h:954:1: erreur: unknown type name ‘cppchar_t’ 

(lo siento, algunos mensajes de error están en francés: erreur -> error y division par zéro dans #if -> division by zero in #if).

¿Cuál es el problema y cómo solucionarlo?

(un poco otra pregunta: ¿cuál es la diferencia entre ./configure y ./configure -v)

EDIT: las líneas de strsignal en system.h

/* If the system doesn't provide strsignal, we get it defined in 
    libiberty but no declaration is supplied. */ 
#if !defined (HAVE_STRSIGNAL) \ 
    || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL) 
# ifndef strsignal 
extern const char *strsignal (int); 
# endif 
#endif 
+0

Recientemente construí gcc 4.7.1 desde la fuente - tal vez mis notas serán de ayuda: http://steve-lorimer.blogspot.com.au/2012/08/building-gcc.html –

Respuesta

5

que tenían el mismo problema. En mi caso, lo resolví desarmando las variables bash CPATH, LIBRARY_PATH y C_INCLUDE_PATH. Después de eso, la construcción fue bien.

8

Solía ​​

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE 

Dado que no tengo acceso root en esta máquina, y por lo que han añadido a un montón de esas variables.

+1

Esto acaba de corregir los errores para yo compilando gcc 5.3.0 (la respuesta aceptada no se desconectó lo suficiente) –

0

He usado "unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE". Eso resolvió mi problema.

0

Otras soluciones no me funcionaron, porque uso esas variables env para apuntar gcc a algunas de sus dependencias. También unset ting variit no suena como una solución muy preciso :)

Resulta que el problema es que tenía alguna arrastrando : en mi env vars declaraciones, así:

$ export LIBRARY_PATH=/foo/bar:$LIBRARY_PATH 
$ echo $LIBRARY_PATH 
/foo/bar: 

El resultado es que se LIBRARY_PATH siempre incluya el directorio actual también. Establecer las variables env correctamente, sin seguimiento :, resolvió el problema.

Cuestiones relacionadas