2012-12-13 129 views
1

我試圖在運行Linux 2.6的Buffalo LinkStation Pro Duounlocking it之後)編譯GCC 4.7.2。 31.8 armv5tel。GCC編譯產生「real.h:53:錯誤:'SIZEOF_LONG'這裏未聲明(不在函數中)」

不幸的是,make拋出相當一些錯誤,與

gcc -c -DIN_GCC_FRONTEND -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-formIn file included from ../../gcc-4.7.2/gcc/tree.h:32, 
       from ../../gcc-4.7.2/gcc/c-lang.c:27: 
../../gcc-4.7.2/gcc/real.h:53: error: 'SIZEOF_LONG' undeclared here (not in a function) 
In file included from ../../gcc-4.7.2/gcc/tree.h:32, 
       from ../../gcc-4.7.2/gcc/c-lang.c:27: 
../../gcc-4.7.2/gcc/real.h:87:5: error: division by zero in #if 
../../gcc-4.7.2/gcc/real.h:87:5: error: division by zero in #if 
../../gcc-4.7.2/gcc/real.h:90:6: error: division by zero in #if 

開始53線的real.h讀取unsigned long sig[SIGSZ];,其中SIGSZ在管線40作爲
#define SIGSZ (SIGNIFICAND_BITS/HOST_BITS_PER_LONG)
限定,而線87是#if REAL_WIDTH == 1REAL_WIDTH限定的起始在作爲
#define REAL_WIDTH \
(REAL_VALUE_TYPE_SIZE/HOST_BITS_PER_WIDE_INT \
+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */

這似乎歸結爲HOST_BITS_PER_*爲零。我是否必須用一些configure參數手動定義這些參數,或者如何解決這個問題?


更新

config.log包含以下錯誤:

conftest.c:10:19: error: ppl_c.h: No such file or directory 
conftest.c: In function 'main': 
conftest.c:16: error: 'choke' undeclared (first use in this function) 
conftest.c:16: error: (Each undeclared identifier is reported only once 
conftest.c:16: error: for each function it appears in.) 
conftest.c:16: error: expected ';' before 'me' 
configure:5708: $? = 1 
configure: failed program was: 
| /* confdefs.h */ 
| #define PACKAGE_NAME "" 
| #define PACKAGE_TARNAME "" 
| #define PACKAGE_VERSION "" 
| #define PACKAGE_STRING "" 
| #define PACKAGE_BUGREPORT "" 
| #define PACKAGE_URL "" 
| #define LT_OBJDIR ".libs/" 
| /* end confdefs.h. */ 
| #include "ppl_c.h" 
| int 
| main() 
| { 
|. 
|  #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11 
|  choke me 
|  #endif 
|. 
| ; 
| r 

this post我似乎已經忘記了安裝ppl,我會盡力現在

回答

1

SIZEOF_LONG應是#define d由文件auto-host.hconfigure。你auto-host.h應該包含這樣的:

/* The size of `long', as computed by sizeof. */ 
#ifndef USED_FOR_TARGET 
#define SIZEOF_LONG 8 
#endif 

如果上述不存在(和它看起來像你的情況下,它的確是這樣),錯誤檢查config.log。搜索字符串checking size of long附近的錯誤。

+0

該條目在那裏,雖然它是'#define SIZEOF_LONG 4'這裏。在config.log中還有其他的錯誤,我把它們追加到我的問題 –

+0

我接受你的答案,因爲檢查'config.log'指出我缺少'ppl'。但實際的解決方案[涉及更多的麻煩](http://stackoverflow.com/a/13874779/321973) - 如果是解決方案,編譯仍在運行...... –

1
  • 感謝chill's answer我檢查config.log發現
    conftest.c:10:19: error: ppl_c.h: No such file or directory
    (其中,奇怪的是,並沒有阻止configure從創建一個Makefile和返回成功錯誤代碼)。第一個谷歌碰到的是this post,顯示我沒有提供ppl dependency
  • 的PPL-1.0編譯迎接我
    checked_float.inlines.hh:1012: error: 'frexpl' was not declared in this scope
    害得我this post暗示我會用the 1.1 snapshot來代替,該工作
  • 現在,gcc的make給我提供了另一種 「有用」 的錯誤:
    gcc/../libcpp/include/line-map.h:66: error: 'CHAR_BIT'
    turned out是由於C_INCLUDE_PATHending with a colon(我已經經歷了那個帖子提到的checking LIBRARY_PATH variable... contains current directory錯誤,但也沒多想檢查其他變量是也)

編譯仍在運行,到目前爲止,還沒有更多的錯誤...