mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0.
@ 2024-01-08 12:14 ruggero
  2024-01-08 12:47 ` Christian Melki
  0 siblings, 1 reply; 4+ messages in thread
From: ruggero @ 2024-01-08 12:14 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]

Hello everybody,


my BSP still uses an old version of linux / libC, that does not provide
all modern features. 

Compiling utils-linux with PTXDIST-2023.09.0 was painless. 
Upgrading to PTXDIST-2023.11.0 caused several compilation errors.

Both PTXDIST release uses the same version of utils-linux (2.39.2) the
only difference being the build system. PTXDIST-2023.09.0 uses autotools,
while PTXDIST-2023.11.0 uses meson.

Here a list of the problems:

My linux do not provide <linux/blkzoned.h>. This causes an error while
compiling blkzone.

My linux do not provide <linux/pr.h>. This causes an error compiling blkpr.

My linux do not provide <linux/kcmp.h>. This causes an error compiling
lsfd.

My linux do not provide the symbol SIOCGSKNS in linux/sockios.h. This
causes an error while compiling test_mkfds.

In the autotool version, all these programs were disabled. This seems to
be not possible with meson.

My libC provides the symbol openpty in the libutils module. The
PTXDIST-2023.09.0 makefile util-linux.make explicitly enables libutils,
the  PTXDIST-2023.11.0 explicitly disables them.

I was able to find a solution to all the problems. Attached are my patches.
 
In meson.build I disabled build of blkzone if linux/blkzoned.h does not
exists, lsfd if linux/pr.h is missing, etc. 

In the makefile util-linux.make I just changed libutils form disabled to
enabled. Maybe one can consider to use a parameter instead.

I'm not sure if this is the best way to do, since it is my first
experience with meson. It would be nice if somebody can check them, and
maybe include them in the future versions of ptxdist.



Ruggero





[-- Attachment #2: 0002-meson-dont-build-blkzone-if-blkzoned.h-is-not-available.patch --]
[-- Type: text/x-patch, Size: 1053 bytes --]

Some versions of Linux don't provide linux/blkzoned.h. In this case, attempting
to build blkzone produces an error. Suppress building of blkzone.  
Index: util-linux-2.39.2/meson.build
===================================================================
--- util-linux-2.39.2.orig/meson.build
+++ util-linux-2.39.2/meson.build
@@ -1477,16 +1477,19 @@ exes += exe
 manadocs += ['sys-utils/blkdiscard.8.adoc']
 bashcompletions += ['blkdiscard']
 
-exe = executable(
-  'blkzone',
-  blkzone_sources,
-  include_directories : includes,
-  link_with : [lib_common],
-  install_dir : sbindir,
-  install : true)
-exes += exe
-manadocs += ['sys-utils/blkzone.8.adoc']
-bashcompletions += ['blkzone']
+have = cc.has_header('linux/blkzoned.h')
+if have
+  exe = executable(
+    'blkzone',
+    blkzone_sources,
+    include_directories : includes,
+    link_with : [lib_common],
+    install_dir : sbindir,
+    install : true)
+  exes += exe
+  manadocs += ['sys-utils/blkzone.8.adoc']
+  bashcompletions += ['blkzone']
+endif
 
 exe = executable(
   'blkpr',

[-- Attachment #3: 0003-meson-dont-build-blkpr-if-pr.h-is-not-available.patch --]
[-- Type: text/x-patch, Size: 920 bytes --]

Some versions of Linux don't provide linux/pr.h.  In this case, attempting
to build blkpr produces an error. Suppress building of blkpr.
 
Index: util-linux-2.39.2/meson.build
===================================================================
--- util-linux-2.39.2.orig/meson.build
+++ util-linux-2.39.2/meson.build
@@ -1491,15 +1491,18 @@ if have
   bashcompletions += ['blkzone']
 endif
 
-exe = executable(
-  'blkpr',
-  blkpr_sources,
-  include_directories : includes,
-  link_with : [lib_common],
-  install_dir : sbindir,
-  install : true)
-exes += exe
-manadocs += ['sys-utils/blkpr.8.adoc']
+have = cc.has_header('linux/pr.h')
+if have
+  exe = executable(
+    'blkpr',
+    blkpr_sources,
+    include_directories : includes,
+    link_with : [lib_common],
+    install_dir : sbindir,
+    install : true)
+  exes += exe
+  manadocs += ['sys-utils/blkpr.8.adoc']
+endif
 
 exe = executable(
   'ldattach',

[-- Attachment #4: 0004-meson-dont-build-lsfd-if-kcmp.h-is-not-available.patch --]
[-- Type: text/x-patch, Size: 1066 bytes --]

Some versions of Linux don't provide linux/kcmp.h.   In this case, attempting
to build lsfd produces an error. Suppress building of lsfd.

Index: util-linux-2.39.2/meson.build
===================================================================
--- util-linux-2.39.2.orig/meson.build
+++ util-linux-2.39.2/meson.build
@@ -2595,17 +2595,20 @@ if not is_disabler(exe)
   bashcompletions += ['lsblk']
 endif
 
-exe = executable(
-  'lsfd',
-  lsfd_sources,
-  include_directories : includes,
-  link_with : [lib_common,
-               lib_smartcols],
-  install_dir : usrbin_exec_dir,
-  install : true)
-if not is_disabler(exe)
-  exes += exe
-  manadocs += ['misc-utils/lsfd.1.adoc']
+have = cc.has_header('linux/kcmp.h')
+if have
+  exe = executable(
+    'lsfd',
+    lsfd_sources,
+    include_directories : includes,
+    link_with : [lib_common,
+                 lib_smartcols],
+    install_dir : usrbin_exec_dir,
+    install : true)
+  if not is_disabler(exe)
+    exes += exe
+    manadocs += ['misc-utils/lsfd.1.adoc']
+  endif
 endif
 
 exe = executable(

[-- Attachment #5: 0005-meson-dont-build-mkfds-if-SIOCGSKNS-is-not-available.patch --]
[-- Type: text/x-patch, Size: 799 bytes --]

Some old version of Linux don't provide the SIOCGSKNS ioctl in linux/sockios.h. 
In this case, attempting to build test_mkfds produces an error. Suppress building 
of test_mkfds.
Index: util-linux-2.39.2/meson.build
===================================================================
--- util-linux-2.39.2.orig/meson.build
+++ util-linux-2.39.2/meson.build
@@ -3288,11 +3288,14 @@ exe = executable(
 exes += exe
 
 if LINUX
-  exe = executable(
-    'test_mkfds',
-    'tests/helpers/test_mkfds.c',
-    include_directories : includes)
-  exes += exe
+  have = cc.has_header_symbol('linux/sockios.h', 'SIOCGSKNS')
+  if have
+    exe = executable(
+      'test_mkfds',
+      'tests/helpers/test_mkfds.c',
+      include_directories : includes)
+    exes += exe
+  endif
 endif
 
 exe = executable(

[-- Attachment #6: util-linux.make.patch --]
[-- Type: text/x-patch, Size: 443 bytes --]

--- /usr/local/lib/ptxdist-2023.11.0/rules/util-linux.make	2023-10-30 11:15:25.000000000 +0100
+++ util-linux.make	2024-01-07 18:24:56.336248170 +0100
@@ -127,7 +127,7 @@
 	-Dlibpcre2-posix=disabled \
 	-Dlibuser=disabled \
 	-Dlibutempter=disabled \
-	-Dlibutil=disabled \
+	-Dlibutil=enabled \
 	-Dmagic=disabled \
 	-Dncurses=$(call ptx/endis, UTIL_LINUX_USES_NCURSES)d \
 	-Dncursesw=$(call ptx/endis, PTXCONF_UTIL_LINUX_USES_NCURSESW)d \

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0.
  2024-01-08 12:14 [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0 ruggero
@ 2024-01-08 12:47 ` Christian Melki
  2024-01-10  7:51   ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Melki @ 2024-01-08 12:47 UTC (permalink / raw)
  To: ruggero; +Cc: ptxdist

Hi,

On 1/8/24 1:14 PM, ruggero wrote:
> [Du f?r inte e-post ofta fr?n rrossi@atb-biomag.de. L?s om varf?r det h?r ?r viktigt p? https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hello everybody,
> 
> 
> my BSP still uses an old version of linux / libC, that does not provide
> all modern features.
> 
> Compiling utils-linux with PTXDIST-2023.09.0 was painless.
> Upgrading to PTXDIST-2023.11.0 caused several compilation errors.
> 
> Both PTXDIST release uses the same version of utils-linux (2.39.2) the
> only difference being the build system. PTXDIST-2023.09.0 uses autotools,
> while PTXDIST-2023.11.0 uses meson.
> 
> Here a list of the problems:
> 
> My linux do not provide <linux/blkzoned.h>. This causes an error while
> compiling blkzone.
> 
> My linux do not provide <linux/pr.h>. This causes an error compiling blkpr.
> 
> My linux do not provide <linux/kcmp.h>. This causes an error compiling
> lsfd.
> 
> My linux do not provide the symbol SIOCGSKNS in linux/sockios.h. This
> causes an error while compiling test_mkfds.
> 
> In the autotool version, all these programs were disabled. This seems to
> be not possible with meson.
> 
> My libC provides the symbol openpty in the libutils module. The
> PTXDIST-2023.09.0 makefile util-linux.make explicitly enables libutils,
> the  PTXDIST-2023.11.0 explicitly disables them.
> 
> I was able to find a solution to all the problems. Attached are my patches.
> 
> In meson.build I disabled build of blkzone if linux/blkzoned.h does not
> exists, lsfd if linux/pr.h is missing, etc.
> 
> In the makefile util-linux.make I just changed libutils form disabled to
> enabled. Maybe one can consider to use a parameter instead.
> 
> I'm not sure if this is the best way to do, since it is my first
> experience with meson. It would be nice if somebody can check them, and
> maybe include them in the future versions of ptxdist.
> 

Thanks for reporting and working with these issues.
I suggest also reporting them upstream to the util-linux project itself.
There are going to be a lot of these types of issues.
Ie when converting build systems, be it autotools or anything else.

Regards,
Christian

> 
> 
> Ruggero
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0.
  2024-01-08 12:47 ` Christian Melki
@ 2024-01-10  7:51   ` Michael Olbrich
  2024-01-23 11:57     ` ruggero
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2024-01-10  7:51 UTC (permalink / raw)
  To: Christian Melki; +Cc: ruggero, ptxdist

Hi,

On Mon, Jan 08, 2024 at 01:47:57PM +0100, Christian Melki wrote:
> On 1/8/24 1:14 PM, ruggero wrote:
> > [Du f?r inte e-post ofta fr?n rrossi@atb-biomag.de. L?s om varf?r det h?r ?r viktigt p? https://aka.ms/LearnAboutSenderIdentification ]
> > 
> > Hello everybody,
> > 
> > 
> > my BSP still uses an old version of linux / libC, that does not provide
> > all modern features.
> > 
> > Compiling utils-linux with PTXDIST-2023.09.0 was painless.
> > Upgrading to PTXDIST-2023.11.0 caused several compilation errors.
> > 
> > Both PTXDIST release uses the same version of utils-linux (2.39.2) the
> > only difference being the build system. PTXDIST-2023.09.0 uses autotools,
> > while PTXDIST-2023.11.0 uses meson.
> > 
> > Here a list of the problems:
> > 
> > My linux do not provide <linux/blkzoned.h>. This causes an error while
> > compiling blkzone.
> > 
> > My linux do not provide <linux/pr.h>. This causes an error compiling blkpr.
> > 
> > My linux do not provide <linux/kcmp.h>. This causes an error compiling
> > lsfd.
> > 
> > My linux do not provide the symbol SIOCGSKNS in linux/sockios.h. This
> > causes an error while compiling test_mkfds.
> > 
> > In the autotool version, all these programs were disabled. This seems to
> > be not possible with meson.
> > 
> > My libC provides the symbol openpty in the libutils module. The
> > PTXDIST-2023.09.0 makefile util-linux.make explicitly enables libutils,
> > the  PTXDIST-2023.11.0 explicitly disables them.
> > 
> > I was able to find a solution to all the problems. Attached are my patches.
> > 
> > In meson.build I disabled build of blkzone if linux/blkzoned.h does not
> > exists, lsfd if linux/pr.h is missing, etc.
> > 
> > In the makefile util-linux.make I just changed libutils form disabled to
> > enabled. Maybe one can consider to use a parameter instead.
> > 
> > I'm not sure if this is the best way to do, since it is my first
> > experience with meson. It would be nice if somebody can check them, and
> > maybe include them in the future versions of ptxdist.
> > 
> 
> Thanks for reporting and working with these issues.
> I suggest also reporting them upstream to the util-linux project itself.
> There are going to be a lot of these types of issues.
> Ie when converting build systems, be it autotools or anything else.

Reporting to upstream is definitely good idea. But I'm not sure if will
accept patches for kernel / libc versions that are this old.

You could also try to use newer kernel headers instead. That way util-linux
should compile, even if some tools may fail at runtime. To do that enable
the package KERNEL_HEADERS and make sure the new headers are used in
util-linux.make. See e.g. systemd.make on how to do that. It's the
"ifdef PTXCONF_KERNEL_HEADER" block that you'll need to copy and adapt.

I would accept a patch for this, but please read our contributing guide
lines[1] on how to do that.

Regards,
Michael

[1] https://www.ptxdist.org/doc/contributing.html

> Regards,
> Christian
> 
> > 
> > 
> > Ruggero
> > 
> > 
> > 
> > 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0.
  2024-01-10  7:51   ` Michael Olbrich
@ 2024-01-23 11:57     ` ruggero
  0 siblings, 0 replies; 4+ messages in thread
From: ruggero @ 2024-01-23 11:57 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: Christian Melki, ptxdist

Hi,

It seems that the utils-linux people fixed: 
- lsfd not compiling with old Linuxes w/o kcmp.h
- mkfds not compiling if SIOCGSKNS is not available.

Thanks to Masatake YAMATO <yamato@redhat.com>

However, in the mean time, the requirement of sizeof(time_t) =  64bits was
added, so I can't test the changes.


> Reporting to upstream is definitely good idea. But I'm not sure if will
> accept patches for kernel / libc versions that are this old.
> 

Regards,

Ruggero



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-23 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 12:14 [ptxdist] Difficulties to compile package utils-linux while upgrading from PTXDIST-2023.09.0 to PTXDIST-2023.19.0 ruggero
2024-01-08 12:47 ` Christian Melki
2024-01-10  7:51   ` Michael Olbrich
2024-01-23 11:57     ` ruggero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox