PongoOS icon indicating copy to clipboard operation
PongoOS copied to clipboard

ld: symbol(s) not found for architecture arm64

Open cragy0516 opened this issue 3 years ago • 3 comments

.... ld: warning: ignoring file newlib/aarch64-none-darwin/lib/libc.a, building for free standing-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ) ld: warning: ignoring file newlib/aarch64-none-darwin/lib/libm.a, building for free standing-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ) Undefined symbols for architecture arm64: "_realloc", referenced from: _public_api in cc-4117cf.o (maybe you meant: _reallocate_loader_xfer_data) "_strrchr", referenced from: _fdt_subnode_offset_namelen in cc-4117cf.o "_putchar", referenced from: _command_main in cc-4117cf.o _public_api in cc-4117cf.o "_fgets", referenced from: _command_main in cc-4117cf.o "_strtoul", referenced from: _poke_cmd in cc-4117cf.o _sep_pwned_peek in cc-4117cf.o _sep_pwned_poke in cc-4117cf.o _sep_pwned_jump in cc-4117cf.o _public_api in cc-4117cf.o "_qsort", referenced from: _command_register in cc-4117cf.o _start_host_shell in cc-4117cf.o "_strtoull", referenced from: _md8_cmd in cc-4117cf.o _phys_page_dump in cc-4117cf.o _peek_cmd in cc-4117cf.o _poke_cmd in cc-4117cf.o _spawn_cmd in cc-4117cf.o _tz0_set in cc-4117cf.o _xnu_pf_get_kext_header in cc-4117cf.o ... "_printf", referenced from: _pongo_boot_linux in cc-4117cf.o "_strdup", referenced from: _modload_cmd in cc-4117cf.o _hal_service_op in cc-4117cf.o _hal_load_dtree_child_node in cc-4117cf.o "_vfiprintf", referenced from: _task_crash_internal in cc-4117cf.o _public_api in cc-4117cf.o "_strlcpy", referenced from: _task_list in cc-4117cf.o "_viprintf", referenced from: _panic in cc-4117cf.o "_strncmp", referenced from: _device_clock_by_name in cc-4117cf.o _dt_cbp in cc-4117cf.o "_fflush", referenced from: _print_state in cc-4117cf.o _queue_rx_char in cc-4117cf.o _command_main in cc-4117cf.o "_strlen", referenced from: _dt_find_cb in cc-4117cf.o _pongo_entry_cached in cc-4117cf.o _memstr in cc-4117cf.o _memstr_partial in cc-4117cf.o _command_main in cc-4117cf.o _linux_cmdline_cmd in cc-4117cf.o _aes_cmd in cc-4117cf.o ... (maybe you meant: strlen) "_fiprintf", referenced from: _print_state in cc-4117cf.o _wdt_reset in cc-4117cf.o _task_crash_internal in cc-4117cf.o _sep_handle_msg_from_sep in cc-4117cf.o _sep_boot_auto in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o _public_api in cc-4117cf.o ... "_bzero", referenced from: _pongo_entry_cached in cc-4117cf.o _ppage_alloc in cc-4117cf.o _alloc_init in cc-4117cf.o _ttbpage_alloc in cc-4117cf.o _vm_create in cc-4117cf.o _proc_create_task in cc-4117cf.o _task_create_extended in cc-4117cf.o ... "_memchr", referenced from: _pongo_entry_cached in cc-4117cf.o _fdt_get_string in cc-4117cf.o _fdt_subnode_offset_namelen in cc-4117cf.o "_memcpy", referenced from: _sync_exc_el0 in cc-4117cf.o _dt_get_u32_prop in cc-4117cf.o _dt_get_u64_prop in cc-4117cf.o _dt_get_u64_prop_i in cc-4117cf.o _pongo_entry_cached in cc-4117cf.o _pongo_entry in cc-4117cf.o _pongo_main_task in cc-4117cf.o ... (maybe you meant: ___memcpy_chk, _memcpy_trap , memcpy ) "_strcat", referenced from: _pongo_entry_cached in cc-4117cf.o _pongo_main_task in cc-4117cf.o "_strcmp", referenced from: _dt_find_cb in cc-4117cf.o _dt_prop in cc-4117cf.o _dt_alloc_memmap in cc-4117cf.o _dt_get_u32_prop in cc-4117cf.o _dt_get_u64_prop in cc-4117cf.o _dt_get_u64_prop_i in cc-4117cf.o _dt_get_prop in cc-4117cf.o ... (maybe you meant: strcmp) "_free", referenced from: _pongo_entry_cached in cc-4117cf.o _vm_release in cc-4117cf.o _task_release in cc-4117cf.o _task_list in cc-4117cf.o _proc_release in cc-4117cf.o _filetable_release in cc-4117cf.o _fdt_cmd in cc-4117cf.o ... (maybe you meant: _ttbpage_free, _free_contig , _ttbpage_free_walk_recursive , _phys_force_free , _stack_freelist , _kernel_stack_free , _free_list , _free_pages , _free_phys , _phys_page_was_freed , _page_free , _ttb_freelist , _ttbpage_free_walk , _asid_free , _ppage_free , _jit_free ) "_memmem", referenced from: _memstr in cc-4117cf.o _memstr_partial in cc-4117cf.o _xnu_pf_get_kext_header in cc-4117cf.o _public_api in cc-4117cf.o "__impure_ptr", referenced from: _command_putc in cc-4117cf.o _print_state in cc-4117cf.o _wdt_reset in cc-4117cf.o _task_crash_internal in cc-4117cf.o _queue_rx_char in cc-4117cf.o _command_main in cc-4117cf.o _sep_handle_msg_from_sep in cc-4117cf.o ... "_malloc", referenced from: _pongo_entry_cached in cc-4117cf.o _pongo_main_task in cc-4117cf.o _vm_create in cc-4117cf.o _task_list in cc-4117cf.o _proc_create_task in cc-4117cf.o _task_create_extended in cc-4117cf.o _task_create in cc-4117cf.o ... (maybe you meant: ___malloc_lock, ___malloc_unlock ) "_calloc", referenced from: _pongo_entry_cached in cc-4117cf.o _modload_cmd in cc-4117cf.o _spawn_cmd in cc-4117cf.o "___errno", referenced from: _task_list in cc-4117cf.o "_memset", referenced from: _pongo_entry_cached in cc-4117cf.o _task_restart_and_link in cc-4117cf.o _task_register_unlinked in cc-4117cf.o ___memset_chk in cc-4117cf.o _modload_cmd in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o _fdt_add_subnode in cc-4117cf.o ... (maybe you meant: ___memset_chk) "_iprintf", referenced from: _sync_exc_el0 in cc-4117cf.o _pongo_entry_cached in cc-4117cf.o _print_register in cc-4117cf.o _pongo_main_task in cc-4117cf.o _panic in cc-4117cf.o _task_list in cc-4117cf.o _task_switch_irq in cc-4117cf.o ... "_puts", referenced from: _pongo_entry_cached in cc-4117cf.o _command_puts in cc-4117cf.o _pongo_main_task in cc-4117cf.o _panic in cc-4117cf.o _task_switch_irq in cc-4117cf.o _modload_cmd in cc-4117cf.o _xnu_pf_emit in cc-4117cf.o ... (maybe you meant: _screen_puts, _command_puts ) "_strchr", referenced from: _aes_cmd in cc-4117cf.o "_strcpy", referenced from: _dt_alloc_memmap in cc-4117cf.o _pongo_entry_cached in cc-4117cf.o _pongo_main_task in cc-4117cf.o _pongo_boot_xargs in cc-4117cf.o _public_api in cc-4117cf.o (maybe you meant: strcpy) "_memmove", referenced from: _pongo_entry_cached in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o fdt_add_property in cc-4117cf.o _fdt_setprop in cc-4117cf.o _fdt_appendprop in cc-4117cf.o _fdt_add_subnode in cc-4117cf.o _fdt_open_into in cc-4117cf.o ... "___stack_chk_fail", referenced from: _pongo_entry_cached in cc-4117cf.o _print_state in cc-4117cf.o _hexprint in cc-4117cf.o _aes_cmd in cc-4117cf.o _sep_aes_kbag in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o _sep_aes_cmd in cc-4117cf.o ... "_putc", referenced from: _command_putc in cc-4117cf.o _print_state in cc-4117cf.o _task_crash_internal in cc-4117cf.o _queue_rx_char in cc-4117cf.o _public_api in cc-4117cf.o (maybe you meant: _screen_putc, _command_putc , _serial_putc ) "___stack_chk_guard", referenced from: _pongo_entry_cached in cc-4117cf.o _print_state in cc-4117cf.o _hexprint in cc-4117cf.o _aes_cmd in cc-4117cf.o _sep_aes_kbag in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o _sep_aes_cmd in cc-4117cf.o ... "_strstr", referenced from: _xnu_pf_get_kext_header in cc-4117cf.o "_memcmp", referenced from: _pongo_entry_cached in cc-4117cf.o _seprom_fwload_race in cc-4117cf.o _xnu_pf_ptr_to_data_match in cc-4117cf.o fdt_get_property_namelen in cc-4117cf.o _fdt_subnode_offset_namelen in cc-4117cf.o fdt_add_property in cc-4117cf.o _public_api in cc-4117cf.o ... "_strncpy", referenced from: _pongo_entry_cached in cc-4117cf.o _proc_create_task in cc-4117cf.o _task_create_extended in cc-4117cf.o _task_create in cc-4117cf.o _spawn_cmd in cc-4117cf.o "_siprintf", referenced from: _pongo_entry_cached in cc-4117cf.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [build/Pongo] Error 1

macOS Catalina, version 10.15.7 I reinstalled xcode command-line tools and updated xcode, clang, etc. what should I do for it? thank you.

cragy0516 avatar Mar 11 '21 05:03 cragy0516

Hm, I've seen two issues cause this before:

  1. clang and ld versions being out of sync.
  2. GNU ar, libtool and ranlib overriding Darwin/LLVM ar, libtool and ranlib.

The first shouldn't be an issue per se if you're using Xcode, unless you transferred the project folder from a machine with newer Xcode...? In that case, a make distclean should do the trick.
Otherwise, could you check if any GNU tools override their Darwin/LLVM counterparts?

Siguza avatar Mar 11 '21 14:03 Siguza

I checked clang and ld versions and it is not problem, maybe. So I tried to check if any GNU tools override their Darwin/LLVM things but with no luck, so I simply changed my account to other user's and it compiled successfully. I don't know still what happend but... it worked :-S

cragy0516 avatar Mar 12 '21 06:03 cragy0516

I'm glad you got it to work.
But hm, I suppose it might be worth to have the Makefile check for this...

Siguza avatar Mar 19 '21 04:03 Siguza