darwin-on-arm / xnu

Porting the Darwin kernel to the AArch64/ARMv7/ARMv6-A architectures.
Other
582 stars 146 forks source link

GenericBooter won't build on OS X (10.10.3) #26

Closed ghost closed 9 years ago

ghost commented 9 years ago

There is no area to report an issue in the GenericBooter project, so I am raising it here.

Following the (partially Linux) instructions from the Wiki, GenericBooter won't build on OS X as the linker cannot find many of the necessary symbols (most relating to ncurses).

# Reproduction steps. Latest Xcode command line tools installed. Homebrew installed.
# pwd: ~/Project/
brew install qemu
git clone https://github.com/darwin-on-arm/image3maker.git
cd image3maker; make
sudo install -s -m 755 image3maker /usr/bin/image3maker

git clone https://github.com/darwin-on-arm/xnu.git
git clone https://github.com/darwin-on-arm/GenericBooter.git

# -- This fails too, but that is a separate issue
cd xnu; make TARGET_CONFIGS="debug arm armpba8" NO_DTRACE_SYMS=YES; cd ..
# --

cd GenericBooter
make menuconfig # Fails (Does partially complete though, unlike xnu).
# See below for full output

I suspect there may be an implicit linking option missing somewhere, although I may have just missed something obvious... I'd really like to get involved in this project :).

Full Make Output:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
scripts/kconfig/conf.c:77:10: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
                printf(_("aborted!\n\n"));
                       ^~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:36:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
< ... Snip (All similar warnings) ...>
10 warnings generated.
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
Undefined symbols for architecture x86_64:
  "_acs_map", referenced from:
      _dialog_checklist in checklist.o
      _print_arrows in checklist.o
      _dialog_clear in util.o
      _draw_box in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _dialog_yesno in yesno.o
      ...
  "_cbreak", referenced from:
      _init_dialog in util.o
  "_delwin", referenced from:
      _dialog_checklist in checklist.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _dialog_yesno in yesno.o
      _dialog_menu in menubox.o
  "_doupdate", referenced from:
      _dialog_checklist in checklist.o
  "_endwin", referenced from:
      _init_dialog in util.o
      _end_dialog in util.o
  "_flash", referenced from:
      _dialog_inputbox in inputbox.o
  "_getcurx", referenced from:
      _init_dialog in util.o
      _print_autowrap in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _print_arrows in menubox.o
  "_getcury", referenced from:
      _init_dialog in util.o
      _print_autowrap in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _print_arrows in menubox.o
  "_getmaxx", referenced from:
      _conf in mconf.o
      _dialog_checklist in checklist.o
      _dialog_clear in util.o
      _init_dialog in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _refresh_text_box in textbox.o
      ...
  "_getmaxy", referenced from:
      _dialog_checklist in checklist.o
      _attr_clear in util.o
      _dialog_clear in util.o
      _init_dialog in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _refresh_text_box in textbox.o
      ...
  "_has_colors", referenced from:
      _init_dialog in util.o
      _draw_shadow in util.o
  "_init_pair", referenced from:
      _init_dialog in util.o
  "_initscr", referenced from:
      _init_dialog in util.o
  "_keypad", referenced from:
      _dialog_checklist in checklist.o
      _init_dialog in util.o
      _on_key_esc in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _dialog_yesno in yesno.o
      _dialog_menu in menubox.o
      ...
  "_newwin", referenced from:
      _dialog_checklist in checklist.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _dialog_yesno in yesno.o
      _dialog_menu in menubox.o
  "_nodelay", referenced from:
      _on_key_esc in util.o
  "_noecho", referenced from:
      _init_dialog in util.o
  "_scrollok", referenced from:
      _dialog_checklist in checklist.o
      _dialog_menu in menubox.o
  "_start_color", referenced from:
      _init_dialog in util.o
  "_stdscr", referenced from:
      _conf in mconf.o
      _dialog_checklist in checklist.o
      _dialog_clear in util.o
      _init_dialog in util.o
      _end_dialog in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      ...
  "_subwin", referenced from:
      _dialog_checklist in checklist.o
      _dialog_textbox in textbox.o
      _dialog_menu in menubox.o
  "_ungetch", referenced from:
      _on_key_esc in util.o
  "_waddch", referenced from:
      _dialog_checklist in checklist.o
      _print_item in checklist.o
      _print_arrows in checklist.o
      _attr_clear in util.o
      _dialog_clear in util.o
      _print_title in util.o
      _print_button in util.o
      ...
  "_waddnstr", referenced from:
      _print_item in checklist.o
      _print_arrows in checklist.o
      _dialog_clear in util.o
      _print_title in util.o
      _print_autowrap in util.o
      _print_button in util.o
      _dialog_inputbox in inputbox.o
      ...
  "_wattrset", referenced from:
      _dialog_checklist in checklist.o
      _print_item in checklist.o
      _print_arrows in checklist.o
      _attr_clear in util.o
      _dialog_clear in util.o
      _print_title in util.o
      _print_button in util.o
      ...
  "_wbkgdset", referenced from:
      _dialog_textbox in textbox.o
      _refresh_text_box in textbox.o
      _dialog_menu in menubox.o
  "_wclrtoeol", referenced from:
      _refresh_text_box in textbox.o
      _do_print_item in menubox.o
  "_wgetch", referenced from:
      _dialog_checklist in checklist.o
      _on_key_esc in util.o
      _dialog_inputbox in inputbox.o
      _dialog_textbox in textbox.o
      _dialog_yesno in yesno.o
      _dialog_menu in menubox.o
  "_winch", referenced from:
      _draw_shadow in util.o
  "_wmove", referenced from:
      _dialog_checklist in checklist.o
      _print_item in checklist.o
      _print_arrows in checklist.o
      _attr_clear in util.o
      _dialog_clear in util.o
      _end_dialog in util.o
      _print_title in util.o
      ...
  "_wnoutrefresh", referenced from:
      _dialog_checklist in checklist.o
      _dialog_clear in util.o
      _draw_shadow in util.o
      _dialog_textbox in textbox.o
      _refresh_text_box in textbox.o
      _dialog_menu in menubox.o
  "_wprintw", referenced from:
      _print_item in checklist.o
      _refresh_text_box in textbox.o
  "_wrefresh", referenced from:
      _dialog_checklist in checklist.o
      _print_item in checklist.o
      _end_dialog in util.o
      _dialog_inputbox in inputbox.o
      _refresh_text_box in textbox.o
      _dialog_yesno in yesno.o
      _dialog_menu in menubox.o
      ...
  "_wscrl", referenced from:
      _dialog_checklist in checklist.o
      _dialog_menu in menubox.o
  "_wtouchln", referenced from:
      _attr_clear in util.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[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2
b-man commented 9 years ago

This is a known problem with GenericBooter in it's current form. When winocm updated GenericBooter, she decided to use Linux's Kconfig configuration framework in the build systems as a way to make GenericBooter support multiple platforms in the same codebase. While this approach may work if you plan to build DarwinARM in a Linux environment, this is going to be problematic if you plan to build on Mac OSX. I'm still investigating possible solutions to this problem, and I might end up replacing GenericBooter entirely with my own bootloader, xBoot, which is designed to be modular and easy to build on any POSIX-compliant operating system.

musisat commented 9 years ago

So does GenericBooter currently not build on OSX?