Skip to content

treewide: homogenize references to libfts for MUSL#29799

Merged
pprindeville merged 2 commits into
openwrt:masterfrom
pprindeville:fts-scrub
Jul 6, 2026
Merged

treewide: homogenize references to libfts for MUSL#29799
pprindeville merged 2 commits into
openwrt:masterfrom
pprindeville:fts-scrub

Conversation

@pprindeville

@pprindeville pprindeville commented Jun 21, 2026

Copy link
Copy Markdown
Member

📦 Package Details

Maintainer: @tpetazzoni, @flyn-org, @dangowrt, @BKPepe, @neheb, @nmeyerhans

Description:
The way we use -lfts isn't particularly consistent. There's no reason it shouldn't be. glibc users shouldn't have to deal with someone else's lack of rigor.


🧪 Run Testing Details

  • OpenWrt Version: SNAPSHOT
  • OpenWrt Target/Subtarget: mediatek/filogic
  • OpenWrt Device: banana-bpi-r4-pro-8x

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@neheb

neheb commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

I assume this was tested on glibc?

@pprindeville

Copy link
Copy Markdown
Member Author

I assume this was tested on glibc?

Do we have a CI/CD target build for glibc, like x86/64?

@neheb

neheb commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

No. That’s why I asked

@pprindeville

Copy link
Copy Markdown
Member Author

No. That’s why I asked

Okay, doing a build now on x86/64 generic and glibc.

@pprindeville pprindeville force-pushed the fts-scrub branch 2 times, most recently from d45a8f3 to 0c5f9a6 Compare June 22, 2026 00:04
@pprindeville

pprindeville commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Hmm... libxcrypt doesn't want to build with glibc. But it's required for python-selinux.

Build errors
make[2]: Entering directory '/home/philipp/projects/openwrt2/package/libs/xcrypt/libxcrypt'
touch /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/.prepared_87aac7869cc1df5e1e0700d6a8f6f585_6664517399ebbbc92a37c5bb081b5c53_check
. /home/philipp/projects/openwrt2/include/shell.sh; xzcat /home/philipp/projects/openwrt2/dl/libxcrypt-4.4.38.tar.xz | tar -C /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/.. -xf -
find /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38 -mindepth 1 -type f -not -name '.*' -not -name 'version.date' -printf '%T@\n' 2>/dev/null | cut -d. -f1 | sort -n | tail -n1 > /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/version.date
[ ! -d ./src/ ] || cp -fpR ./src/. /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38
touch /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/.prepared_87aac7869cc1df5e1e0700d6a8f6f585_6664517399ebbbc92a37c5bb081b5c53
rm -f /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/.configured_*
rm -f /home/philipp/projects/openwrt2/staging_dir/target-x86_64_glibc/stamp/.libxcrypt_installed
(cd /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/./; if [ -x ./configure ]; then find /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/ -name config.guess | xargs -r chmod u+w; find /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/ -name config.guess | xargs -r -n1 cp --remove-destination /home/philipp/projects/openwrt2/scripts/config.guess; find /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/ -name config.sub | xargs -r chmod u+w; find /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/ -name config.sub | xargs -r -n1 cp --remove-destination /home/philipp/projects/openwrt2/scripts/config.sub; AR="x86_64-openwrt-linux-gnu-gcc-ar" AS="x86_64-openwrt-linux-gnu-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38=libxcrypt-4.4.38 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wl,-z,pack-relative-relocs" LD="x86_64-openwrt-linux-gnu-ld.bfd" NM="x86_64-openwrt-linux-gnu-gcc-nm" CC="x86_64-openwrt-linux-gnu-gcc" GCC="x86_64-openwrt-linux-gnu-gcc" CXX="x86_64-openwrt-linux-gnu-g++" RANLIB="x86_64-openwrt-linux-gnu-gcc-ranlib" STRIP=x86_64-openwrt-linux-gnu-strip OBJCOPY=x86_64-openwrt-linux-gnu-objcopy OBJDUMP=x86_64-openwrt-linux-gnu-objdump SIZE=x86_64-openwrt-linux-gnu-size CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38=libxcrypt-4.4.38 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wl,-z,pack-relative-relocs " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38=libxcrypt-4.4.38 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wl,-z,pack-relative-relocs " CPPFLAGS="-I/home/philipp/projects/openwrt2/staging_dir/toolchain-x86_64_gcc-14.3.0_glibc/usr/include -I/home/philipp/projects/openwrt2/staging_dir/toolchain-x86_64_gcc-14.3.0_glibc/include " LDFLAGS="-L/home/philipp/projects/openwrt2/staging_dir/toolchain-x86_64_gcc-14.3.0_glibc/usr/lib -L/home/philipp/projects/openwrt2/staging_dir/toolchain-x86_64_gcc-14.3.0_glibc/lib -fuse-ld=bfd -zmax-page-size=4096 -znow -zrelro -zpack-relative-relocs "   ./configure --target=x86_64-openwrt-linux --host=x86_64-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info   --with-pic --enable-year2038 --disable-xcrypt-compat-files --disable-shared --disable-failure-tokens --disable-obsolete-api --enable-hashes=solaris ; fi; )
configure: loading site script /home/philipp/projects/openwrt2/include/site/x86_64
checking for a BSD-compatible install... /home/philipp/projects/openwrt2/staging_dir/host/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-openwrt-linux-strip... x86_64-openwrt-linux-gnu-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking pkg-config is at least version 0.27... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-openwrt-linux-gnu
checking for x86_64-openwrt-linux-gcc... x86_64-openwrt-linux-gnu-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 x86_64-openwrt-linux-gnu-gcc accepts -g... yes
checking for x86_64-openwrt-linux-gnu-gcc option to enable C11 features... none needed
checking whether x86_64-openwrt-linux-gnu-gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of x86_64-openwrt-linux-gnu-gcc... none
checking how to run the C preprocessor... x86_64-openwrt-linux-gnu-gcc -E
checking whether make sets $(MAKE)... (cached) yes
checking whether ln -s works... yes
checking for perl... /home/philipp/projects/openwrt2/staging_dir/host/bin/perl
checking whether /home/philipp/projects/openwrt2/staging_dir/host/bin/perl is version 5.14.0 or later... yes
checking for gpg2... /usr/bin/gpg2
checking for sha256sum... /usr/bin/sha256sum
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for fcntl.h... yes
checking for stdbool.h... yes
checking for ucontext.h... yes
checking for sys/cdefs.h... yes
checking for sys/random.h... yes
checking for sys/syscall.h... yes
checking for valgrind/valgrind.h... no
checking for endian.h... yes
checking for sys/endian.h... no
checking for sys/param.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for x86_64-openwrt-linux-gnu-gcc option to enable large file support... none needed
checking for x86_64-openwrt-linux-gnu-gcc option for timestamps after 2038... none needed
checking whether C compiler accepts -Werror=unknown-warning-option... no
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -Wextra... yes
checking whether C compiler accepts -Walloc-zero... yes
checking whether C compiler accepts -Walloca... yes
checking whether C compiler accepts -Wbad-function-cast... yes
checking whether C compiler accepts -Wcast-align... yes
checking whether C compiler accepts -Wcast-qual... yes
checking whether C compiler accepts -Wconversion... yes
checking whether C compiler accepts -Wformat=2... yes
checking whether C compiler accepts -Wformat-overflow=2... yes
checking whether C compiler accepts -Wformat-signedness... yes
checking whether C compiler accepts -Wformat-truncation=1... yes
checking whether C compiler accepts -Wlogical-op... yes
checking whether C compiler accepts -Wmissing-declarations... yes
checking whether C compiler accepts -Wmissing-prototypes... yes
checking whether C compiler accepts -Wnested-externs... yes
checking whether C compiler accepts -Wnull-dereference... yes
checking whether C compiler accepts -Wold-style-definition... yes
checking whether C compiler accepts -Wpointer-arith... yes
checking whether C compiler accepts -Wrestrict... yes
checking whether C compiler accepts -Wshadow... yes
checking whether C compiler accepts -Wstrict-overflow=2... yes
checking whether C compiler accepts -Wstrict-prototypes... yes
checking whether C compiler accepts -Wundef... yes
checking whether C compiler accepts -Wvla... yes
checking whether C compiler accepts -Wwrite-strings... yes
checking whether C compiler accepts -Wpedantic... yes
checking whether C compiler accepts -Werror... yes
checking whether C compiler accepts -Werror=unknown-warning-option... no
checking whether C compiler accepts -Wall... no
checking whether C compiler accepts -Wextra... no
checking whether C compiler accepts -Walloc-zero... no
checking whether C compiler accepts -Walloca... no
checking whether C compiler accepts -Wbad-function-cast... no
checking whether C compiler accepts -Wcast-align... no
checking whether C compiler accepts -Wcast-qual... no
checking whether C compiler accepts -Wconversion... no
checking whether C compiler accepts -Wformat=2... no
checking whether C compiler accepts -Wformat-overflow=2... no
checking whether C compiler accepts -Wformat-signedness... no
checking whether C compiler accepts -Wformat-truncation=1... no
checking whether C compiler accepts -Wlogical-op... no
checking whether C compiler accepts -Wmissing-declarations... no
checking whether C compiler accepts -Wmissing-prototypes... no
checking whether C compiler accepts -Wnested-externs... no
checking whether C compiler accepts -Wnull-dereference... no
checking whether C compiler accepts -Wold-style-definition... no
checking whether C compiler accepts -Wpointer-arith... no
checking whether C compiler accepts -Wrestrict... no
checking whether C compiler accepts -Wshadow... no
checking whether C compiler accepts -Wstrict-overflow=2... no
checking whether C compiler accepts -Wstrict-prototypes... no
checking whether C compiler accepts -Wundef... no
checking whether C compiler accepts -Wvla... no
checking whether C compiler accepts -Wwrite-strings... no
checking whether C compiler accepts -Wpedantic... no
checking whether C compiler accepts -Werror... no
checking how to print strings... printf
checking for a sed that does not truncate output... /home/philipp/projects/openwrt2/staging_dir/host/bin/sed
checking for grep that handles long lines and -e... /home/philipp/projects/openwrt2/staging_dir/host/bin/grep
checking for egrep... /home/philipp/projects/openwrt2/staging_dir/host/bin/grep -E
checking for fgrep... /home/philipp/projects/openwrt2/staging_dir/host/bin/grep -F
checking for ld used by x86_64-openwrt-linux-gnu-gcc... x86_64-openwrt-linux-gnu-ld.bfd
checking if the linker (x86_64-openwrt-linux-gnu-ld.bfd) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... x86_64-openwrt-linux-gnu-gcc-nm
checking the name lister (x86_64-openwrt-linux-gnu-gcc-nm) interface... BSD nm
checking the maximum length of command line arguments... 32768
checking how to convert x86_64-pc-linux-gnu file names to x86_64-openwrt-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for x86_64-openwrt-linux-gnu-ld.bfd option to reload object files... -r
checking for x86_64-openwrt-linux-file... no
checking for file... file
configure: WARNING: using cross tools not prefixed with host triplet
checking for x86_64-openwrt-linux-objdump... x86_64-openwrt-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-openwrt-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-openwrt-linux-ar... x86_64-openwrt-linux-gnu-gcc-ar
checking for archiver @FILE support... @
checking for x86_64-openwrt-linux-strip... (cached) x86_64-openwrt-linux-gnu-strip
checking for x86_64-openwrt-linux-ranlib... x86_64-openwrt-linux-gnu-gcc-ranlib
checking command to parse x86_64-openwrt-linux-gnu-gcc-nm output from x86_64-openwrt-linux-gnu-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for x86_64-openwrt-linux-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for valgrind... /usr/bin/valgrind
checking for Valgrind tool memcheck... yes
checking for Python 3.>=6 with Passlib... not found
configure: Disabling the "regen-ka-table" target, missing Python requirements.
checking whether all ucontext.h functions are available... yes
Can't locate open.pm in @INC (you may need to install the open module) (@INC entries checked: /usr/local/lib64/perl5/5.40 /usr/local/share/perl5/5.40 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./build-aux/scripts/expand-selected-hashes line 20.
BEGIN failed--compilation aborted at ./build-aux/scripts/expand-selected-hashes line 20.
configure: error: bad value 'solaris' for --enable-hashes
make[2]: *** [Makefile:55: /home/philipp/projects/openwrt2/build_dir/target-x86_64_glibc/libxcrypt-4.4.38/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1
make[2]: Leaving directory '/home/philipp/projects/openwrt2/package/libs/xcrypt/libxcrypt'
time: package/libs/xcrypt/libxcrypt/compile#3.62#2.41#5.69
    ERROR: package/libs/xcrypt/libxcrypt failed to build.
make[1]: *** [package/Makefile:198: package/libs/xcrypt/libxcrypt/compile] Error 1
make[1]: Leaving directory '/home/philipp/projects/openwrt2'
make: *** [/home/philipp/projects/openwrt2/include/toplevel.mk:233: package/libxcrypt/compile] Error 2

Not using the hostpkg Perl for some reason. Might be because there would be a circular dependency since perl uses libcrypt-compat.

@pprindeville

Copy link
Copy Markdown
Member Author

Opened separate issue openwrt/openwrt#23909 for libxcrypt issue.

@pprindeville

Copy link
Copy Markdown
Member Author

I assume this was tested on glibc?

This was a heavy lift, btw.

@pprindeville

Copy link
Copy Markdown
Member Author

Requires openwrt/openwrt#23919.

@pprindeville

Copy link
Copy Markdown
Member Author

@neheb Stuck in limbo until the upstream fix in openwrt/ gets merged...

@neheb

neheb commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

I don’t have merge access anywhere. Not sure what’s being asked of me.

@pprindeville

Copy link
Copy Markdown
Member Author

I don’t have merge access anywhere. Not sure what’s being asked of me.

I can merge it once libxcrypt builds, which I can't merge.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes how packages in this feed link against libfts when building on musl, replacing ad-hoc/patch-based approaches with a consistent TARGET_LDFLAGS += $(if $(CONFIG_USE_MUSL),-lfts) pattern (and adding the musl-fts dependency where needed).

Changes:

  • Replace package-specific musl -lfts handling with a consistent TARGET_LDFLAGS conditional across several packages.
  • Remove the nnn musl fts patch in favor of build-system linker flags.
  • Add/align +USE_MUSL:musl-fts dependency where required (e.g., python-selinux), and fix a small typo in tcpreplay’s description.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/nnn/patches/musl-fts.patch Removes a patch that injected -lfts into upstream LDLIBS, shifting responsibility to OpenWrt build flags.
utils/nnn/Makefile Bumps release and adds musl-conditional -lfts via TARGET_LDFLAGS.
utils/exfatprogs/Makefile Bumps release and adds musl-conditional -lfts via TARGET_LDFLAGS.
net/tcpreplay/Makefile Bumps release, fixes “briding” typo, and standardizes musl -lfts handling via TARGET_LDFLAGS.
net/nfdump/Makefile Bumps release and adjusts musl -lfts handling (but also drops --as-needed).
lang/python/python-selinux/Makefile Bumps release and adds musl-fts dependency for musl builds.
admin/fluent-bit/Makefile Bumps release and gates -lfts on musl while preserving -latomic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/nfdump/Makefile
endef

TARGET_LDFLAGS += -Wl,--as-needed $(if $(CONFIG_USE_MUSL),-lfts)
TARGET_LDFLAGS += $(if $(CONFIG_USE_MUSL),-lfts)
Getting segfault because stack size is inadequate.

Fixes: openwrt#29777
Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
@pprindeville

Copy link
Copy Markdown
Member Author

@dhrm1k: Integrated the CI/CD fix. Thanks

@pprindeville

Copy link
Copy Markdown
Member Author

@dhrm1k: Integrated the CI/CD fix. Thanks

Still failing, however. Hell and damnation.

The way we use -lfts isn't particularly consistent.  There's no reason
it shouldn't be.  glibc users shouldn't have to deal with someone else's
lack of rigor.

Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
@pprindeville

pprindeville commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@dhrm1k @commodo: different platforms are failing differently, sometimes not even in the packages that are being modified. This points to general instability in the CI/CD tests or the test environment.

Further, all of the failing platforms are in tcpreplay which, in a cloud environment, would be sandboxed anyway because of the potential for mischief. I'm not convinced this is a legitimate failure. I think the environment is protecting itself which it should do.

@pprindeville pprindeville merged commit c08761b into openwrt:master Jul 6, 2026
11 of 14 checks passed
@pprindeville pprindeville deleted the fts-scrub branch July 6, 2026 04:46
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

Successfully merging this pull request may close these issues.

4 participants