GCC 编译生成“real.h:53: 错误: 'SIZEOF_LONG' 未在此处声明(不在函数中)”

2024-02-10

我正在尝试编译 GCC 4.7.2Buffalo LinkStation Pro 双核 http://www.buffalo-technology.com/en/linkstatio-pro-duo.html (after 解锁 http://buffalo.nas-central.org/wiki/Open_Stock_Firmware_LS-VL它)运行Linux 2.6.31.8 armv5tel。

很遗憾,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 reads unsigned long sig[SIGSZ];, where SIGSZ第 40 行定义为
#define SIGSZ (SIGNIFICAND_BITS / HOST_BITS_PER_LONG)
而第 87 行是#if REAL_WIDTH == 1 with REAL_WIDTH从第 72 行开始定义为
#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参数或者如何解决这个问题?


update

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

下列的这个帖子 https://groups.google.com/forum/?fromgroups=#!topic/gnu.gcc.help/72AMJrsw-IU我好像忘记安装了ppl http://bugseng.com/products/ppl/Download/,我现在就尝试一下


SIZEOF_LONG应该#defined by configure在文件中auto-host.h. Your 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.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

GCC 编译生成“real.h:53: 错误: 'SIZEOF_LONG' 未在此处声明(不在函数中)” 的相关文章

随机推荐