Bug 2417646

Summary: util-linux: FTBFS in Fedora Rawhide
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: kzak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
URL: https://koschei.fedoraproject.org/package/util-linux
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-12-02 16:04:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2384424    

Description Mamoru TASAKA 2025-11-28 03:41:22 UTC
Description of problem:
Package util-linux fails to build from source in Fedora Rawhide.

Version-Release number of selected component (if applicable):
2.41.2-7.fc44

Steps to Reproduce:
koji build --scratch f44 util-linux-2.41.2-7.fc44.src.rpm

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/util-linux

Reproducible: Always

Steps to Reproduce:
1. Rebuild util-linux-2.41.2-7.fc44 with recent glibc-2.42.9000-13.fc44
2.
3.


Actual Results:
gcc -DHAVE_CONFIG_H -I.  -include config.h -I./include -DLOCALEDIR=\"/usr/share/locale\" -D_PATH_RUNSTATEDIR=\"/run\" -D_PATH_LOCALSTATEDIR=\"/var\" -D_PATH_SYSCONFSTATICDIR=\"/usr/lib\"     -fsigned-char -fno-common -Wall -Wextra -Waddress-of-packed-member -Wdiscarded-qualifiers -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-missing-field-initializers -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wsign-compare -Wstrict-prototypes -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wvla -Walloca -Werror=sequence-point -I./libsmartcols/src -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -c -o lsfd-cmd/lsfd-lsfd.o `test -f 'lsfd-cmd/lsfd.c' || echo './'`lsfd-cmd/lsfd.c
lsfd-cmd/lsfd.c: In function ‘mark_poll_fds_as_multiplexed’:
lsfd-cmd/lsfd.c:1840:75: error: macro ‘bsearch’ passed 6 arguments, but takes just 5
 1840 |                                     nfds, sizeof(struct pollfd), pollfdcmp))
      |                                                                           ^
In file included from ./include/c.h:16,
                 from lsfd-cmd/lsfd.c:48:
/usr/include/stdlib.h:987:10: note: macro ‘bsearch’ defined here
  987 | # define bsearch(KEY, BASE, NMEMB, SIZE, COMPAR)                        \
      |          ^~~~~~~
lsfd-cmd/lsfd.c:1839:29: warning: the address of ‘bsearch’ will always evaluate as ‘true’ [-Waddress]
 1839 |                         if (bsearch(&(struct pollfd){.fd = fd,}, local.iov_base,
      |                             ^~~~~~~
lsfd-cmd/lsfd.c:1838:29: warning: unused variable ‘fd’ [-Wunused-variable]
 1838 |                         int fd = file->association;
      |                             ^~
lsfd-cmd/lsfd.c: In function ‘new_counter_spec’:
lsfd-cmd/lsfd.c:2295:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2295 |         sep = strchr(spec_str, ':');
      |             ^
make[2]: *** [Makefile:14011: lsfd-cmd/lsfd-lsfd.o] Error 1


Additional Information:
Perhaps due to this change:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cd748a63ab1a7ae846175c532a3daab341c62690

Now bsearch is defined as macro, and the util-linux source:

   1839                         if (bsearch(&(struct pollfd){.fd = fd,}, local.iov_base,
   1840                                     nfds, sizeof(struct pollfd), pollfdcmp))
   1841                                 file->multiplexed = 1;

is now parhaps recognized as calling macro with 6 parameters due to comma...

Comment 1 Mamoru TASAKA 2025-11-28 08:16:52 UTC
Perhaps you are already aware of this issue:

https://github.com/util-linux/util-linux/pull/3867

Comment 2 Karel Zak 2025-12-02 12:07:29 UTC
There are more things necessary for gcc-15: https://github.com/util-linux/util-linux/pull/3880

Comment 3 Karel Zak 2025-12-02 16:04:42 UTC
Should be fixed in util-linux >= 2.41.2-8.

Thanks for your report.