1

我正在尝试在带有 imx6 的板上交叉编译 ElinOS 的 GPG。我在编译 libgcrypt 时遇到问题。首先,这就是我所做的:

export PATH=/opt/elinos/cdk/arm/v7hf/glibc/bin:$PATH 
./configure --host=arm-unknown-linux-gnueabihf --build=i686-pc-linux-gnu 
make all

配置部分没有显示错误或警告,但 make 显示如下:

hwf-arm.c:31:3: error: #error Module build for wrong CPU.
 # error Module build for wrong CPU.
   ^
hwf-arm.c: In function 'get_hwcap':
hwf-arm.c:126:26: error: 'AT_HWCAP' undeclared (first use in this function)
       if (auxv.a_type == AT_HWCAP)
                          ^
hwf-arm.c:126:26: note: each undeclared identifier is reported only once for each function it appears in
hwf-arm.c:132:26: error: 'AT_HWCAP2' undeclared (first use in this function)
       if (auxv.a_type == AT_HWCAP2)
                          ^
In file included from hwf-arm.c:27:0:
hwf-arm.c: In function 'detect_arm_at_hwcap':
hwf-arm.c:159:23: error: 'arm_features' undeclared (first use in this function)
   for (i = 0; i < DIM(arm_features); i++)
                       ^
g10lib.h:96:24: note: in definition of macro 'DIM'
 #define DIM(v) (sizeof(v)/sizeof((v)[0]))
                        ^
hwf-arm.c: In function 'detect_arm_proc_cpuinfo':
hwf-arm.c:250:23: error: 'arm_features' undeclared (first use in this function)
   for (i = 0; i < DIM(arm_features); i++)
                       ^
g10lib.h:96:24: note: in definition of macro 'DIM'
 #define DIM(v) (sizeof(v)/sizeof((v)[0]))

第一个错误导致我进入这部分代码:

#if !defined (__arm__) && !defined (__aarch64__)
# error Module build for wrong CPU.
#endif

知道这是从哪里来的吗?它看起来像一个配置问题,但我不知道现在在哪里看。

4

1 回答 1

0

config.log文件中,CC 已正确设置:CC='arm-unknown-linux-gnueabihf-gcc'.

但是我需要在 make 命令中指定它。因此make all,我不得不使用make all CC=arm-unknown-linux-gnueabihf-gcc.

于 2019-02-13T09:20:55.323 回答