messense/homebrew-macos-cross-toolchains

armv7-unknown-linux-musleabihf: undefined reference to symbol '__gettimeofday_time64'

unbeatable-101 opened this issue · 10 comments

  = note: /opt/homebrew/Cellar/armv7-unknown-linux-musleabihf/10.3.0/toolchain/bin/../lib/gcc/armv7-unknown-linux-musleabihf/10.3.0/../../../../armv7-unknown-linux-musleabihf/bin/ld.bfd: /var/folders/96/7_zsj2c13r751mhmyphh_4tm0000gn/T/rustcLsS3VY/liblibrocksdb_sys-2be16c70ec701818.rlib(env.o): undefined reference to symbol '__gettimeofday_time64'
          /opt/homebrew/Cellar/armv7-unknown-linux-musleabihf/10.3.0/toolchain/bin/../lib/gcc/armv7-unknown-linux-musleabihf/10.3.0/../../../../armv7-unknown-linux-musleabihf/bin/ld.bfd: /opt/homebrew/Cellar/armv7-unknown-linux-musleabihf/10.3.0/toolchain/bin/../armv7-unknown-linux-musleabihf/sysroot/usr/lib/libc.so: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

This happens when building the rocksdb branch of conduit for armv7-unknown-linux-musleabihf, I'm pretty sure this is the same issue, but I can't test it as musl-cross-make won't compile either (known issue for m1 macs)

See upstream issue: rust-lang/libc#1848

For now you can change the following lines

CT_MUSL_V_1_2_2=y
# CT_MUSL_V_1_2_1 is not set
# CT_MUSL_V_1_1_24 is not set

to

 # CT_MUSL_V_1_2_2=y 
 # CT_MUSL_V_1_2_1 is not set 
CT_MUSL_V_1_1_24=y

and build you own toolchain with crosstool-ng.

It fails with this

[INFO ]  Installing pass-2 core C gcc compiler
[EXTRA]    Configuring core C gcc compiler
Error:     clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ALL  ]    aarch64-build_apple-darwin21.3.0-g++   -g -I/Volumes/build/.build/armv7-unknown-linux-musleabihf/buildtools/include   -Qunused-arguments -fno-common -fbracket-depth=512    -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -DGENERATOR_FILE -fno-PIE -L/Volumes/build/.build/armv7-unknown-linux-musleabihf/buildtools/lib   -framework CoreFoundation -lstdc++ -lm  -no-pie -o build/gencondmd     build/gencondmd.o build/errors.o ../build-aarch64-build_apple-darwin21.3.0/libiberty/libiberty.a
[ALL  ]    ld: warning: -no_pie ignored for arm64
[ALL  ]    Undefined symbols for architecture arm64:
[ALL  ]      "_arm_abi", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch4", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch5t", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch5te", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch6", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch6k", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch6m", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch7", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch7em", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch8", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch8_1m_main", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_arm_hwdiv", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_cde", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_iwmmxt", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_lpae", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_notm", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_arch_thumb2", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_base_arch", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_disable_literal_pool", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_arm_restrict_it", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_flag_pic", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_inline_thumb1_jump_table", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_operands", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_optimize_size", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_reload_completed", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_reload_in_progress", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_target_flags", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_target_thread_pointer", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_this_target_rtl", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_unaligned_access", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]      "_use_cmse", referenced from:
[ALL  ]          ___cxx_global_var_init in gencondmd.o
[ALL  ]    ld: symbol(s) not found for architecture arm64
Error:     clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error:     make[1]: *** [Makefile:2923: build/gencondmd] Error 1
[ALL  ]    make[1]: Leaving directory '/Volumes/build/.build/armv7-unknown-linux-musleabihf/build/build-cc-gcc-core-pass-2/gcc'

You seem to have gotten it working with github actions, any idea why it fails?

I was building on a self-hosted arm64 Mac.

That's what I'm doing too

Try downgrade crosstool-ng, the last good build was 8 months ago the but log is expired: https://github.com/messense/homebrew-macos-cross-toolchains/actions/runs/829438008

The version on my Mac is 94b98a4.
crosstool-ng/crosstool-ng@94b98a4

Hmm, still fails with the same error

Please try again with the latest code which has upgraded to GCC 11.2.0.

Closing due to inactivity.