Binutils和GDB无法在具有x86_64体系结构的macOS Mojave上构建

时间:2018-11-17 15:46:39

标签: gcc gdb macos-mojave

answer回应了GDB无法在macOS Mojave上进行调试。我遇到了同样的问题,无法构建binutils,因为答案声称将解决GDB和Mojave的不兼容问题。

当我执行./configure时不会引发任何错误,但是当我执行make时会发出几千行警告:

1 warning generated.
if [ x"" != x ]; then \
      gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.13.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE  ../../binutils-2.13.1/libiberty/xexit.c -o pic/xexit.o; \
    else true; fi
if [ x"" != x ]; then \
      gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.13.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE   ../../binutils-2.13.1/libiberty/xexit.c -o noasan/xexit.o; \
    else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.13.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE ../../binutils-2.13.1/libiberty/xexit.c -o xexit.o
warning: unknown warning option '-Wshadow=local' [-Wunknown-warning-option] 

最终失败并失败:

ld: warning: ignoring file ../libiberty/libiberty.a, file was built for archive which is not the architecture being linked (x86_64): ../libiberty/libiberty.a
ld: warning: ignoring file ../bfd/.libs/libbfd.a, file was built for archive which is not the architecture being linked (x86_64): ../bfd/.libs/libbfd.a
ld: warning: ignoring 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:
      _do_display_target 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
      _do_display_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
      _do_display_target in bucomm.o
  "_bfd_init", referenced from:
      _main in size.o
  "_bfd_iterate_over_targets", referenced from:
      _display_info 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:
      _do_display_target in bucomm.o
  "_bfd_printable_arch_mach", referenced from:
      _display_info in bucomm.o
      _do_display_target 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_error_program_name", referenced from:
      _main in size.o
  "_bfd_set_format", referenced from:
      _do_display_target in bucomm.o
  "_bfd_target_list", referenced from:
      _list_supported_targets 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
      _bfd_get_archive_filename in bucomm.o
      _make_tempname in bucomm.o
      _make_tempdir in bucomm.o
  "_xmalloc_set_program_name", referenced from:
      _main in size.o
  "_xrealloc", referenced from:
      _do_display_target in bucomm.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

我对C ++和这种安装非常陌生,如果需要更多信息,请发表评论。

0 个答案:

没有答案