如何修复此 libgcrypt 交叉编译错误?

How do I fix this libgcrypt cross-compilation error?

我正在尝试在带有 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

知道这是从哪里来的吗?看起来像是配置问题,但我现在不确定去哪里查看。

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

但我需要在 make 命令中指定它。因此,我不得不使用 make all CC=arm-unknown-linux-gnueabihf-gcc,而不是简单地使用不起作用的 make all