chcon: link to libfts on musl targets
This fixes a build failure on aarch64-unknown-linux-musl.
On musl‐based targets the fts API is not provided by libc but by a separate libfts library.
src/uu/chcon/build.rs
Add a build script (build.rs) that detects when CARGO_CFG_TARGET_OS=linux && CARGO_CFG_TARGET_ENV=musl and emits rustc-link-lib=fts, so that uu_chcon can link successfully.
src/uu/chcon/src/fts.rs
In the glibc version of the header, level is short, under musl it's int; likewise, pathlen is unsigned on musl but signed on glibc.
Note
To test this, I build as: RUSTFLAGS='-Ctarget-feature=-crt-static' make in Alpine Linux.
GNU testsuite comparison:
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
i am not sure creating a build.rs is necessary
How else would you conditionally link the -lfts library?