Re: Systemd Multilib build success

"Eric Clothier" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <CAAGwWFU8=J6RYn8cGHqvswr9oEcbNCAU0bccQK0mQPqrQwaRdA@mail.gmail.com>
On Sun, Dec 22, 2024 at 11:07 PM Eric Clothier <[email protected]>
wrote:

> On Sun, Dec 22, 2024, 22:47 Thomas Trepl <
> [email protected]> wrote:
>
>> Am Sonntag, dem 22.12.2024 um 13:47 +0800 schrieb Xi Ruoyao:
>> > On Fri, 2024-12-20 at 16:24 +0100, Thomas Trepl wrote:
>> > > Am Dienstag, dem 17.12.2024 um 20:52 -0500 schrieb Eric Clothier:
>> > > > I wanted to report that I was able to successfully build MLFS using
>> > > > jhalfs with systemd init. I have NOT done any major testing of the
>> > > > build, but it does successfully build and boot. I did test an ml_32
>> > > > build only, as my host distro does not include the X32_ABI kernel
>> > > > flag, and I simply have not taken the time to build a kernel for my
>> > > > host distro from source.
>> >
>> > But I can see some obviously questionable things in the systemd
>> > instructions:
>> >
>> > - Why do we need a xsltproc symlink?  The build system should disable
>> > building man pages when xsltproc is not available.
>> > - The instruction seems installing "/usr/lib32/systemd/*" which are
>> > completely meaningless.  We only want libudev.so* and libsystemd.so*.
>> > - 'CFLAGS+=" -Wno-error=shift-overflow"' seems covering up a real bug,
>> > instead of covering up it you should really fix the bug and preferably
>> > send the fix upstream.
>> > - Why "-march=i686" for lib32?  We don't add it for all other packages.
>> >
>> > And maybe more.  The items above are just found in a quick one-minute
>> > review.
>> >
>> > Thus IMO it's broken.  If it happens to work for you, it just happens.
>> Obviously, its not that broken as users do use the instructions to build
>> their system successfully. Of course, the instructions might be buggy - in
>> this case, a patch or so is appreciated. As i said, i maintain the systemd
>> variant on a "best guess" basis. I'll be happy if someone sends me patches
>> if there is something to fix.
>> Maybe i should note that on the MLFS page, too.
>>
>> --
>> Thomas
>>
>
> Thomas, I have a patch that I am currently testing to update the systemd
> build instructions. Once I can verify the build completed and is bootable,
> I will send the patch. I addressed the issues Xi raised, aside from the
> CFLAGS/CXXFLAGS, as those are on the mx32 builds only and I haven't gotten
> to that point yet. I also updated the meson switches from -Dxxx to -D xxx
> style, and switched to meson setup invocation, to match the non-multilib
> instructions. And I removed some duplicated/deprecated switches as well.
>
> --
> Eric
>

Attached is the patch I mentioned in my last email. As I stated, it only
contains fixes for the m32 build, NOT for mx32, as I have not had the
chance to do an mx32 build yet. I can confirm that the build is successful
with this patch, and the system is bootable. I have NOT tested any linking
to the lib32 systemd build, as I have not used any m32 specific software
with this build as of yet. I matched the format and switches from the
non-multilib build and from other lib32 builds throughout the book. The
patch can be applied with git am.

--
Eric

>
>> --
>> http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
>> Unsubscribe: See the above information page
>
>

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
0001-systemd-multilib-remove-xsltproc-symlink-update-meso.patch (text/x-patch, 4.5 KB)
From 834eddb092d93c9ceee6e5b23d1d9416c5ea4e5f Mon Sep 17 00:00:00 2001
From: Eric Clothier <[email protected]>
Date: Sun, 22 Dec 2024 11:22:58 -0500
Subject: [PATCH] systemd-multilib: remove xsltproc symlink, update meson
 switches, only install needed multilib libs

Remove xsltproc symlink:
  Remove the creation of xsltproc symlink in favor of properly
  supressing man page generation via meson switches, same as
  non-multilib build instructions

Update meson switches:
  Change meson switch style from -Dxxx to -D xxx to match non-
  multilib build instructions
  Remove duplicated and/or deprecated meson switches
  Fix man page supression switch

Only install needed multilib libs:
  Only libudev.so* and libsystemd.so* are needed from the multilib
  builds, so only install those
---
 chapter08/systemd.xml | 58 +++++++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 24 deletions(-)

diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml
index de7ce92be..13408789c 100644
--- a/chapter08/systemd.xml
+++ b/chapter08/systemd.xml
@@ -273,10 +273,13 @@ ninja test</userinput></screen>
 
 <screen><userinput remap="pre">rm -rf *</userinput></screen>
 
-    <para>Create a symlink to work around missing xsltproc:</para>
+<!-- Remove the symlink to work around missing xsltproc
+     Man page generation will be properly supressed in meson options -->
+
+    <!-- para>Create a symlink to work around missing xsltproc:</para -->
 
 <!-- screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen -->
-<screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen>
+<!-- screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen -->
 
 <!-- with cross-LFS we have util-linux in place:
     <para>Because we have not yet installed the final version of Util-Linux,
@@ -287,30 +290,33 @@ ninja test</userinput></screen>
 done</userinput></screen>
 -->
 
+<!-- Match config switch style (-Dxxx -> -D xxx) to initial build above
+     Properly supress man page generation (-D man=disabled)
+        (Removes need for xsltproc symlink)
+     Remove deprecated switches that are duplicates/not needed
+        (-Drootlibdir deprecated, covered by libdir= option)
+        (-Db_lto not found in meson-options.txt, lto handled by mode switch)
+        (-Dblkid deprecated) -->
     <para>Prepare systemd for compilation:</para>
 
     <screen><userinput remap="configure">PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
-CC="gcc -m32 -march=i686"              \
-CXX="g++ -m32 -march=i686"             \
-LANG=en_US.UTF-8                       \
-meson --prefix=/usr                    \
-      --sysconfdir=/etc                \
-      --localstatedir=/var             \
-      --libdir=/usr/lib32              \
-      -Drootlibdir=/usr/lib32          \
-      -Dblkid=true                  \
-      -Ddefault-dnssec=no           \
-      -Dfirstboot=false             \
-      -Dinstall-tests=false         \
-      -Dldconfig=false              \
-      -Dsysusers=false              \
-      -Db_lto=false                 \
-      -Drpmmacrosdir=no             \
-      -Dhomed=false                 \
-      -Duserdb=false                \
-      -Dman=false                   \
-      -Dmode=release                \
-      ..</userinput></screen>
+CC="gcc -m32"                        \
+CXX="g++ -m32"                       \
+LANG=en_US.UTF-8                     \
+meson setup ..                       \
+      --prefix=/usr                  \
+      --libdir=/usr/lib32            \
+      --buildtype=release            \
+      -D default-dnssec=no           \
+      -D firstboot=false             \
+      -D install-tests=false         \
+      -D ldconfig=false              \
+      -D sysusers=false              \
+      -D rpmmacrosdir=no             \
+      -D homed=disabled              \
+      -D userdb=false                \
+      -D man=disabled                \
+      -D mode=release </userinput></screen>
 
     <para>Compile the package:</para>
 
@@ -318,8 +324,12 @@ meson --prefix=/usr                    \
 
     <para>Install the package:</para>
 
+<!-- Only install needed libs from lib32 as opposed to installing all libs
+     Needed libs: libudev.so*
+                  libsystemd.so*-->
 <screen><userinput remap="install">LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install
-cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+cp -v DESTDIR/usr/lib32/libsystemd.so* /usr/lib32
+cp -v DESTDIR/usr/lib32/libudev.so* /usr/lib32
 rm -rf DESTDIR
 rm -f /usr/bin/xsltproc</userinput></screen>
 
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.