用 openwrt 工具链编译 openssl-1.1.1d,出现如下错误:

mipsel-openwrt-linux-gcc: error: unrecognized command line option ‘-m64’
Makefile:708: recipe for target ‘apps/app_rand.o’ failed

很多人说打开 Makefile 删除 -m64 继续编译,这样可以解决,但是每次都这样处理,太费劲。

回归正题,具体原因是没有给定 os/compile,所以默认会添加 -m64 编译选项,目前很多 openwrt 都是32位系统,而且编译器基本不认 -m64 选项。

可以运行一下 ./Configure 看一下输出,根据自己的需要选择对应的 os/compiler,其他平台的比如 arm,android 等平台选择合适的参数。

32bit mips openwrt(MT76xx) 配置以及交叉编译方法:

$ ./Configure linux-mips32 --cross-compile-prefix=mipsel-openwrt-linux- --prefix=$PWD/install no-async
$ make -j8
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐