首页
社区
课程
招聘
[求助] binutils-2.25 编译问题
发表于: 2015-2-5 22:01 9779

[求助] binutils-2.25 编译问题

2015-2-5 22:01
9779
求助 : 我的情况是这样的     mac os  10.10  
安装 binutils-2.25   
第一次编译的时候没有任何问题,./configure  ,make  ,make install
装好之后 原文件删掉了,可是问题就出来了 ,第二次编译的  binutils-2.25 时候就开始报ld 错了   包括编译 gcc 源码 也报ld 错
Ξ nasm/build → clang -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
Ξ nasm/build → ld -v
@(#)PROGRAM:ld  PROJECT:ld64-241.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7m armv7em
LTO support using: LLVM version 3.5svn

$gcc -v  
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

$gdb
this GDB was configured as follows:
   configure --host=x86_64-apple-darwin14.0.0 --target=x86_64-apple-darwin14.0.0
             --with-auto-load-dir={prefix}/share/auto-load
             --with-auto-load-safe-path={prefix}/share/auto-load
             --with-expat
             --with-gdb-datadir=/usr/local/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/local/lib/gdb (relocatable)
             --without-libunwind-ia64
             --without-lzma
             --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7
             --without-guile
             --with-separate-debug-dir=/usr/local/lib/debug (relocatable)
             --with-zlib
             --without-babeltrace
我想问问这个target 是怎么回事 还有 --host

第二次编译 binutils-2.25 如下错误 麻烦楼主帮忙分析下, 不甚感激。应该是编译ld 的时候出错,然后是 size 命令。但是 第一次没错,第二次却有错了,不知道原因所在。

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -Wl,-no_pie -o size size.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a -ldl ../libiberty/libiberty.a ./../intl/libintl.a -liconv -lz
ld: warning: ld: warning: ld: warning: ignoring file ../libiberty/libiberty.a, file was built for archive which is not the architecture being linked (x86_64): ../libiberty/libiberty.aignoring file ../bfd/.libs/libbfd.a, file was built for archive which is not the architecture being linked (x86_64): ../bfd/.libs/libbfd.aignoring file ./../intl/libintl.a, file was built for archive which is not the architecture being linked (x86_64): ./../intl/libintl.a

Undefined symbols for architecture x86_64:
  "__bfd_std_section", referenced from:
      _sysv_internal_sizer in size.o
      _sysv_internal_printer in size.o
  "_bfd_arch_list", referenced from:
      _list_supported_architectures in bucomm.o
  "_bfd_check_format", referenced from:
      _display_file in size.o
      _display_bfd in size.o
  "_bfd_check_format_matches", referenced from:
      _display_bfd in size.o
  "_bfd_close", referenced from:
      _display_file in size.o
  "_bfd_close_all_done", referenced from:
      _display_info in bucomm.o
  "_bfd_core_file_failing_command", referenced from:
      _display_bfd in size.o
  "_bfd_errmsg", referenced from:
      _bfd_nonfatal in bucomm.o
      _bfd_nonfatal_message in bucomm.o
      _set_default_bfd_target in bucomm.o
  "_bfd_get_error", referenced from:
      _display_file in size.o
      _display_bfd in size.o
      _bfd_nonfatal in bucomm.o
      _bfd_nonfatal_message in bucomm.o
      _set_default_bfd_target in bucomm.o
      _display_info in bucomm.o
  "_bfd_init", referenced from:
      _main in size.o
  "_bfd_malloc", referenced from:
      _bfd_get_archive_filename in bucomm.o
  "_bfd_map_over_sections", referenced from:
      _print_sizes in size.o
  "_bfd_openr", referenced from:
      _display_file in size.o
  "_bfd_openr_next_archived_file", referenced from:
      _display_file in size.o
  "_bfd_openw", referenced from:
      _display_info in bucomm.o
  "_bfd_printable_arch_mach", referenced from:
      _display_info in bucomm.o
  "_bfd_scan_vma", referenced from:
      _parse_vma in bucomm.o
  "_bfd_set_default_target", referenced from:
      _set_default_bfd_target in bucomm.o
  "_bfd_set_error", referenced from:
      _display_file in size.o
  "_bfd_set_format", referenced from:
      _display_info in bucomm.o
  "_bfd_target_list", referenced from:
      _list_supported_targets in bucomm.o
  "_bfd_target_vector", referenced from:
      _display_info in bucomm.o
  "_expandargv", referenced from:
      _main in size.o
  "_libintl_bindtextdomain", referenced from:
      _main in size.o
  "_libintl_gettext", referenced from:
      _main in size.o
      _usage in size.o
      _set_default_bfd_target in bucomm.o
      _list_matching_formats in bucomm.o
      _list_supported_targets in bucomm.o
      _list_supported_architectures in bucomm.o
      _display_info in bucomm.o
      ...
  "_libintl_textdomain", referenced from:
      _main in size.o
  "_make_temp_file", referenced from:
      _display_info in bucomm.o
  "_xexit", referenced from:
      _bfd_fatal in bucomm.o
      _fatal in bucomm.o
  "_xmalloc", referenced from:
      _print_sizes in size.o
      _template_in_dir in bucomm.o
  "_xmalloc_set_program_name", referenced from:
      _main in size.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [size] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-binutils] Error 2
make: *** [all] Error 2

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 2332
活跃值: (3804)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
2
target和host是交叉编译用的选项.
target指名编译出来的bin可以处理何种平台的文件
host指明编译出来的bin可以运行在何种平台
还有一个build,指明编译器所运行的平台.

你的这个报错说找不到指定平台的符号,可能是你生成的lib库平台不对.
2015-2-11 11:15
0
雪    币: 32
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
你好,但是为什么第一次编译我没设置任何参数,就通过编译了呢,第二次却不行了,我想问问,是不是 第一次编译的时候被修改了 某个环境变量?
2015-2-12 20:13
0
雪    币: 2332
活跃值: (3804)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
4
make distclean
然后再
./configure
make
一下...
2015-2-27 19:02
0
游客
登录 | 注册 方可回帖
返回
//