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

Issue linking with arm64 and musl (Alpine 3.18) #1003

Closed
Fishrock123 opened this issue Dec 11, 2023 · 1 comment
Closed

Issue linking with arm64 and musl (Alpine 3.18) #1003

Fishrock123 opened this issue Dec 11, 2023 · 1 comment

Comments

@Fishrock123
Copy link

Building git2 causes an issue when build for Alpine linux 3.18 targeting arm64.

See this rustc issue: rust-lang/rustup#3324 (comment) - I am not sure if this is a rust compiler issue of an issue with e.g. libgit2-sys, but it seems more likely that it is a crate issue.

Here is my linking error:

10.06 error: linking with `cc` failed: exit status: 1
10.06   |
10.06   = note: LC_ALL="C" PATH="/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/bin:/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/bin/self-contained:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crt1.o" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crti.o" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtbegin.o" "/tmp/rustckg2trO/symbols.o" "/app/target/release/build/app-c0f4da874ae9cb79/build_script_build-c0f4da874ae9cb79.build_script_build.f21e8405a8680897-cgu.0.rcgu.o" "/app/target/release/build/app-c0f4da874ae9cb79/build_script_build-c0f4da874ae9cb79.5cs5zj006xi1kszr.rcgu.o" "-Wl,--as-needed" "-L" "/app/target/release/deps" "-L" "/app/target/release/build/libgit2-sys-b0265079e065ab06/out/build" "-L" "/app/target/release/build/libz-sys-c1e8829c1e9ea85f/out/lib" "-L" "/app/target/release/build/libz-sys-c1e8829c1e9ea85f/out/lib" "-L" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/app/target/release/deps/libbuilt-56c7d404c1513de9.rlib" "/app/target/release/deps/libgit2-6aa19713b6e193c1.rlib" "/app/target/release/deps/liburl-d29a55eea5f8985c.rlib" "/app/target/release/deps/libidna-1a73440288804038.rlib" "/app/target/release/deps/libunicode_normalization-76de1d961712a825.rlib" "/app/target/release/deps/libtinyvec-8d1e5b502fc4efc2.rlib" "/app/target/release/deps/libtinyvec_macros-069cbc3946ed02a8.rlib" "/app/target/release/deps/libunicode_bidi-cbc8e81f0702ea81.rlib" "/app/target/release/deps/libform_urlencoded-b5a5f80a2b2e2879.rlib" "/app/target/release/deps/libpercent_encoding-384b022fd3437573.rlib" "/app/target/release/deps/liblog-bbb4dc17ab6210af.rlib" "/app/target/release/deps/liblibgit2_sys-fedb06ffe4a81e54.rlib" "/app/target/release/deps/liblibz_sys-76293d2a5acbce7c.rlib" "/app/target/release/deps/liblibc-53797761d2e0bf05.rlib" "/app/target/release/deps/libbitflags-584c92aede70dcf2.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd-b13ff878e5d4772e.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libpanic_unwind-56ff67a6f2bbe26c.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libobject-b979ae03b63d8d68.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libmemchr-58cbe68a8bb2fe91.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libaddr2line-9e9fe0f60e5b4d08.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libgimli-d1dc1577e31bf044.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_demangle-121899391fa58bd9.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd_detect-e3f812d8bd3e0e87.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libhashbrown-8a773f116c633544.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_alloc-78fb926ae22d35c0.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libminiz_oxide-f64c502d42d93a67.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libadler-6e8fdf50da1f9c1f.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libunwind-594b86bee800abf8.rlib" "-lunwind" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-f3811e9672bf18c2.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liblibc-30a29c0493545a48.rlib" "-lc" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liballoc-9c89ef503a72291b.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_core-4c4d965152b65e95.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcore-2b1e2f8589f4384b.rlib" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-330cf3f82d35bd41.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-L" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained" "-o" "/app/target/release/build/app-c0f4da874ae9cb79/build_script_build-c0f4da874ae9cb79" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtend.o" "/usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtn.o"
10.06   = note: /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-330cf3f82d35bd41.rlib(45c91108d938afe8-cpu_model.o): in function `init_have_lse_atomics':
10.06           /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.103/./lib/builtins/cpu_model.c:1075: undefined reference to `getauxval'
10.06           /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /usr/local/rustup/toolchains/1.74.1-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-330cf3f82d35bd41.rlib(45c91108d938afe8-cpu_model.o): in function `init_cpu_features':
10.06           /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.103/./lib/builtins/cpu_model.c:1373: undefined reference to `getauxval'
10.06           /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.103/./lib/builtins/cpu_model.c:1374: undefined reference to `getauxval'
10.06           collect2: error: ld returned 1 exit status
@ehuss
Copy link
Contributor

ehuss commented Dec 11, 2023

Thanks for the report! I'm going to close as a duplicate of #706 and rust-lang/rust#89626. Unfortunately I don't think there is anything this library can do to fix the issue. rust-lang/rust#89626 contains some workarounds.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants