Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926339 - sys-auth/elogind-252.9 - ../elogind-252.9/src/login/logind-session.c:78:17: error: call to undeclared function 'basename'
Summary: sys-auth/elogind-252.9 - ../elogind-252.9/src/login/logind-session.c:78:17: e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Andreas Sturmlechner
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-1.2.5
  Show dependency tree
 
Reported: 2024-03-07 09:47 UTC by ernsteiswuerfel
Modified: 2024-08-26 12:59 UTC (History)
2 users (show)

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


Attachments
build.log (elogind-252.9:20240307-094300.log,58.94 KB, text/plain)
2024-03-07 09:47 UTC, ernsteiswuerfel
Details
emerge --info (file_926339.txt,7.42 KB, text/plain)
2024-03-07 09:48 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2024-03-07 09:47:56 UTC
Created attachment 886889 [details]
build.log

[...]
ninja: job failed: clang -Isrc/login/liblogind-core.a.p -Isrc/login -I../elogind-252.9/src/login -Isrc/basic -I../elogind-252.9/src/basic -Isrc/fundamental -I../elogind-252.9/src/fundamental -Isrc/core -I../elogind-252.9/src/core -Isrc/systemd -I../elogind-252.9/src/systemd -I. -I../elogind-252.9 -I../elogind-252.9/src/libelogind/sd-bus -I../elogind-252.9/src/libelogind/sd-device -I../elogind-252.9/src/libelogind/sd-event -I../elogind-252.9/src/libelogind/sd-hwdb -I../elogind-252.9/src/libelogind/sd-id128 -I../elogind-252.9/src/libelogind/sd-journal -Isrc/sleep -I../elogind-252.9/src/sleep -Isrc/update-utmp -I../elogind-252.9/src/update-utmp -Isrc/shared -I../elogind-252.9/src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O3 -Wno-missing-field-initializers -Wno-unused-parameter -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=undef -Wfloat-equal -Winit-self -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wunused-function -Wwrite-strings '-Wno-error=#warnings' -Wno-string-plus-int -Wno-typedef-redefinition -Wno-gnu-variable-sized-type-not-at-end -ftrivial-auto-var-init=zero -Werror=missing-declarations -Werror=missing-prototypes -fdiagnostics-show-option -fno-common -fno-strict-aliasing -fstack-protector -fstack-protector-strong -fvisibility=hidden --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -Os -march=x86-64-v2 -pipe -fPIC -MD -MQ src/login/liblogind-core.a.p/logind-session.c.o -MF src/login/liblogind-core.a.p/logind-session.c.o.d -o src/login/liblogind-core.a.p/logind-session.c.o -c ../elogind-252.9/src/login/logind-session.c
../elogind-252.9/src/login/logind-session.c:78:17: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   78 |         s->id = basename(s->state_file);
      |                 ^
../elogind-252.9/src/login/logind-session.c:78:15: error: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion]
   78 |         s->id = basename(s->state_file);
      |               ^ ~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
ninja: subcommand failed
Comment 1 ernsteiswuerfel archtester 2024-03-07 09:48:36 UTC
Created attachment 886890 [details]
emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-08 00:22:55 UTC
There's https://github.com/elogind/elogind/pull/271 but I don't think the patch is right.

Probably better to use the one from bug 926277.
Comment 3 ernsteiswuerfel archtester 2024-03-08 17:19:02 UTC
(In reply to Sam James from comment #2)
> There's https://github.com/elogind/elogind/pull/271 but I don't think the
> patch is right.
> 
> Probably better to use the one from bug 926277.

Both patches seem to fix the basename problem. Though in the upstream fix the file to patch 'musl_missing.h' is in src/basic/, not in src/shared/ like in Gentoos repository.

However in both cases I run into another error later on on my musl/clang partition:

[...]
ninja: job failed: clang -Isrc/shared/libelogind-shared-246.10.a.p -Isrc/shared -I../elogind-246.10/src/shared -Isrc/basic -I../elogind-246.10/src/basic -I../elogind-246.10/src/boot -Isrc/systemd -I../elogind-246.10/src/systemd -Isrc/journal -I../elogind-246.10/src/journal -Isrc/login -I../elogind-246.10/src/login -Isrc/core -I../elogind-246.10/src/core -I../elogind-246.10/src/libelogind/sd-bus -I../elogind-246.10/src/libelogind/sd-device -I../elogind-246.10/src/libelogind/sd-event -I../elogind-246.10/src/libelogind/sd-hwdb -I../elogind-246.10/src/libelogind/sd-id128 -Isrc/sleep -I../elogind-246.10/src/sleep -Isrc/update-utmp -I../elogind-246.10/src/update-utmp -I. -I../elogind-246.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=undef -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Wdate-time -Wnested-externs '-Wno-error=#warnings' -Wno-string-plus-int -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-typedef-redefinition -Wno-gnu-variable-sized-type-not-at-end -ffunction-sections -fdata-sections -Werror=shadow -include config.h -Os -march=x86-64-v2 -pipe -fPIC -pthread -fvisibility=default -MD -MQ src/shared/libelogind-shared-246.10.a.p/bootspec.c.o -MF src/shared/libelogind-shared-246.10.a.p/bootspec.c.o.d -o src/shared/libelogind-shared-246.10.a.p/bootspec.c.o -c ../elogind-246.10/src/shared/bootspec.c
../elogind-246.10/src/shared/bootspec.c:76:11: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
   76 |         b = basename(path);
      |           ^ ~~~~~~~~~~~~~~
../elogind-246.10/src/shared/bootspec.c:323:11: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  323 |         b = basename(path);
      |           ^ ~~~~~~~~~~~~~~
2 errors generated.
ninja: subcommand failed
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2024-04-25 14:42:59 UTC
This is fixed in upstream 255.4 and later
Comment 5 Larry the Git Cow gentoo-dev 2024-04-30 16:05:03 UTC
The bug has been closed via the following commit(s):

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

commit 3ec790f045ef0297403d66c7acfdfb6d351cbd10
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2024-04-30 16:02:20 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2024-04-30 16:04:29 +0000

    sys-auth/elogind: Backport musl-1.2.5 (basename) build fix
    
    Closes: https://bugs.gentoo.org/926339
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 sys-auth/elogind/elogind-252.9.ebuild              |  1 +
 .../elogind/files/elogind-252.9-musl-1.2.5.patch   | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)