12

Ubuntu12.0432ビットのソースからg++4.7.1をコンパイルしようとしています。今のところ私はそれを正確に行っています:https : //askubuntu.com/questions/168947/how-to-upgrade-g-to-4-7-1 g++4.7.1のコンパイルの直前を除いてそれは私に尋ねます「LIBRARY_PATHの設定を解除」します(これで完了です)。したがって、コンパイルが開始され、しばらくすると次のエラーメッセージが表示されます。

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’

(申し訳ありませんが、一部のエラーメッセージはフランス語です:erreur -> errordivision par zéro dans #if -> division by zero in #if)。

問題とその解決方法は何ですか?

./configure(他の小さな質問:との違いは何./configure -vですか?)

編集:system.hのstrsignalの行

/* 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
4

3 に答える 3

11

I used

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

Since I don't have root access on this machine, and so I have appended to a lot of those variables.

于 2013-09-13T20:12:54.147 に答える
9

I had the same problem. In my case, I solved it by unsetting the bash variables CPATH, LIBRARY_PATH and C_INCLUDE_PATH. After that, the build went fine.

于 2013-07-10T16:29:04.123 に答える
3

Other solutions did not work for me, because I use those env variables to point gcc to some of its dependencies. Also unsetting variit does not sound like a very precise fix :)

Turns out the problem is I had some trailing : in my env vars declarations, like so:

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

The result is that LIBRARY_PATH will always include the current directory too. Setting the env variables properly, with no trailing :, solved the problem.

于 2018-01-03T12:36:03.250 に答える