MaterializeInc / rust-krb5-src

Rust build system integration for libkrb5, MIT's Kerberos implementation
Apache License 2.0
6 stars 9 forks source link

compile to musl err #25

Closed Orca-bit closed 6 months ago

Orca-bit commented 9 months ago

Caused by: process didn't exit successfully: /target/release/build/krb5-src-56ed040a325ed8a6/build-script-build (exit status: 101) --- stdout checking for x86_64-unknown-linux-musl-gcc... /home/workspace/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether /home/workspace/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc accepts -g... yes checking for /home/workspace/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc option to enable C11 features... none needed checking for x86_64-unknown-linux-musl-g++... no checking for x86_64-unknown-linux-musl-c++... no checking for x86_64-unknown-linux-musl-gpp... no checking for x86_64-unknown-linux-musl-aCC... no checking for x86_64-unknown-linux-musl-CC... no checking for x86_64-unknown-linux-musl-cxx... no checking for x86_64-unknown-linux-musl-cc++... no checking for x86_64-unknown-linux-musl-cl.exe... no checking for x86_64-unknown-linux-musl-FCC... no checking for x86_64-unknown-linux-musl-KCC... no checking for x86_64-unknown-linux-musl-RCC... no checking for x86_64-unknown-linux-musl-xlC_r... no checking for x86_64-unknown-linux-musl-xlC... no checking for x86_64-unknown-linux-musl-clang++... no checking for g++... g++ checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking if C compiler supports -Werror=unknown-warning-option... no checking how to run the C preprocessor... /home/workspace/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc -E checking for x86_64-unknown-linux-musl-pkg-config... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking build system type... x86_64-pc-linux-musl checking host system type... x86_64-unknown-linux-musl checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for GNU linker... yes configure: adding extra warning flags for gcc configure: skipping pedantic warnings on Linux configure: adding extra warning flags for g++ checking if C compiler supports -Wno-format-zero-length... yes checking if C compiler supports -Woverflow... yes checking if C compiler supports -Wstrict-overflow... yes checking if C compiler supports -Wmissing-format-attribute... yes checking if C compiler supports -Wmissing-prototypes... yes checking if C compiler supports -Wreturn-type... yes checking if C compiler supports -Wmissing-braces... yes checking if C compiler supports -Wparentheses... yes checking if C compiler supports -Wswitch... yes checking if C compiler supports -Wunused-function... yes checking if C compiler supports -Wunused-label... yes checking if C compiler supports -Wunused-variable... yes checking if C compiler supports -Wunused-value... yes checking if C compiler supports -Wunknown-pragmas... yes checking if C compiler supports -Wsign-compare... yes checking if C compiler supports -Wnewline-eof... no checking if C compiler supports -Werror=uninitialized... yes checking if C compiler supports -Wno-maybe-uninitialized... yes checking if C compiler supports -Werror=pointer-arith... yes checking if C compiler supports -Werror=int-conversion... yes checking if C compiler supports -Werror=incompatible-pointer-types... yes checking if C compiler supports -Werror=discarded-qualifiers... yes checking if C compiler supports -Werror=implicit-int... yes checking if C compiler supports -Werror=declaration-after-statement... yes checking if C compiler supports -Werror-implicit-function-declaration... yes checking which version of com_err to use... krb5 checking which version of subsystem package to use... krb5 checking for an ANSI C-conforming const... yes checking for gethostbyname... yes checking for socket... yes checking for main in -lresolv... yes checking for res_ninit... no checking for res_nclose... no checking for res_ndestroy... no checking for res_nsearch... no checking for ns_initparse... yes checking for ns_name_uncompress... yes checking for dn_skipname... yes checking for res_search... yes checking whether pragma weak references are supported... yes checking for constructor/destructor attribute support... --- stderr configure: WARNING: using cross tools not prefixed with host triplet configure: error: Cannot test for constructor/destructor support when cross compiling thread 'main' panicked at /krb5-src-0.3.2+1.19.2/build.rs:86:14: configure failed: Custom { kind: Other, error: "command [\"./krb5/src/configure\", \"--prefix=/target/x86_64-unknown-linux-musl/release/build/krb5-src-21fbe7a272afa133/out/install\", \"--enable-static\", \"--disable-shared\", \"--disable-nls\", \"CPPFLAGS=\", \"CFLAGS= -fPIC\", \"--host=x86_64-unknown-linux-musl\"] exited with code 1" } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish...

Repo-SK commented 9 months ago

Hey @Orca-bit, did you find a solution to this? I'm having the same issue with trying to cross-compile it to x86_64-unknown-linux-musl like yourself.

benesch commented 6 months ago

When cross-compiling, there are various configure tests that you'll need to provide the results of, since the tests can't be run automatically. In this case, you should set the krb5_cv_attr_constructor_destructor to yes or no based on whether your target system supports constructor/destructor attributes.

You may find the code and discussion in https://github.com/MaterializeInc/rust-krb5-src/pull/24 helpful as well.

I'm going to close this out, since this is is working as intended from the perspective of this crate!