joerg-krause / rust-cross-libs

Cross-compile the Rust standard library for custom targets without a full bootstrap build.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can this script provide non-unwind libstd?

vi opened this issue · comments

As far as I know, removing unwinding (including from stdlib) and not use jemalloc is a way to make Rust static binaries small.

Can rust-cross-libs be used to build libstd like i686-unknown-linux-musl, but without unwinding (i.e. for -C panic=abort)? If yes, what cfg json there shall be?

I tried some weeks ago and it did not work. Tried today and it breaks with:

rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Instructions.cpp:1436: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.

I will try again...

As far as I know, removing unwinding (including from stdlib) and not use jemalloc is a way to make Rust static binaries small.

Note that this script build shared binaries for the musl target.

Can it also work for static?

Can rust-cross-libs turn into a sort of rustup.rs addon that automatically builds targets if they are not avaliable for usual download? I.e. you specify settings (allocator, unwinding, cpu features, platform, object format, static or not) and it either downloads such things (if it happens to be provided officially) or builds it.

Can it also work for static?

Probably, yes. You need to remove the patch for libc (which forces libc to link dynamically) and adjust the JSON file so the necessary libraries and object files are found by Rust.

Can rust-cross-libs turn into a sort of rustup.rs addon that automatically builds targets if they are not avaliable for usual download? I.e. you specify settings (allocator, unwinding, cpu features, platform, object format, static or not) and it either downloads such things (if it happens to be provided officially) or builds it.

I haven't looked at rustup.rs yet, so I cannot say.

I was able to build a cargo-based libstd with the abort panic-strategy for the ARMv5TE targets today 😄.

You're welcome to try the latest rust-cross-libs build script!

How does this project compare or relate to xargo?

Both do pretty much the same nowadays, I guess. However, I was not able to get xargo to work for me.

@joerg-krause
You've mentioned that you can adjust the JSON file so the necessary libraries and object files are found by Rust.

Probably, yes. You need to remove the patch for libc (which forces libc to link dynamically) and adjust the JSON file so the necessary libraries and object files are found by Rust.

Could you please specify how can I exactly specify rust to search libc.a in a specific folder.
I can't find a way in the parameters list.

That's what I've got when trying to build the statically linked musl rust toolchain.

error: could not find native static library `c`, perhaps an -L flag is missing? src/libstd_unicode/Cargo.toml HEAD is now at ae98ebf... Auto merge of #43281 - mmatyas:remotetest_env, r=alexcrichton checking build system type... armv5te-rcross-linux-musleabi checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for x86_64-unknown-linux-gnu-gcc... /home/user/muslexec/bin/musl-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /home/user/muslexec/bin/musl-gcc accepts -g... yes checking for /home/user/muslexec/bin/musl-gcc option to accept ISO C89... none needed checking how to run the C preprocessor... /home/user/muslexec/bin/musl-gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define __EXTENSIONS__... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes /bin/bash: /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/missing: No such file or directory configure: WARNING: `missing' script is too old or missing checking for x86_64-unknown-linux-gnu-strip... no checking for strip... strip configure: WARNING: using cross tools not prefixed with host triplet checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for x86_64-unknown-linux-gnu-gcc... (cached) /home/user/muslexec/bin/musl-gcc checking whether we are using the GNU C compiler... (cached) yes checking whether /home/user/muslexec/bin/musl-gcc accepts -g... (cached) yes checking for /home/user/muslexec/bin/musl-gcc option to accept ISO C89... (cached) none needed checking for x86_64-unknown-linux-gnu-ranlib... /home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-ar s checking for gawk... (cached) gawk checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for fgrep... /bin/grep -F checking for ld used by /home/user/muslexec/bin/musl-gcc... /home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/bin/ld checking if the linker (/home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for x86_64-unknown-linux-gnu-dumpbin... no checking for x86_64-unknown-linux-gnu-link... no checking for dumpbin... no checking for link... link -dump checking the name lister (nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/bin/ld option to reload object files... -r checking for x86_64-unknown-linux-gnu-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for x86_64-unknown-linux-gnu-ar... /home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-ar checking for x86_64-unknown-linux-gnu-strip... strip checking for x86_64-unknown-linux-gnu-ranlib... (cached) /home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-ar s checking command to parse nm output from /home/user/muslexec/bin/musl-gcc object... ok checking for dlfcn.h... yes checking for objdir... .libs checking if /home/user/muslexec/bin/musl-gcc supports -fno-rtti -fno-exceptions... no checking for /home/user/muslexec/bin/musl-gcc option to produce PIC... -fPIC -DPIC checking if /home/user/muslexec/bin/musl-gcc PIC flag -fPIC -DPIC works... yes checking if /home/user/muslexec/bin/musl-gcc static flag -static works... yes checking if /home/user/muslexec/bin/musl-gcc supports -c -o file.o... yes checking if /home/user/muslexec/bin/musl-gcc supports -c -o file.o... (cached) yes checking whether the /home/user/muslexec/bin/musl-gcc linker (/home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/bin/ld -m elf_i386) supports shared libraries... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... unsupported checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... no checking whether to build shared libraries... no checking whether to build static libraries... yes checking unwind.h usability... yes checking unwind.h presence... yes checking for unwind.h... yes checking for _Unwind_Backtrace... yes checking for -funwind-tables option... yes checking for -frandom-seed=string option... yes checking whether /home/user/muslexec/bin/musl-gcc supports -W... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wall... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wwrite-strings... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wstrict-prototypes... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wmissing-prototypes... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wold-style-definition... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wmissing-format-attribute... yes checking whether /home/user/muslexec/bin/musl-gcc supports -Wcast-qual... yes checking for _Unwind_GetIPInfo... yes checking __sync extensions... yes checking __atomic extensions... yes checking output filetype... elf32 looking for a compliant stdint.h in stdint.h, checking for uintmax_t... yes checking for uintptr_t... yes checking for int_least32_t... yes checking for int_fast32_t... yes checking for uint64_t... yes checking what to include in gstdint.h... stdint.h (already complete) checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking for mmap... yes checking link.h usability... yes checking link.h presence... yes checking for link.h... yes checking for dl_iterate_phdr... yes checking for fcntl... yes checking whether strnlen is declared... yes checking for getexecname... no checking whether tests can run... no configure: creating ./config.status config.status: creating Makefile config.status: creating backtrace-supported.h config.status: creating config.h config.status: executing libtool commands config.status: executing gstdint.h commands config.status: executing default commands make all-am make[1]: Entering directory `/home/user/autotools/rcrmusl3/rust-cross-libs/build/libbacktrace' /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=atomic.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o atomic.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/atomic.c true DO=all multi-do # make /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o dwarf.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/dwarf.c /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=fileline.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o fileline.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/fileline.c /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=posix.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o posix.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/posix.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=atomic.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/atomic.c -o atomic.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=fileline.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/fileline.c -o fileline.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=posix.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/posix.c -o posix.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/dwarf.c -o dwarf.o /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=print.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o print.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/print.c /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=sort.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o sort.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/sort.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=print.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/print.c -o print.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=sort.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/sort.c -o sort.o /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o state.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/state.c /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o backtrace.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/backtrace.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/state.c -o state.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/backtrace.c -o backtrace.o /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=simple.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o simple.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/simple.c /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=elf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o elf.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/elf.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=simple.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/simple.c -o simple.o /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=mmapio.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o mmapio.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/mmapio.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=elf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/elf.c -o elf.o /bin/bash ./libtool --tag=CC --mode=compile /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=mmap.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c -o mmap.lo /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/mmap.c libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=mmap.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/mmap.c -o mmap.o libtool: compile: /home/user/muslexec/bin/musl-gcc -DHAVE_CONFIG_H -I. -I/home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../include -I /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=mmapio.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -c /home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libbacktrace/mmapio.c -o mmapio.o /bin/bash ./libtool --tag=CC --mode=link /home/user/muslexec/bin/musl-gcc -funwind-tables -frandom-seed=libbacktrace.la -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Wall -Os -fPIC -D__arm__ -mfloat-abi=soft -L/home/user/muslbbb/lib -fno-stack-protector -o libbacktrace.la atomic.lo dwarf.lo fileline.lo posix.lo print.lo sort.lo state.lo backtrace.lo simple.lo elf.lo mmapio.lo mmap.lo libtool: link: /home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-ar cru .libs/libbacktrace.a atomic.o dwarf.o fileline.o posix.o print.o sort.o state.o backtrace.o simple.o elf.o mmapio.o mmap.o libtool: link: /home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-ar s .libs/libbacktrace.a libtool: link: ( cd ".libs" && rm -f "libbacktrace.la" && ln -s "../libbacktrace.la" "libbacktrace.la" ) make[1]: Leaving directory `/home/user/autotools/rcrmusl3/rust-cross-libs/build/libbacktrace' warning: unused manifest key: target.armv5te-rcross-linux-musleabi.linker warning: unused manifest key: target.armv5te-rcross-linux-musleabi.rustflags Compiling gcc v0.3.51 Compiling unwind v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libunwind) Compiling libc v0.2.26 Compiling core v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libcore) Compiling libc v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/rustc/libc_shim) Compiling filetime v0.1.10 Compiling build_helper v0.1.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/build_helper) Compiling compiler_builtins v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/rustc/compiler_builtins_shim) Compiling alloc_jemalloc v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/liballoc_jemalloc) Compiling std v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libstd) warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/divdc3.c:21:1: warning: conflicting types for built-in function '__divdc3' [enabled by default] warning: __divdc3(double __a, double __b, double __c, double __d) warning: ^ warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/divsc3.c:21:1: warning: conflicting types for built-in function '__divsc3' [enabled by default] warning: __divsc3(float __a, float __b, float __c, float __d) warning: ^ warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/muldc3.c:21:1: warning: conflicting types for built-in function '__muldc3' [enabled by default] warning: __muldc3(double __a, double __b, double __c, double __d) warning: ^ warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/mulsc3.c:21:1: warning: conflicting types for built-in function '__mulsc3' [enabled by default] warning: __mulsc3(float __a, float __b, float __c, float __d) warning: ^ Compiling std_unicode v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/libstd_unicode) Compiling rand v0.0.0 (file:///home/user/autotools/rcrmusl3/rust-cross-libs/rust-git/src/librand) error: could not find native static library `c`, perhaps an -L flag is missing?

error: Could not compile libc.
warning: build failed, waiting for other jobs to finish...
error: build failed

gcc cross toolchain user@ubuntu:~/muslexec/bin$ ./musl-gcc -v Using built-in specs. Reading specs from /home/user/muslbbb/lib/musl-gcc.specs rename spec cpp_options to old_cpp_options COLLECT_GCC=/home/user/x-tools/armv5te-unknown-linux-gnueabi/bin/armv5te-unknown-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/home/user/x-tools/armv5te-unknown-linux-gnueabi/libexec/gcc/armv5te-unknown-linux-gnueabi/4.8.5/lto-wrapper Target: armv5te-unknown-linux-gnueabi Configured with: /home/cross-ng/bin/.build/src/gcc-4.8.5/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=armv5te-unknown-linux-gnueabi --prefix=/home/user/x-tools/armv5te-unknown-linux-gnueabi --with-sysroot=/home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/sysroot --enable-languages=c,c++ --with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-pkgversion='crosstool-NG crosstool-ng-1.23.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --enable-libsanitizer --with-gmp=/home/cross-ng/bin/.build/armv5te-unknown-linux-gnueabi/buildtools --with-mpfr=/home/cross-ng/bin/.build/armv5te-unknown-linux-gnueabi/buildtools --with-mpc=/home/cross-ng/bin/.build/armv5te-unknown-linux-gnueabi/buildtools --with-isl=/home/cross-ng/bin/.build/armv5te-unknown-linux-gnueabi/buildtools --with-cloog=/home/cross-ng/bin/.build/armv5te-unknown-linux-gnueabi/buildtools --disable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm' --enable-threads=posix --enable-target-optspace --disable-plugin --disable-nls --disable-multilib --with-local-prefix=/home/user/x-tools/armv5te-unknown-linux-gnueabi/armv5te-unknown-linux-gnueabi/sysroot --enable-long-long Thread model: posix gcc version 4.8.5 (crosstool-NG crosstool-ng-1.23.0)
musl libc libs user@ubuntu:~/muslbbb/lib$ ls -l total 2900

-rw-r--r-- 1 user user 1304 Aug 24 17:54 crt1.o
-rw-r--r-- 1 user user 824 Aug 24 17:54 crti.o
-rw-r--r-- 1 user user 788 Aug 24 17:54 crtn.o
-rw-r--r-- 1 user user 2126714 Aug 24 17:54 libc.a <------------------
-rw-r--r-- 1 user user 8 Aug 24 17:54 libcrypt.a
-rwxr-xr-x 1 user user 778504 Aug 24 17:54 libc.so
-rw-r--r-- 1 user user 8 Aug 24 17:54 libdl.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 libm.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 libpthread.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 libresolv.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 librt.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 libutil.a
-rw-r--r-- 1 user user 8 Aug 24 17:54 libxnet.a
-rw-r--r-- 1 user user 697 Aug 24 17:54 musl-gcc.specs
-rw-r--r-- 1 user user 2132 Aug 24 17:54 rcrt1.o
-rw-r--r-- 1 user user 1372 Aug 24 17:54 Scrt1.o

@mosolovsa Sorry for late reply. I've tried to build a statically linked hello binary without any luck. Unfortunately, I am busy right now so it may take a while until I get this working.

@joerg-krause Thanks for your time.