Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877259 - sys-apps/systemd-utils-251.6 - fails to build on llvm
Summary: sys-apps/systemd-utils-251.6 - fails to build on llvm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo systemd Team
URL: https://github.com/systemd/systemd/is...
Whiteboard:
Keywords:
Depends on:
Blocks: compiler-rt-tracker
  Show dependency tree
 
Reported: 2022-10-15 21:29 UTC by Lunaa
Modified: 2022-11-06 00:26 UTC (History)
2 users (show)

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


Attachments
Patch to remove the check for libatomic (systemd-utils-251.6.patch,642 bytes, patch)
2022-10-15 21:29 UTC, Lunaa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lunaa 2022-10-15 21:29:51 UTC
Created attachment 824331 [details, diff]
Patch to remove the check for libatomic

When using clang with -rtlib=compiler-rt, systemd-utils-251.6 fails with the following error:

Checking if "Atomic builtin requires -latomic" : links: NO 
../systemd-stable-251.6/meson.build:1002:8: ERROR: C shared or static library 'atomic' not found
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-15 21:34:24 UTC
Simply patching out the check is not a sustainable fix, although thanks for providing a patch.

Could you provide the full build.log & emerge --info of it failing?

Caused by https://github.com/systemd/systemd-stable/commit/738eca5e05cf6494dc3f4126f6e33f03c7bac54d.
Comment 2 Lunaa 2022-10-15 21:57:46 UTC
* Package:    sys-apps/systemd-utils-251.6:0
 * Repository: gentoo
 * Maintainer: systemd@gentoo.org
 * USE:        abi_x86_64 acl amd64 elibc_musl kernel_linux kmod split-usr tmpfiles udev userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 * Checking whether python3_11 is suitable ...
 *   >=dev-lang/python-3.11.0_beta4:3.11 ...
 [ ok ]
 *   python_check_deps ...
 *     dev-python/jinja[python_targets_python3_11(-)] ...
 [ !! ]
 [ !! ]
 * Checking whether python3_10 is suitable ...
 *   >=dev-lang/python-3.10.4:3.10 ...
 [ ok ]
 *   python_check_deps ...
 *     dev-python/jinja[python_targets_python3_10(-)] ...
 [ ok ]
 [ ok ]
 * Using python3.10 to build (via PYTHON_COMPAT iteration)
>>> Unpacking source...
>>> Unpacking systemd-stable-251.6.tar.gz to /var/tmp/portage/sys-apps/systemd-utils-251.6/work
>>> Unpacking systemd-musl-patches-251.2.tar.gz to /var/tmp/portage/sys-apps/systemd-utils-251.6/work
>>> Source unpacked in /var/tmp/portage/sys-apps/systemd-utils-251.6/work
>>> Preparing source in /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6 ...
 * Applying 251-revert-fortify-source-3-fix.patch ...
 [ ok ]
 * Applying 251-gpt-auto-no-cryptsetup.patch ...
 [ ok ]
 * Applying patches from /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-musl-patches-251.2 ...
 *   0001-Adjust-for-musl-headers.patch ...
 [ ok ]
 *   0001-pass-correct-parameters-to-getdents64.patch ...
 [ ok ]
 *   0002-Add-sys-stat.h-for-S_IFDIR.patch ...
 [ ok ]
 *   0003-missing_type.h-add-comparison_fn_t.patch ...
 [ ok ]
 *   0004-add-fallback-parse_printf_format-implementation.patch ...
 [ ok ]
 *   0005-src-basic-missing.h-check-for-missing-strndupa.patch ...
 [ ok ]
 *   0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch ...
 [ ok ]
 *   0008-add-missing-FTW_-macros-for-musl.patch ...
 [ ok ]
 *   0010-Use-uintmax_t-for-handling-rlim_t.patch ...
 [ ok ]
 *   0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch ...
 [ ok ]
 *   0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch ...
 [ ok ]
 *   0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch ...
 [ ok ]
 *   0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch ...
 [ ok ]
 *   0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch ...
 [ ok ]
 *   0018-avoid-redefinition-of-prctl_mm_map-structure.patch ...
 [ ok ]
 *   0022-do-not-disable-buffer-in-writing-files.patch ...
 [ ok ]
 *   0025-Handle-__cpu_mask-usage.patch ...
 [ ok ]
 *   0026-Handle-missing-gshadow.patch ...
 [ ok ]
 *   0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
meson setup --libdir lib --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /var/tmp/portage/sys-apps/systemd-utils-251.6/temp/python3.10/pkgconfig:/usr/share/pkgconfig --pkg-config-path /var/tmp/portage/sys-apps/systemd-utils-251.6/temp/python3.10/pkgconfig:/usr/share/pkgconfig --native-file /var/tmp/portage/sys-apps/systemd-utils-251.6/temp/meson.x86_64-gentoo-linux-musl.amd64.ini -Db_pch=false -Dwerror=false --buildtype plain -Dsplit-usr=true -Dsplit-bin=true -Drootprefix=/ -Drootlibdir=/usr/lib -Dsysvinit-path= -Defi=false -Dgnu-efi=false -Dkernel-install=false -Dselinux=false -Dsysusers=false -Dtests=false -Dtmpfiles=true -Dhwdb=true -Defi-libdir=/usr/lib -Dlink-boot-shared=false -Dlink-udev-shared=false -Dstandalone-binaries=true -Dadm-group=false -Danalyze=false -Dapparmor=false -Daudit=false -Dbacklight=false -Dbinfmt=false -Dbzip2=false -Dcoredump=false -Ddbus=false -Delfutils=false -Denvironment-d=false -Dfdisk=false -Dgcrypt=false -Dglib=false -Dgshadow=false -Dgnutls=false -Dhibernate=false -Dhostnamed=false -Didn=false -Dima=false -Dinitrd=false -Dfirstboot=false -Dldconfig=false -Dlibcryptsetup=false -Dlibcurl=false -Dlibfido2=false -Dlibidn=false -Dlibidn2=false -Dlibiptc=false -Dlocaled=false -Dlogind=false -Dlz4=false -Dmachined=false -Dmicrohttpd=false -Dnetworkd=false -Dnscd=false -Dnss-myhostname=false -Dnss-resolve=false -Dnss-systemd=false -Doomd=false -Dopenssl=false -Dp11kit=false -Dpam=false -Dpcre2=false -Dpolkit=false -Dportabled=false -Dpstore=false -Dpwquality=false -Drandomseed=false -Dresolve=false -Drfkill=false -Dseccomp=false -Dsmack=false -Dsysext=false -Dtimedated=false -Dtimesyncd=false -Dtpm=false -Dqrencode=false -Dquotacheck=false -Duserdb=false -Dutmp=false -Dvconsole=false -Dwheel-group=false -Dxdg-autostart=false -Dxkbcommon=false -Dxz=false -Dzlib=false -Dzstd=false -Dacl=true -Dkmod=true /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6 /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6-abi_x86_64.amd64
The Meson build system
Version: 0.63.2
Source dir: /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6
Build dir: /var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6-abi_x86_64.amd64
Build type: native build
Project name: systemd
Project version: 251
C compiler for the host machine: clang (clang 15.0.2 "clang version 15.0.2")
C linker for the host machine: clang ld.lld 15.0.2
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program tools/add-git-hook.sh found: YES (/var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6/tools/add-git-hook.sh)
../systemd-stable-251.6/meson.build:82: WARNING: 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


                    split-usr mode is going to be removed


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Program tools/meson-build.sh found: YES (/var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6/tools/meson-build.sh)
C++ compiler for the host machine: clang++ (clang 15.0.2 "clang version 15.0.2")
C++ linker for the host machine: clang++ ld.lld 15.0.2
Compiler for C supports arguments -Wno-format-signedness: NO 
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
Compiler for C supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -Wdate-time: YES 
Compiler for C supports arguments -Wendif-labels: YES 
Compiler for C supports arguments -Werror=format=2: YES 
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES 
Compiler for C supports arguments -Werror=int-conversion: YES 
Compiler for C supports arguments -Werror=overflow: YES 
Compiler for C supports arguments -Werror=override-init: YES 
Compiler for C supports arguments -Werror=return-type: YES 
Compiler for C supports arguments -Werror=shift-count-overflow: YES 
Compiler for C supports arguments -Werror=shift-overflow=2: NO 
Compiler for C supports arguments -Werror=undef: YES 
Compiler for C supports arguments -Wfloat-equal: YES 
Compiler for C supports arguments -Wimplicit-fallthrough=5: NO 
Compiler for C supports arguments -Winit-self: YES 
Compiler for C supports arguments -Wlogical-op: NO 
Compiler for C supports arguments -Wmissing-include-dirs: YES 
Compiler for C supports arguments -Wmissing-noreturn: YES 
Compiler for C supports arguments -Wnested-externs: YES 
Compiler for C supports arguments -Wold-style-definition: YES 
Compiler for C supports arguments -Wpointer-arith: YES 
Compiler for C supports arguments -Wredundant-decls: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wstrict-aliasing=2: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C supports arguments -Wsuggest-attribute=noreturn: NO 
Compiler for C supports arguments -Wunused-function: YES 
Compiler for C supports arguments -Wwrite-strings: YES 
Compiler for C supports arguments -Wno-error=#warnings: YES 
Compiler for C supports arguments -Wno-string-plus-int: YES 
Compiler for C supports arguments -Wno-typedef-redefinition: YES 
Compiler for C supports arguments -Wno-gnu-variable-sized-type-not-at-end: YES 
Compiler for C supports arguments -Werror=missing-declarations: YES 
Compiler for C supports arguments -Werror=missing-prototypes: YES 
Compiler for C supports arguments -fdiagnostics-show-option: YES 
Compiler for C supports arguments -fno-common: YES 
Compiler for C supports arguments -fno-strict-aliasing: YES 
Compiler for C supports arguments -fstack-protector: YES 
Compiler for C supports arguments -fstack-protector-strong: YES 
Compiler for C supports arguments -fvisibility=hidden: YES 
Compiler for C supports arguments --param=ssp-buffer-size=4: YES 
Compiler for C supports arguments -ffunction-sections: YES 
Compiler for C supports arguments -fdata-sections: YES 
Compiler for C supports link arguments -Wl,--fatal-warnings: YES 
Compiler for C supports link arguments -Wl,-z,now: YES 
Compiler for C supports link arguments -Wl,-z,relro: YES 
Compiler for C supports link arguments -fstack-protector: YES 
Compiler for C supports link arguments -Wl,--warn-common: YES 
Compiler for C supports link arguments -Wl,--gc-sections: YES 
Compiler for C supports arguments -Wzero-length-bounds: NO 
Checking if "-Werror=shadow with local shadowing" compiles: YES 
Compiler for C++ supports arguments -Wno-format-signedness: NO 
Compiler for C++ supports arguments -Wno-missing-field-initializers: YES 
Compiler for C++ supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -Wstringop-truncation: NO 
Checking for size of "dev_t" : 8
Checking for size of "ino_t" : 8
Checking for size of "time_t" : 8
Checking for size of "rlim_t" : 8
Checking for size of "typeof(((struct timex *)0)->freq)" : 8
Checking for size of "char16_t" : 2
Checking for size of "char32_t" : 4
Checking for size of "struct mount_attr" : -1
Checking for size of "struct mount_attr" : 32
Checking for size of "struct statx" : -1
Checking for size of "struct statx" : 256
Checking for function "secure_getenv" : YES 
Checking for function "__secure_getenv" : NO 
Checking for function "strndupa" : NO 
Checking for function "memfd_create" : YES 
Checking for function "gettid" : YES 
Checking for function "pivot_root" : NO 
Checking for function "ioprio_get" : NO 
Checking for function "ioprio_set" : NO 
Checking for function "name_to_handle_at" : YES 
Checking for function "setns" : YES 
Checking for function "renameat2" : NO 
Checking for function "kcmp" : NO 
Checking for function "keyctl" : NO 
Checking for function "copy_file_range" : YES 
Checking for function "bpf" : NO 
Checking for function "statx" : NO 
Checking for function "explicit_bzero" : YES 
Checking for function "reallocarray" : YES 
Checking for function "set_mempolicy" : NO 
Checking for function "get_mempolicy" : NO 
Checking for function "pidfd_send_signal" : NO 
Checking for function "pidfd_open" : NO 
Checking for function "rt_sigqueueinfo" : NO 
Checking for function "mallinfo" : NO 
Checking for function "mallinfo2" : NO 
Checking for function "execveat" : NO 
Checking for function "close_range" : NO 
Checking for function "epoll_pwait2" : NO 
Checking for function "mount_setattr" : NO 
Checking for function "move_mount" : NO 
Checking for function "open_tree" : NO 
Checking for function "getdents64" : YES 
Checking for function "getrandom" : YES 
Program sh found: YES (/bin/sh)
Program echo found: YES (/bin/echo)
Program sed found: YES (/bin/sed)
Program awk found: YES (/usr/bin/awk)
Program stat found: YES (/usr/bin/stat)
Program ln found: YES (/bin/ln)
Program git found: YES (/usr/bin/git)
Program env found: YES (/usr/bin/env)
Program perl found: YES (/usr/bin/perl)
Program rsync found: YES (/usr/bin/rsync)
Program quotaon /usr/sbin/quotaon /sbin/quotaon found: NO
Program quotacheck /usr/sbin/quotacheck /sbin/quotacheck found: NO
Program kmod found: YES (/bin/kmod)
Program kexec /usr/sbin/kexec /sbin/kexec found: NO
Program sulogin found: YES (/sbin/sulogin)
Program mount found: YES (/bin/mount)
Program umount found: YES (/bin/umount)
Program loadkeys found: YES (/usr/bin/loadkeys)
Program setfont found: YES (/usr/bin/setfont)
Program nologin found: YES (/sbin/nologin)
Program python3 found: YES (/var/tmp/portage/sys-apps/systemd-utils-251.6/temp/python3.10/bin/python3)
Program gperf found: YES (/usr/bin/gperf)
Message: gperf len type is size_t
Has header "sys/capability.h" : YES 
Has header "crypt.h" : YES 
Has header "linux/memfd.h" : YES 
Has header "linux/vm_sockets.h" : YES 
Has header "printf.h" : NO 
Has header "sys/auxv.h" : YES 
Has header "valgrind/memcheck.h" : NO 
Has header "valgrind/valgrind.h" : NO 
Has header "linux/time_types.h" : YES 
Has header "sys/sdt.h" : NO 
Program tools/choose-default-locale.sh found: YES (/var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6/tools/choose-default-locale.sh)
Checking if "Atomic builtin requires -latomic" : links: NO 

../systemd-stable-251.6/meson.build:1002:8: ERROR: C shared or static library 'atomic' not found
Comment 3 Lunaa 2022-10-15 22:03:23 UTC
It checks for __atomic_exchange_1 which only compiles on gcc. The LLVM docs state that __atomic_exchange_1 is supported but somehow clang fails with this:

/var/tmp/portage/sys-apps/systemd-utils-251.6/work/systemd-stable-251.6-abi_x86_64.amd64/meson-private/tmp86noe6iv/testfile.c:4:22: error: call to undeclared function '__atomic_exchange_1'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                     __atomic_exchange_1(&i, 1, 0);
                     ^

changing __atomic_exchange_1 to __atomic_exchange_n does work tho
Comment 4 Matt Turner gentoo-dev 2022-10-19 00:23:29 UTC
Filed an issue upstream as https://github.com/systemd/systemd/issues/25057
Comment 5 Larry the Git Cow gentoo-dev 2022-10-25 05:53:35 UTC
The bug has been closed via the following commit(s):

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

commit bc10f4b653fab6f4775ebf3623ba1775b797f9c5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-25 05:46:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-25 05:51:11 +0000

    sys-apps/systemd-utils: add 251.7
    
    Closes: https://bugs.gentoo.org/877259
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/systemd-utils/Manifest                   |   1 +
 sys-apps/systemd-utils/systemd-utils-251.7.ebuild | 525 ++++++++++++++++++++++
 2 files changed, 526 insertions(+)

Additionally, it has been referenced in the following commit(s):

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

commit ed3d7f22755dd463a1398f7e6ed0273cb015ae85
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-25 05:45:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-25 05:51:10 +0000

    sys-apps/systemd: add 251.7
    
    Bug: https://bugs.gentoo.org/877259
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/systemd/Manifest             |   1 +
 sys-apps/systemd/systemd-251.7.ebuild | 530 ++++++++++++++++++++++++++++++++++
 2 files changed, 531 insertions(+)