Skip to content

Commit

Permalink
glibc: include ld.so.conf.d/* to build ld cache
Browse files Browse the repository at this point in the history
This commit adds a configuration file for ldconfig to read additional
configurations from /etc/ld.so.conf, which will be created at runtime by
the tmpfilesd daemon.

There are packages that create `ldconfig.d/*.conf` files using a
tmpfilesd file to cache additional libraries, thus `ldconfig.service`
has to run after the tmpfilesd daemon creates the files.

Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
  • Loading branch information
arnaldo2792 committed Dec 10, 2021
1 parent 998e642 commit 27e43df
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/glibc/glibc-tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
f /etc/ld.so.conf 0644 root root -
C /etc/ld.so.conf 0644 root root -
f /etc/ld.so.cache 0644 root root -
d /etc/ld.so.conf.d/ 0644 root root -
d /run/cache/ldconfig 0700 root root -
f /run/cache/ldconfig/aux-cache 0600 root root -
14 changes: 13 additions & 1 deletion packages/glibc/glibc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ License: LGPL-2.1-or-later AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND GP
URL: http://www.gnu.org/software/glibc/
Source0: https://ftp.gnu.org/gnu/glibc/glibc-%{version}.tar.xz
Source1: glibc-tmpfiles.conf
Source2: ld.so.conf
Source3: ldconfig-service.conf

# Upstream patches from 2.34 release branch:
# ```
Expand Down Expand Up @@ -93,9 +95,13 @@ make %{?_smp_mflags} -O -r
%install
make -j1 install_root=%{buildroot} install -C build

mkdir -p %{buildroot}%{_cross_tmpfilesdir}
install -d %{buildroot}%{_cross_tmpfilesdir}
install -d %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}
install -d %{buildroot}%{_cross_unitdir}/ldconfig.service.d

install -p -m 0644 %{S:1} %{buildroot}%{_cross_tmpfilesdir}/glibc.conf
install -p -m 0644 %{S:2} %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}/ld.so.conf
install -p -m 0644 %{S:3} %{buildroot}%{_cross_unitdir}/ldconfig.service.d/ldconfig.conf

truncate -s 0 %{buildroot}%{_cross_libdir}/gconv/gconv-modules
chmod 644 %{buildroot}%{_cross_libdir}/gconv/gconv-modules
Expand Down Expand Up @@ -177,6 +183,12 @@ chmod 644 %{buildroot}%{_cross_datadir}/locale/locale.alias
%exclude %{_cross_datadir}/locale/*
%exclude %{_cross_localstatedir}/db/Makefile

%dir %{_cross_factorydir}
%{_cross_factorydir}%{_cross_sysconfdir}/ld.so.conf

%dir %{_cross_unitdir}/ldconfig.service.d
%{_cross_libdir}/systemd/system/ldconfig.service.d/ldconfig.conf

%files devel
%{_cross_libdir}/*.a
%{_cross_libdir}/*.o
Expand Down
1 change: 1 addition & 0 deletions packages/glibc/ld.so.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ld.so.conf.d/*.conf
4 changes: 4 additions & 0 deletions packages/glibc/ldconfig-service.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Unit]
# Run `ldconfig.service` after `tmpfilesd`, since `ldconfig` will attempt to
# read files from `/etc/ld.so.conf.d`, which are created by `tmpfilesd`
After=systemd-tmpfiles-setup.service

0 comments on commit 27e43df

Please sign in to comment.