如何解决这个libgcrypt交叉编译错误?

时间:2019-02-11 11:05:30

标签: linux cross-compiling imx6 libgcrypt

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

有什么想法吗?看起来像是配置问题,但是我不确定现在在哪里。

1 个答案:

答案 0 :(得分:0)

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

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