MIPS下交叉编译问题

jianzhibeihang 2010-03-23 09:34:46
在MIPS的芯片上用开源的net-snmp开发一个agent,用的是MIPS的交叉编译环境对net-snmp进行编译。

在对net-snmp编译以后会生成两个.la的库,MIPS的交叉编译环境下有个类似ranlib的命令
是mips-linux-ranlib,在自动生成的Makefile中会用mips-linux-ranlib对这个.la进行索引的重建,但是在make的时候
报错说.la的文件格式不对,mips-linux-ranlib不认识这个格式

不知道什么原因造成的,是不是MIPS交叉编译环境下的这个ranlib对这中.la的库没用还是怎么?

想请有过这方面经验的大牛指教下,多谢了啊!!!
...全文
352 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wyj0793 2010-07-19
  • 打赏
  • 举报
回复
刚才也碰到类似问题了,发现mips-linux-ranlib只识别.a文件,所以你需要修改Makefile.
qihuanfengyun 2010-03-24
  • 打赏
  • 举报
回复
mips-linux-ar cru .libs/libnetsnmphelpers.a all_helpers.o baby_steps.o bulk_to_next.o cache_handler.o debug_handler.o instance.o mode_end_call.o multiplexer.o null.o old_api.o read_only.o row_merge.o scalar.o scalar_group.o serialize.o stash_cache.o stash_to_next.o table.o table_array.o table_container.o table_data.o table_dataset.o table_iterator.o table_tdata.o watcher.o
mips-linux-ranlib .libs/libnetsnmphelpers.a

从这可以看出这是由 mips-linux-ar 创建的 libnetsnmphelpers.a 至于怎么最终创建的 libnetsnmphelpers.la
就不知道了。
jianzhibeihang 2010-03-24
  • 打赏
  • 举报
回复
/bin/sh ../../libtool --mode=link mips-linux-gcc -g -O2 -Dlinux -DIPMUX_BIG_ENDIAN -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -DMAKE_MIPS -DOPULAN_RTOS_LINUX -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -g -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -Wswitch -enum -rpath /usr/net-snmp/lib -version-info 10:5:0 -o libnetsnmphelpers.la all_helpers.lo baby_steps.lo bulk_to_next.lo cache_handler.lo debug_handler.lo instance.lo mode_end_call.lo multiplexer.lo null.lo old_api.lo read_only.lo row_merge.lo scalar.lo scalar_group.lo serialize.lo stash_cache.lo stash_to_next.lo table.lo table_array.lo table_container.lo table_data.lo table_dataset.lo table_iterator.lo table_tdata.lo watcher.lo
mkdir .libs
rm -fr .libs/libnetsnmphelpers.la .libs/libnetsnmphelpers.* .libs/libnetsnmphelpers.*
mips-linux-ar cru .libs/libnetsnmphelpers.a all_helpers.o baby_steps.o bulk_to_next.o cache_handler.o debug_handler.o instance.o mode_end_call.o multiplexer.o null.o old_api.o read_only.o row_merge.o scalar.o scalar_group.o serialize.o stash_cache.o stash_to_next.o table.o table_array.o table_container.o table_data.o table_dataset.o table_iterator.o table_tdata.o watcher.o
mips-linux-ranlib .libs/libnetsnmphelpers.a
creating libnetsnmphelpers.la
(cd .libs && rm -f libnetsnmphelpers.la && ln -s ../libnetsnmphelpers.la libnetsnmphelpers.la)
mips-linux-ranlib libnetsnmphelpers.la
mips-linux-ranlib: libnetsnmphelpers.la: File format not recognized
make: *** [libnetsnmphelpers.la] 错误 1
jianzhibeihang 2010-03-24
  • 打赏
  • 举报
回复
/bin/sh ../../libtool --mode=link mips-linux-gcc -g -O2 -Dlinux -DIPMUX_BIG_ENDIAN -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -DMAKE_MIPS -DOPULAN_RTOS_LINUX -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -g -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -Wswitch -enum -rpath /usr/net-snmp/lib -version-info 10:5:0 -o libnetsnmphelpers.la all_helpers.lo baby_steps.lo bulk_to_next.lo cache_handler.lo debug_handler.lo instance.lo mode_end_call.lo multiplexer.lo null.lo old_api.lo read_only.lo row_merge.lo scalar.lo scalar_group.lo serialize.lo stash_cache.lo stash_to_next.lo table.lo table_array.lo table_container.lo table_data.lo table_dataset.lo table_iterator.lo table_tdata.lo watcher.lo
mkdir .libs
rm -fr .libs/libnetsnmphelpers.la .libs/libnetsnmphelpers.* .libs/libnetsnmphelpers.*
mips-linux-ar cru .libs/libnetsnmphelpers.a all_helpers.o baby_steps.o bulk_to_next.o cache_handler.o debug_handler.o instance.o mode_end_call.o multiplexer.o null.o old_api.o read_only.o row_merge.o scalar.o scalar_group.o serialize.o stash_cache.o stash_to_next.o table.o table_array.o table_container.o table_data.o table_dataset.o table_iterator.o table_tdata.o watcher.o
mips-linux-ranlib .libs/libnetsnmphelpers.a
creating libnetsnmphelpers.la
(cd .libs && rm -f libnetsnmphelpers.la && ln -s ../libnetsnmphelpers.la libnetsnmphelpers.la)
mips-linux-ranlib libnetsnmphelpers.la
mips-linux-ranlib: libnetsnmphelpers.la: File format not recognized
make: *** [libnetsnmphelpers.la] 错误 1
谭海燕 2010-03-23
  • 打赏
  • 举报
回复
把错误信息贴出来看看
jianzhibeihang 2010-03-23
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 feiyinzilgd 的回复:]
对MIPS不熟悉

帮你顶下。
[/Quote]
能不能说说ranlib对于.la 的库能操作吗?
因为我在用ranlib对.la的库操作的时候 说 .la文件格式不对
ranlib不认识这种文件格式
谭海燕 2010-03-23
  • 打赏
  • 举报
回复
对MIPS不熟悉

帮你顶下。

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧