tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

LLVM Error #290

Closed dt665m closed 3 years ago

dt665m commented 3 years ago

I'm trying to use osxcross to build a rust project and I've run into an issue that has barely any resources to search on. This issue may be completely unrelated to osxcross but I'm out of ideas. Any pointers would be highly appreciated!

OS:

Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

Clang:

clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

OSX Sdks attempted: https://s3.dockerproject.org/darwin/v2/MacOSX10.10.sdk.tar.xz https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz

Problematic Repository: https://github.com/paritytech/reed-solomon-novelpoly

Rust Version: rustc 1.54.0 (a178d0322 2021-07-26)

Build Command:

RUST_BACKTRACE=1 CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/var/opt/osxcross/target/bin/x86_64-apple-darwin14-clang CC_x86_64_apple_darwin=/var/opt/osxcross/target/bin/x86_64-apple-darwin14-clang CXX_x86_64_apple_darwin=/var/opt/osxcross/target/bin/x86_64-apple-darwin14-clang++-libc++ CARGO_TARGET_X86_64_APPLE_DARWIN_AR=/var/opt/osxcross/target/bin/x86_64-apple-darwin14-ar cargo build --target x86_64-apple-darwin --release

Output:

LLVM ERROR: Global variable '_ZN22reed_solomon_novelpoly5field5f2e164AFFT51__static_init_constructor___static_init_initializer17h35d545d30e5e1531E' has an invalid section specifier '.init_array.65535': mach-o section specifier requires a segment whose length is between 1 and 16 characters.
error: could not compile `reed-solomon-novelpoly`
dt665m commented 3 years ago

got some help tracking this down and this is not an osxcross issue. For anyone interested, there is a thread about it at rust's repo. https://github.com/rust-lang/rust/issues/87747