Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926277 - sys-apps/systemd-utils fails to compile with sys-libs/musl-1.2.5 - error: implicit declaration of function ‘basename’ [-Werror=implicit-function-declaration]
Summary: sys-apps/systemd-utils fails to compile with sys-libs/musl-1.2.5 - error: imp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-1.2.5
  Show dependency tree
 
Reported: 2024-03-06 18:45 UTC by immolo
Modified: 2024-04-16 00:52 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (systemd-utils.build.log,448.83 KB, text/x-log)
2024-03-06 18:45 UTC, immolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description immolo 2024-03-06 18:45:52 UTC
Created attachment 886826 [details]
build log

This was found in a crossdev build for testing Gentoo support on rv32 but this isn't related to the error just in case someone wonders.

To reproduce:

1. add "=sys-libs/musl-1.2.5 **" to package.accept_keywords
2. Set system to ~ARCH
3. emerge -va1 sys-libs/musl
4. emerge -va1 sys-apps/systemd-utils

Error:

riscv32-unknown-linux-musl-gcc -Isrc/basic/libbasic.a.p -Isrc/basic -I../systemd-stable-254.10/src/basic -Isrc/fundamental -I../systemd-stable-254.10/src/fundamental -Isrc/systemd -I../systemd-stable-254.10/src/systemd -I. -I../systemd-stable-254.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -Werror=shadow -O2 -pipe -fomit-frame-pointer -D__UAPI_DEF_ETHHDR=0 -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -fno-omit-frame-pointer -include config.h -pthread -fvisibility=default -MD -MQ src/basic/libbasic.a.p/unit-file.c.o -MF src/basic/libbasic.a.p/unit-file.c.o.d -o src/basic/libbasic.a.p/unit-file.c.o -c ../systemd-stable-254.10/src/basic/unit-file.c
../systemd-stable-254.10/src/basic/unit-file.c: In function ‘unit_file_build_name_map’:
../systemd-stable-254.10/src/basic/unit-file.c:599:23: error: implicit declaration of function ‘basename’ [-Werror=implicit-function-declaration]
  599 |                 dst = basename(dst);
      |                       ^~~~~~~~
../systemd-stable-254.10/src/basic/unit-file.c:599:23: warning: nested extern declaration of ‘basename’ [-Wnested-externs]
../systemd-stable-254.10/src/basic/unit-file.c:599:21: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
  599 |                 dst = basename(dst);
      |                     ^
In file included from ../systemd-stable-254.10/src/basic/string-util.h:10,
                 from ../systemd-stable-254.10/src/basic/siphash24.h:10,
                 from ../systemd-stable-254.10/src/basic/stat-util.h:14,
                 from ../systemd-stable-254.10/src/basic/chase.h:7,
                 from ../systemd-stable-254.10/src/basic/unit-file.c:5:
../systemd-stable-254.10/src/basic/unit-file.c: In function ‘add_names’:
../systemd-stable-254.10/src/basic/unit-file.c:702:36: error: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast [-Werror=int-conversion]
  702 |                             !streq(basename(inst_fragment), fragment_basename)) {
../systemd-stable-254.10/src/fundamental/string-util-fundamental.h:26:29: note: in definition of macro ‘streq’
   26 | #define streq(a,b) (strcmp((a),(b)) == 0)
      |                             ^
In file included from ../systemd-stable-254.10/src/systemd/sd-id128.h:22,
                 from ../systemd-stable-254.10/src/basic/unit-file.c:3:
/usr/riscv32-unknown-linux-musl/usr/include/string.h:39:13: note: expected ‘const char *’ but argument is of type ‘int’
   39 | int strcmp (const char *, const char *);
      |             ^~~~~~~~~~~~
cc1: some warnings being treated as errors
Comment 2 immolo 2024-03-07 12:51:05 UTC
Confirmed patch works here.
Comment 3 Larry the Git Cow gentoo-dev 2024-04-16 00:52:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c94b25236d2f7cdffc52afcf8be531b417498cba

commit c94b25236d2f7cdffc52afcf8be531b417498cba
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-04-16 00:51:59 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-04-16 00:52:18 +0000

    sys-apps/systemd-utils: add basename fix
    
    Closes: https://bugs.gentoo.org/926277
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd-utils/Manifest                       | 2 +-
 sys-apps/systemd-utils/systemd-utils-254.10-r1.ebuild | 2 +-
 sys-apps/systemd-utils/systemd-utils-254.8-r1.ebuild  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)