util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* util-linux-2.22: backward compatibility of wdctl
@ 2012-09-05 11:27 Moritz Barsnick
  2012-09-05 13:37 ` Bernhard Voelker
  2012-09-07 16:20 ` Karel Zak
  0 siblings, 2 replies; 4+ messages in thread
From: Moritz Barsnick @ 2012-09-05 11:27 UTC (permalink / raw)
  To: util-linux list

Hi everyone,
congratulations on util-linux 2.22. BTW, I recently took the liberty of
refreshing the freshmeat aka freecode entry, and submitted an update
for 2.22 today. I hope that's okay.

Anyway, just for the fun of it, I was trying to compile util-linux on
an SLES10 (SUSE Linux Enterprise) machine. That's one of those
enterprise distributions with somewhat ancient environments. ;-) But
nothing out of the ordinary nowadays, I think.

I didn't succeed, because wdctl makes use of #defines which are not
defined on this OS:

  make[2]: Entering directory `/tmp/Bui/util-linux/util-linux-2.22'
    CC     sys-utils/wdctl.o
  sys-utils/wdctl.c:53:4: error: 'WDIOF_PRETIMEOUT' undeclared here (not in a function)
  sys-utils/wdctl.c: In function 'read_watchdog':
  sys-utils/wdctl.c:352:17: error: 'WDIOC_GETPRETIMEOUT' undeclared (first use in this function)
  sys-utils/wdctl.c:352:17: note: each undeclared identifier is reported only once for each function it appears in
  sys-utils/wdctl.c:352:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
  In file included from sys-utils/wdctl.c:21:0:
  /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
  sys-utils/wdctl.c:354:17: error: 'WDIOC_GETTIMELEFT' undeclared (first use in this function)
  sys-utils/wdctl.c:354:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
  In file included from sys-utils/wdctl.c:21:0:
  /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
  make[2]: *** [sys-utils/wdctl.o] Error 1

This system's/kernel's watchdog.h doesn't have those #defines:

  > grep -rFn WDIOC_ /usr/include/
  /usr/include/linux/compat_ioctl.h:603:COMPATIBLE_IOCTL(WDIOC_GETSUPPORT)
  /usr/include/linux/compat_ioctl.h:604:COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
  /usr/include/linux/compat_ioctl.h:605:COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS)
  /usr/include/linux/compat_ioctl.h:606:COMPATIBLE_IOCTL(WDIOC_GETTEMP)
  /usr/include/linux/compat_ioctl.h:607:COMPATIBLE_IOCTL(WDIOC_SETOPTIONS)
  /usr/include/linux/compat_ioctl.h:608:COMPATIBLE_IOCTL(WDIOC_KEEPALIVE)
  /usr/include/linux/compat_ioctl.h:609:COMPATIBLE_IOCTL(WDIOC_SETTIMEOUT)
  /usr/include/linux/compat_ioctl.h:610:COMPATIBLE_IOCTL(WDIOC_GETTIMEOUT)
  /usr/include/linux/watchdog.h:23:#define        WDIOC_GETSUPPORT        _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
  /usr/include/linux/watchdog.h:24:#define        WDIOC_GETSTATUS         _IOR(WATCHDOG_IOCTL_BASE, 1, int)
  /usr/include/linux/watchdog.h:25:#define        WDIOC_GETBOOTSTATUS     _IOR(WATCHDOG_IOCTL_BASE, 2, int)
  /usr/include/linux/watchdog.h:26:#define        WDIOC_GETTEMP           _IOR(WATCHDOG_IOCTL_BASE, 3, int)
  /usr/include/linux/watchdog.h:27:#define        WDIOC_SETOPTIONS        _IOR(WATCHDOG_IOCTL_BASE, 4, int)
  /usr/include/linux/watchdog.h:28:#define        WDIOC_KEEPALIVE         _IOR(WATCHDOG_IOCTL_BASE, 5, int)
  /usr/include/linux/watchdog.h:29:#define        WDIOC_SETTIMEOUT        _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
  /usr/include/linux/watchdog.h:30:#define        WDIOC_GETTIMEOUT        _IOR(WATCHDOG_IOCTL_BASE, 7, int)

To add to the misery, it isn't possible to disable the build of wdctl
AFAICT.

System info:

> cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 3
> uname -r
2.6.16.60-0.58.1.3835.0.PTF.638363-smp


Thanks,
Moritz

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

* Re: util-linux-2.22: backward compatibility of wdctl
  2012-09-05 11:27 util-linux-2.22: backward compatibility of wdctl Moritz Barsnick
@ 2012-09-05 13:37 ` Bernhard Voelker
  2012-09-05 15:22   ` Moritz Barsnick
  2012-09-07 16:20 ` Karel Zak
  1 sibling, 1 reply; 4+ messages in thread
From: Bernhard Voelker @ 2012-09-05 13:37 UTC (permalink / raw)
  To: Moritz Barsnick; +Cc: util-linux list



On 09/05/2012 01:27 PM, Moritz Barsnick wrote:
> Hi everyone,
> congratulations on util-linux 2.22. BTW, I recently took the liberty of
> refreshing the freshmeat aka freecode entry, and submitted an update
> for 2.22 today. I hope that's okay.
> 
> Anyway, just for the fun of it, I was trying to compile util-linux on
> an SLES10 (SUSE Linux Enterprise) machine. That's one of those
> enterprise distributions with somewhat ancient environments. ;-) But
> nothing out of the ordinary nowadays, I think.
> 
> I didn't succeed, because wdctl makes use of #defines which are not
> defined on this OS:
> 
>   make[2]: Entering directory `/tmp/Bui/util-linux/util-linux-2.22'
>     CC     sys-utils/wdctl.o
>   sys-utils/wdctl.c:53:4: error: 'WDIOF_PRETIMEOUT' undeclared here (not in a function)
>   sys-utils/wdctl.c: In function 'read_watchdog':
>   sys-utils/wdctl.c:352:17: error: 'WDIOC_GETPRETIMEOUT' undeclared (first use in this function)
>   sys-utils/wdctl.c:352:17: note: each undeclared identifier is reported only once for each function it appears in
>   sys-utils/wdctl.c:352:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
>   In file included from sys-utils/wdctl.c:21:0:
>   /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
>   sys-utils/wdctl.c:354:17: error: 'WDIOC_GETTIMELEFT' undeclared (first use in this function)
>   sys-utils/wdctl.c:354:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
>   In file included from sys-utils/wdctl.c:21:0:
>   /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
>   make[2]: *** [sys-utils/wdctl.o] Error 1
> 
> This system's/kernel's watchdog.h doesn't have those #defines:
> 
> [...]
>
> To add to the misery, it isn't possible to disable the build of wdctl
> AFAICT.

You can use a crude hack to work around building wdctl:

  $ touch sys-utils/wdctl.o wdctl ; make

but this won't make you happy. You'll most propably hit other
problems. This is from my SLES 10.4 system:

  In file included from disk-utils/partx.h:5,
                   from disk-utils/partx.c:32:
  /usr/include/linux/blkpg.h:36: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
  In file included from disk-utils/partx.c:32:
  disk-utils/partx.h: In function ‘partx_del_partition’:
  disk-utils/partx.h:32: error: ‘struct blkpg_ioctl_arg’ has no member named ‘data’
  disk-utils/partx.h: In function ‘partx_add_partition’:
  disk-utils/partx.h:51: error: ‘struct blkpg_ioctl_arg’ has no member named ‘data’
  disk-utils/partx.h: In function ‘partx_resize_partition’:
  disk-utils/partx.h:70: error: ‘struct blkpg_ioctl_arg’ has no member named ‘data’
  make[2]: *** [disk-utils/partx-partx.o] Error 1

Temporarily defining __user to nothing seems to work:

  $ make CFLAGS='-D__user='

... although this is another bad workaround. ;-(

Have a nice day,
Berny

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

* Re: util-linux-2.22: backward compatibility of wdctl
  2012-09-05 13:37 ` Bernhard Voelker
@ 2012-09-05 15:22   ` Moritz Barsnick
  0 siblings, 0 replies; 4+ messages in thread
From: Moritz Barsnick @ 2012-09-05 15:22 UTC (permalink / raw)
  To: util-linux list

Hi Bernhard,
[thanks for CC'ing me, as I'm not subscribed]

On Wed, Sep 05, 2012 at 15:37:48 +0200, Bernhard Voelker wrote:
> You can use a crude hack to work around building wdctl:
>   $ touch sys-utils/wdctl.o wdctl ; make

Fine for me for the time being. I just wanted to point this out because
it will break people's (and distributions') builds.

> but this won't make you happy. You'll most propably hit other
> problems. This is from my SLES 10.4 system:

I see the same thing as you in partx, of course.

> Temporarily defining __user to nothing seems to work:
>   $ make CFLAGS='-D__user='

Good point. I figured out that this is supposed to be happening in
<linux/compiler.h>, but even including that didn't help. At least partx
build can be disabled (--disable-partx).

> ... although this is another bad workaround. ;-(

Looking forward to 2.22.1. :-)

Thanks,
Moritz

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

* Re: util-linux-2.22: backward compatibility of wdctl
  2012-09-05 11:27 util-linux-2.22: backward compatibility of wdctl Moritz Barsnick
  2012-09-05 13:37 ` Bernhard Voelker
@ 2012-09-07 16:20 ` Karel Zak
  1 sibling, 0 replies; 4+ messages in thread
From: Karel Zak @ 2012-09-07 16:20 UTC (permalink / raw)
  To: Moritz Barsnick; +Cc: util-linux list

On Wed, Sep 05, 2012 at 01:27:17PM +0200, Moritz Barsnick wrote:
> congratulations on util-linux 2.22. BTW, I recently took the liberty of
> refreshing the freshmeat aka freecode entry, and submitted an update
> for 2.22 today. I hope that's okay.

 ..arbitrary advertising is okay.

> Anyway, just for the fun of it, I was trying to compile util-linux on
> an SLES10 (SUSE Linux Enterprise) machine. That's one of those

 Do you know that we had -rc1 and -rc2 release? :-)

> enterprise distributions with somewhat ancient environments. ;-) But
> nothing out of the ordinary nowadays, I think.

 Well, it seems that you have kernel header < 2.6.18 (the macros has
 been added in Apr and May 2006).

>     CC     sys-utils/wdctl.o
>   sys-utils/wdctl.c:53:4: error: 'WDIOF_PRETIMEOUT' undeclared here (not in a function)
>   sys-utils/wdctl.c: In function 'read_watchdog':
>   sys-utils/wdctl.c:352:17: error: 'WDIOC_GETPRETIMEOUT' undeclared (first use in this function)
>   sys-utils/wdctl.c:352:17: note: each undeclared identifier is reported only once for each function it appears in
>   sys-utils/wdctl.c:352:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
>   In file included from sys-utils/wdctl.c:21:0:
>   /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
>   sys-utils/wdctl.c:354:17: error: 'WDIOC_GETTIMELEFT' undeclared (first use in this function)
>   sys-utils/wdctl.c:354:3: warning: passing argument 2 of 'ioctl' makes integer from pointer without a cast [enabled by default]
>   In file included from sys-utils/wdctl.c:21:0:
>   /usr/include/sys/ioctl.h:42:12: note: expected 'long unsigned int' but argument is of type 'const struct wdflag *'
>   make[2]: *** [sys-utils/wdctl.o] Error 1

 Fixed.

> This system's/kernel's watchdog.h doesn't have those #defines:

 Sure, it's always bad/expensive idea to mix old OS and new system
 packages.

> To add to the misery, it isn't possible to disable the build of wdctl
> AFAICT.

 Fixed, I have added --disable-wdctl.

> 2.6.16.60-0.58.1.3835.0.PTF.638363-smp

 yep...

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2012-09-07 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 11:27 util-linux-2.22: backward compatibility of wdctl Moritz Barsnick
2012-09-05 13:37 ` Bernhard Voelker
2012-09-05 15:22   ` Moritz Barsnick
2012-09-07 16:20 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).