Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking to iOS fails #10384

Closed
kud1ing opened this issue Nov 9, 2013 · 13 comments
Closed

Linking to iOS fails #10384

kud1ing opened this issue Nov 9, 2013 · 13 comments
Labels
O-ios Operating system: iOS

Comments

@kud1ing
Copy link

kud1ing commented Nov 9, 2013

ld: warning: ignoring file arm-apple-darwin/rt/stage2/sync/lock_and_signal.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/sync/lock_and_signal.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/rust_builtin.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/rust_builtin.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/rust_upcall.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/rust_upcall.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/miniz.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/miniz.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/rust_android_dummy.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/rust_android_dummy.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/rust_test_helpers.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/rust_test_helpers.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/arch/arm/_context.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/arch/arm/_context.o
ld: warning: ignoring file arm-apple-darwin/rt/stage2/arch/arm/record_sp.o, file was built for arm??? which is not the architecture being linked (x86_64): arm-apple-darwin/rt/stage2/arch/arm/record_sp.o
Undefined symbols for architecture x86_64:
  "_get_time", referenced from:
     -exported_symbol[s_list] command line option
  "_precise_time_ns", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_begin_unwind", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_create_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_abi_1", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_abi_2", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_call", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_do_nothing", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_TwoDoubles", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_TwoU16s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_TwoU32s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_TwoU64s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_TwoU8s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_double", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_u32", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_u64", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_identity_u8", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_return_TwoU16s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_return_TwoU32s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_return_TwoU64s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_extern_return_TwoU8s", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_create", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_destroy", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_signal", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_unlock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_lock_wait", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_next_port", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_static_mut", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_dbg_static_mut_check_four", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_destroy_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_drop_dlerror_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_drop_env_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_drop_global_args_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_env_pairs", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_global_args_ptr", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_num_cpus", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_stderr", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_stdin", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_stdout", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_get_test_int", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_gmtime", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_initialize_rt_tls_key", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_list_dir_val", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_list_dir_wfd_fp_buf", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_list_dir_wfd_size", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_localtime", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_lock_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_mktime", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_opendir", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_path_exists", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_path_exists_u16", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_path_is_dir", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_path_is_dir_u16", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_readdir", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_running_on_valgrind", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_signal_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_take_dlerror_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_take_env_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_take_global_args_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_timegm", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_try", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_tzset", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_unlock_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_unset_sigprocmask", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_valgrind_stack_deregister", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_valgrind_stack_register", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_wait_little_lock", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_win32_rand_acquire", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_win32_rand_gen", referenced from:
     -exported_symbol[s_list] command line option
  "_rust_win32_rand_release", referenced from:
     -exported_symbol[s_list] command line option
  "_swap_registers", referenced from:
     -exported_symbol[s_list] command line option
  "_tdefl_compress_mem_to_heap", referenced from:
     -exported_symbol[s_list] command line option
  "_tinfl_decompress_mem_to_heap", referenced from:
     -exported_symbol[s_list] command line option
  "_upcall_reset_stack_limit", referenced from:
     -exported_symbol[s_list] command line option
  "_upcall_rust_personality", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [arm-apple-darwin/rt/stage2/librustrt.dylib] Error 1
@alexcrichton
Copy link
Member

It appears that we have compiled a bunch of arm binaries but you're expecting to link a 64-bit x86 binary. I imagine that in mk/platform.mk under CFG_GCCISH_LINK_FLAGS_arm-apple-darwin there should be some flag saying "I would like arm please".

@kud1ing
Copy link
Author

kud1ing commented Dec 2, 2013

It's maybe -arch armv7 / -arch armv7s.

@alexcrichton
Copy link
Member

How are you configuring rust? I couldn't even get libuv to build with an arm target.

@kud1ing
Copy link
Author

kud1ing commented Dec 7, 2013

I did it like is described here: https://github.com/mozilla/rust/wiki/Doc-building-for-ios
This is where the build process stopped for me.

libuv was portable to iOS joyent/libuv#243 at some point in time,

@kud1ing
Copy link
Author

kud1ing commented Dec 7, 2013

That's interesting, compilation fails in rt/arm/morestack.S now. The last change in this file was in October, while it worked for me in November. Was something regarding this enabled in the meantime?

/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:11:7: error: unknown token in expression
.align
      ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:15:1: error: unknown directive
.hidden __morestack
^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:19:2: error: unknown directive
 .type __morestack,%function
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:21:2: error: unknown directive
 .fnstart
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:23:2: error: unknown directive
 .save {r4, r5}
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:24:2: error: unknown directive
 .save {lr}
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:25:2: error: unknown directive
 .save {r6, fp, lr}
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:28:2: error: unknown directive
 .movsp r6
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:30:2: error: unknown directive
 .setfp fp, sp, #4
 ^
/Users/lenny/Github/rust_ios/src/rt/arch/arm/morestack.S:40:5: error: unknown directive
    .fnend

@adrientetar
Copy link
Contributor

@kud1ing Have you tried this?

 .arm
-.align
+.align 2

 .global rust_stack_exhausted
 .global __morestack
 .hidden __morestack

@kud1ing
Copy link
Author

kud1ing commented Jan 4, 2014

I've opened the separate #11312 for the morestack.S compilation errors.

@kud1ing
Copy link
Author

kud1ing commented Jan 5, 2014

If i uncomment the offending assembler instructions i further down get errors like

src/libstd/libc.rs:2937:17: 2937:50 error: unresolved import: could not find `arch` in `libc::types::os`.
src/libstd/libc.rs:2937             use libc::types::os::arch::c95::c_int;
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libstd/libc.rs:2937:17: 2937:50 error: failed to resolve import `libc::types::os::arch::c95::c_int`
src/libstd/libc.rs:2937             use libc::types::os::arch::c95::c_int;
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any idea about this?

@alexcrichton
Copy link
Member

There are probably blocks in libc.rs which need to have #[cfg(target_arch = "arm")] in the target_os = "macos" sections. It'd mostly just involve filling things out here and there.

@kud1ing
Copy link
Author

kud1ing commented Jan 6, 2014

Makes sense, thanks. I've opened the separate #11336 with a solving hint.

@adrientetar
Copy link
Contributor

@kud1ing Globally speaking, this might help:
https://github.com/lht/rust/commits/ios-wip

@kud1ing
Copy link
Author

kud1ing commented Jan 20, 2014

@adridu59: Thanks, i'll add it to the wiki page.

@kud1ing
Copy link
Author

kud1ing commented Jun 17, 2014

Likely fixed by #14715

@kud1ing kud1ing closed this as completed Jun 17, 2014
Jarcho pushed a commit to Jarcho/rust that referenced this issue Feb 26, 2023
Normalize projections types when checking `explicit_auto_deref`

fixes rust-lang#10384

changelog: [`explicit_auto_deref`]: Better consider projection types when checking if auto deref is applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-ios Operating system: iOS
Projects
None yet
Development

No branches or pull requests

3 participants