Skip to contentSkip to conversation

libutil.h moved to bsd/libutil.h (Was: Re: [Xen-users] Problem compiling Xen 4.2 from sources)

DISCUSSION Ian Campbell 3 participants 6 messages Oct 2, 2012 – Oct 8, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20121002163136.GA5378@intersect

#1 lore raw

(Adding some CCs)

Quoted 7 lines · Giorgio Mossa

Hello everyone,
I'm working on an Ubuntu 12.04 and I wanted to test Xen 4.2 (official repository offer just version 4.1), so I've downloaded the source tarball from the site, followed the instruction in the readme but when compiling I'm getting the following error:

Quoted 6 lines

In file included from libxl_bootloader.c:21:0:
/usr/include/libutil.h:33:2: error: #warning "Deprecated header, use <bsd/libutil.h> or libbsd-overlay.pc instead." [-Werror=cpp]
cc1: all warnings being treated as errors
make[3]: *** [libxl_bootloader.o] Error 1

could anyone explain how to solve this problem, without disabling the warning/errors compilation options?

Looks like someone has decided to move this header from /usr/include to /usr/include/bsd and leave behind a #warning in the old location, which has broken the way we do things.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640895 seems to relate to the fallout from this.

I'm not sure when the include of libutil is needed, it's not mentioned in the Linux man pages and on Linux neither of the functions we purport to need from it are actually present. Perhaps it's a BSD only thing?

Probably we need to check for bsd/libutil.h in preference to libutil.h although the resolution of #640895 suggests that what we do now is correct now that the bug is fixed, in which case a bug against Ubuntu would be appropriate.

Ian, Royer, What do you guys think?

Ian.

#2 lore raw

Re: [Xen-users] libutil.h moved to bsd/libutil.h (Was: Re: Problem compiling Xen 4.2 from sources)

Quoted 9 lines · Ian Campbell

(Adding some CCs)

Quoted 7 lines · Giorgio Mossa

Hello everyone,
I'm working on an Ubuntu 12.04 and I wanted to test Xen 4.2 (official repository offer just version 4.1), so I've downloaded the source tarball from the site, followed the instruction in the readme but when compiling I'm getting the following error:

Quoted 7 lines
Quoted 6 lines

In file included from libxl_bootloader.c:21:0:
/usr/include/libutil.h:33:2: error: #warning "Deprecated header, use <bsd/libutil.h> or libbsd-overlay.pc instead." [-Werror=cpp]
cc1: all warnings being treated as errors
make[3]: *** [libxl_bootloader.o] Error 1

could anyone explain how to solve this problem, without disabling

the warning/errors compilation options?

Oh, BTW, I expect you could just purge libbsd-dev from your system and that would workaround the issue.

Ian.

Quoted 26 lines

Looks like someone has decided to move this header from /usr/include to /usr/include/bsd and leave behind a #warning in the old location, which has broken the way we do things.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640895 seems to relate to the fallout from this.

I'm not sure when the include of libutil is needed, it's not mentioned in the Linux man pages and on Linux neither of the functions we purport to need from it are actually present. Perhaps it's a BSD only thing?

Probably we need to check for bsd/libutil.h in preference to libutil.h although the resolution of #640895 suggests that what we do now is correct now that the bug is fixed, in which case a bug against Ubuntu would be appropriate.

Ian, Royer, What do you guys think?

Ian.

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xen.org/xen-users

#3 lore raw

Re: [Xen-users] libutil.h moved to bsd/libutil.h (Was: Re: Problem compiling Xen 4.2 from sources)

Quoted 7 lines · Ian Campbell

On Tue, 2012-10-02 at 17:46 +0100, Ian Campbell wrote:

Oh, BTW, I expect you could just purge libbsd-dev from your system and that would workaround the issue.

Ian.

Sadly I can't because I've other packages which depend on it......

#4 lore raw
In reply to Ian Campbell
Quoted 27 lines · Ian Campbell

(Adding some CCs)

Quoted 7 lines · Giorgio Mossa

Hello everyone,
I'm working on an Ubuntu 12.04 and I wanted to test Xen 4.2 (official repository offer just version 4.1), so I've downloaded the source tarball from the site, followed the instruction in the readme but when compiling I'm getting the following error:

Quoted 6 lines

In file included from libxl_bootloader.c:21:0:
/usr/include/libutil.h:33:2: error: #warning "Deprecated header, use <bsd/libutil.h> or libbsd-overlay.pc instead." [-Werror=cpp]
cc1: all warnings being treated as errors
make[3]: *** [libxl_bootloader.o] Error 1

could anyone explain how to solve this problem, without disabling the warning/errors compilation options?

Looks like someone has decided to move this header from /usr/include to /usr/include/bsd and leave behind a #warning in the old location, which has broken the way we do things.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640895 seems to relate to the fallout from this.

I'm not sure when the include of libutil is needed, it's not mentioned in the Linux man pages and on Linux neither of the functions we purport to need from it are actually present. Perhaps it's a BSD only thing?

Quoted 6 lines

Probably we need to check for bsd/libutil.h in preference to libutil.h although the resolution of #640895 suggests that what we do now is correct now that the bug is fixed, in which case a bug against Ubuntu would be appropriate.

Ian, Royer, What do you guys think?

According to the man pages <libutil.h> is only needed on BSDs to be able to use openpty et al. Linux should not have this file, could you please try the following patch? It should prevent configure (and thus libxl) from including the bogus libutil.h header.

---

Quoted 1 line

From 250c0d533bab3c9705ade8e4bffed54abcb53b1c Mon Sep 17 00:00:00 2001

From: Roger Pau Monne <[email protected]>
Date: Wed, 3 Oct 2012 10:22:21 +0200
Subject: [PATCH] autoconf: add -Werror to libutil.h header check

libutil.h is only needed on BSDs, but not in Linux. Debian package libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a #warning, thus making libxl compilation broken due to -Werror.

Perform the libutil.h check with -Werror, so we don't include this bogus header.

---
Please rerun autoconf after applying this patch

---
 tools/m4/ptyfuncs.m4 |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
tools/m4/ptyfuncs.m4 +7 -0
index bfea3e1..3e37b5a 100644
@@ -1,7 +1,14 @@
 AC_DEFUN([AX_CHECK_PTYFUNCS], [
+    dnl This is a workaround for a bug in Debian package
+    dnl libbsd-dev-0.3.0-1. Once we no longer support that
+    dnl package we can remove the addition of -Werror to
+    dnl CPPFLAGS.
+    AX_SAVEVAR_SAVE(CPPFLAGS)
+    CPPFLAGS="$CPPFLAGS -Werror"
     AC_CHECK_HEADER([libutil.h],[
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     ])
+    AX_SAVEVAR_RESTORE(CPPFLAGS)
     AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
         for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
             if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then
Signature · 1 line
1.7.7.5 (Apple Git-26)
#5 lore raw

It seems the patch worked,
thank you very much!!!

Quoted 47 lines · Roger Pau Monné

According to the man pages <libutil.h> is only needed on BSDs to be able to use openpty et al. Linux should not have this file, could you please try the following patch? It should prevent configure (and thus libxl) from including the bogus libutil.h header.

---

Quoted 1 line

From 250c0d533bab3c9705ade8e4bffed54abcb53b1c Mon Sep 17 00:00:00 2001

From: Roger Pau Monne <[email protected]>
Date: Wed, 3 Oct 2012 10:22:21 +0200
Subject: [PATCH] autoconf: add -Werror to libutil.h header check

libutil.h is only needed on BSDs, but not in Linux. Debian package libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a #warning, thus making libxl compilation broken due to -Werror.

Perform the libutil.h check with -Werror, so we don't include this bogus header.

---
Please rerun autoconf after applying this patch

---
 tools/m4/ptyfuncs.m4 |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
tools/m4/ptyfuncs.m4 +7 -0
index bfea3e1..3e37b5a 100644
@@ -1,7 +1,14 @@
 AC_DEFUN([AX_CHECK_PTYFUNCS], [
+    dnl This is a workaround for a bug in Debian package
+    dnl libbsd-dev-0.3.0-1. Once we no longer support that
+    dnl package we can remove the addition of -Werror to
+    dnl CPPFLAGS.
+    AX_SAVEVAR_SAVE(CPPFLAGS)
+    CPPFLAGS="$CPPFLAGS -Werror"
     AC_CHECK_HEADER([libutil.h],[
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     ])
+    AX_SAVEVAR_RESTORE(CPPFLAGS)
     AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
         for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
             if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then
Signature · 1 line
1.7.7.5 (Apple Git-26)
author Acked-by
#6 lore raw
In reply to Roger Pau Monné
Quoted 5 lines · Roger Pau Monne

From 250c0d533bab3c9705ade8e4bffed54abcb53b1c Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <[email protected]>
Date: Wed, 3 Oct 2012 10:22:21 +0200
Subject: [PATCH] autoconf: add -Werror to libutil.h header check

Quoted 8 lines

libutil.h is only needed on BSDs, but not in Linux. Debian package libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a #warning, thus making libxl compilation broken due to -Werror.

Perform the libutil.h check with -Werror, so we don't include this bogus header.

and applied.

Arguably, since we compile with -Werror we should run configure with it too -- but I bet the fallout from doing that would be horrific though!

Ian.