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

Missing internal symbols on alpine-aarch64 #1476

Closed
mathstuf opened this issue May 26, 2021 · 7 comments
Closed

Missing internal symbols on alpine-aarch64 #1476

mathstuf opened this issue May 26, 2021 · 7 comments

Comments

@mathstuf
Copy link

When compiling sccache with --features=openssl/vendored --release in the 1.51.0-alpine Docker image, lots of aarch64-specific symbols are not found (probably due to optimizations?

  = note: /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_cert.o): in function `ssl_cert_free':
          ssl_cert.c:(.text.ssl_cert_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_lib.o): in function `SSL_CTX_up_ref':
          ssl_lib.c:(.text.SSL_CTX_up_ref+0x14): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_lib.o): in function `SSL_CTX_free':
          ssl_lib.c:(.text.SSL_CTX_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_lib.o): in function `SSL_free':
          ssl_lib.c:(.text.SSL_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_sess.o): in function `SSL_SESSION_free':
          ssl_sess.c:(.text.SSL_SESSION_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(ssl_sess.o):ssl_sess.c:(.text.SSL_SESSION_up_ref+0x14): more undefined references to `__aarch64_ldadd4_relax' follow
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(lhash.o): in function `getrn':
          lhash.c:(.text.getrn+0x3c): undefined reference to `__aarch64_ldadd8_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: lhash.c:(.text.getrn+0x94): undefined reference to `__aarch64_ldadd8_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: lhash.c:(.text.getrn+0xac): undefined reference to `__aarch64_ldadd8_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(lhash.o): in function `OPENSSL_LH_retrieve':
          lhash.c:(.text.OPENSSL_LH_retrieve+0x48): undefined reference to `__aarch64_ldadd8_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: lhash.c:(.text.OPENSSL_LH_retrieve+0x80): undefined reference to `__aarch64_ldadd8_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(drbg_lib.o): in function `RAND_DRBG_instantiate':
          drbg_lib.c:(.text.RAND_DRBG_instantiate+0x2d8): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(drbg_lib.o): in function `RAND_DRBG_reseed':
          drbg_lib.c:(.text.RAND_DRBG_reseed+0x20c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(rsa_lib.o): in function `RSA_free':
          rsa_lib.c:(.text.RSA_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(threads_pthread.o): in function `CRYPTO_atomic_add':
          threads_pthread.c:(.text.CRYPTO_atomic_add+0x1c): undefined reference to `__aarch64_ldadd4_acq_rel'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(x509_lu.o): in function `X509_STORE_free':
          x509_lu.c:(.text.X509_STORE_free+0x1c): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(x509_lu.o): in function `X509_STORE_up_ref':
          x509_lu.c:(.text.X509_STORE_up_ref+0x14): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(x509_set.o): in function `X509_up_ref':
          x509_set.c:(.text.X509_up_ref+0x14): undefined reference to `__aarch64_ldadd4_relax'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/sccache/src/target/aarch64-unknown-linux-musl/release/deps/libopenssl_sys-fcc8125410f43229.rlib(x509cset.o): in function `X509_CRL_up_ref':
          x509cset.c:(.text.X509_CRL_up_ref+0x14): undefined reference to `__aarch64_ldadd4_relax'
          collect2: error: ld returned 1 exit status

Is this a problem here or with something else in the toolchain?

@sfackler
Copy link
Owner

I am not sure - sscache, the cross compilation setup, or openssl-src could be the potential offenders there.

@mathstuf
Copy link
Author

mathstuf commented May 26, 2021

Further data points:

  • --features=openssl/vendored --release: above error
  • --release (system openssl): works
  • --features=openssl/vendored: above error
  • (no flags) (system openssl): works

@mathstuf
Copy link
Author

I'll also note that there is no cross compilation here; I'm running this on native aarch64 hardware.

@sfackler
Copy link
Owner

Ah! This may actually be an issue with rustc's embedded MUSL version then? If the system's version is newer and expects those symbols, but they don't exist in the version rustc vendors.

@mathstuf
Copy link
Author

Hmm. Does that mean that the 1.51.0-alpine container is just busted then (for C-using crates)? I'll try 1.53.0-alpine to see if that works.

@mathstuf
Copy link
Author

OK, no 1.53.0 yet, but 1.52 has the same issue.

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