Bug 27212 - mc-4.6.0-r2 ebuild to fails to build successfully
Bug#: 27212 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: lanius@gentoo.org Reported By: chris@wilddev.net
Component: Applications
URL: 
Summary: mc-4.6.0-r2 ebuild to fails to build successfully
Keywords:  
Status Whiteboard: 
Opened: 2003-08-24 00:19 0000
Description:   Opened: 2003-08-24 00:19 0000
The ebuild of mc-4.6.0-r2 fails. I have reproduced this on both PPC and x86.
The
only difference to the previous ebuild is  --enable-charset. If, however I
remove this I still get the same error.

Reproducible: Always
Steps to Reproduce:
1. emerge -u world
2. emerge mc
3.

Actual Results:  
x86 build error:
make[2]: Entering directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs'
Making all in samba
make[3]: Entering directory
`/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs/samba'
Using FLAGS =  -mcpu=athlon-tbird -O3 -pipe -Iinclude -I./include 
-DCONFIGFILE="/etc/samba/smb.conf" -DLMHOSTSFILE="/etc/samba/lmhosts"
-DSBINDIR="/usr/bin" -DCODEPAGEDIR="/var/lib/samba/codepages"
-DDRIVERFILE="/usr/lib/printers.def" -DBINDIR="/usr/bin" -DHAVE_INCLUDES_H
Compiling param/loadparm.c
Compiling param/params.c
In file included from /usr/include/linux/vfs.h:4,
                 from /usr/include/linux/fs.h:14,
                 from /usr/include/linux/capability.h:17,
                 from /usr/include/sys/capability.h:35,
                 from include/includes.h:309,
                 from param/loadparm.c:50:
/usr/include/asm/statfs.h:12: redefinition of `struct statfs'
In file included from /usr/include/linux/vfs.h:4,
                 from /usr/include/linux/fs.h:14,
                 from /usr/include/linux/capability.h:17,
                 from /usr/include/sys/capability.h:35,
                 from include/includes.h:309,
                 from param/params.c:82:
/usr/include/asm/statfs.h:12: redefinition of `struct statfs'
make[3]: *** [param/params.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [param/loadparm.o] Error 1
make[3]: Leaving directory
`/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs/samba'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0'
make: *** [all] Error 2

!!! ERROR: app-misc/mc-4.6.0-r2 failed.
!!! Function src_compile, Line 63, Exitcode 2
!!! (no error message)

PPC error:
make[2]: Entering directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs'
Making all in samba
make[3]: Entering directory
`/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs/samba'
Using FLAGS =  -O2 -pipe -mcpu=750 -mpowerpc-gfxopt -fsigned-char -Iinclude
-I./include  -DCONFIGFILE="/etc/samba/smb.conf"
-DLMHOSTSFILE="/etc/samba/lmhosts" -DSBINDIR="/usr/bin"
-DCODEPAGEDIR="/var/lib/samba/codepages" -DDRIVERFILE="/usr/lib/printers.def"
-DBINDIR="/usr/bin" -DHAVE_INCLUDES_H
Compiling param/loadparm.c
Compiling param/params.c
In file included from /usr/include/linux/vfs.h:4,
                 from /usr/include/linux/fs.h:14,
                 from /usr/include/linux/capability.h:17,
                 from /usr/include/sys/capability.h:35,
                 from include/includes.h:309,
                 from param/loadparm.c:50:
/usr/include/asm/statfs.h:15: redefinition of `struct statfs'In file included
from /usr/include/linux/vfs.h:4,
                 from /usr/include/linux/fs.h:14,
                 from /usr/include/linux/capability.h:17,
                 from /usr/include/sys/capability.h:35,
                 from include/includes.h:309,
                 from param/params.c:82:
/usr/include/asm/statfs.h:15: redefinition of `struct statfs'

make[3]: *** [param/params.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [param/loadparm.o] Error 1
make[3]: Leaving directory
`/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs/samba'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0/vfs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mc-4.6.0-r2/work/mc-4.6.0'
make: *** [all] Error 2

!!! ERROR: app-misc/mc-4.6.0-r2 failed.
!!! Function src_compile, Line 63, Exitcode 2
!!! (no error message)



x86:
Portage 2.0.49 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r5)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 AMD Athlon(tm) processor
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-tbird -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo
ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://gentoo.noved.org/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss 3dnow apm avi crypt encode foomaticdb gif jpeg libg++ libwww mad
mikmod mmx ncurses nls pdflib xmms xv gdbm berkdb slang readline arts svga sdl
gpm tcpd pam ssl perl python esd imlib oggvorbis motif opengl mozilla X gtk
gtk2
gnome alsa cups -qt -kde gphoto2 cdr gb evo bonobo gtkhtml png mpeg quicktime
imap spell truetype xml2 xml guile samba zlib -java dvd ofx"

PPC:
Portage 2.0.49 (default-ppc-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-ppc-r2)
=================================================================
System uname: 2.4.21-ppc-r2 ppc
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe -mcpu=750 -mpowerpc-gfxopt -fsigned-char"
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo
ftp://ftp.ussg.iu.edu/pub/linux/gentoo
ftp://mirror.iawnet.sandia.gov/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="oss dvd xv libwww jpeg nls mitshm gif ppc foomaticdb gnome-libs gdbm
berkdb
slang readline sdl gpm tcpd pam ssl perl python esd imlib oggvorbis motif
opengl
mozilla X gtk gnome -alsa cups -qt -kde gphoto2 cdr gb evo bonobo gtkhtml png
mpeg quicktime imap spell truetype xml2 xml guile afs samba zlib java"

------- Comment #1 From Heinrich Wendel (RETIRED) 2003-08-24 02:57:49 0000 -------
try revdep-rebuild from gentoolkit and try to remerge samba

------- Comment #2 From Gianluca Trimarchi 2003-08-24 06:51:39 0000 -------
same problem here. already tried to re-emerge samba after revdep-rebuild.


Portage 2.0.49 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test4)
=================================================================
System uname: 2.6.0-test4 i686 Intel(R) Pentium(R) 4 Mobile CPU 1.80GHz
distcc 2.10 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 oss 3dnow apm avi crypt cups encode foomaticdb gif jpeg mad mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xv zlib directfb alsa gdbm berkdb slang readline tetex aalib tcltk mysql postgres X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gtk qt motif opengl mozilla ldap cdr acpi apache2 cscope dga dvd ethereal fbcon gd gtk2 imap innodb ipv6 joystick leim matroska mbox moznocompose moznoirc moznomail mozsvg pic pnp radeon samba sse tiff usb vim-with-x xosd -java -gnome -libg++ -xmms -arts -svga -guile -kde"

------- Comment #3 From Heinrich Wendel (RETIRED) 2003-08-24 06:56:48 0000 -------
did you symlink /usr/include/linux to your current kernel? 

------- Comment #4 From Brad Cowan (RETIRED) 2003-08-24 07:48:00 0000 -------
USE="-samba" will work....it has to do with built in samba support in your
kernel.  
If I remember correctly there was some discussion on the mc dev list about
samba support, I'll go back and check my email achives and see what I can pull
up.

------- Comment #5 From Gianluca Trimarchi 2003-08-24 14:17:18 0000 -------
Heinrich:
No, /usr/include/linux contains linux-headers-2.4.20 ebuild.
Anyway I've tried to link it to the 'include/linux' of the kernel (2.6.0-test4) but emerge still fails because can't find other headers. (i.e. from asm/, asm-generic/)

Brad:
Ok, thanks.

------- Comment #6 From Martin Holzer (RETIRED) 2003-08-25 02:57:14 0000 -------
*** Bug 27272 has been marked as a duplicate of this bug. ***

------- Comment #7 From Michal Januszewski 2003-08-31 13:35:48 0000 -------
A quick-and-dirty fix for this problem:
add this:

sed -i '/#define HAVE_SYS_CAPABILITY_H 1/a#define _I386_STATFS_H' vfs/samba/include/config.h

just before "emake || die" in the ebuild.

------- Comment #8 From Heinrich Wendel (RETIRED) 2003-09-01 04:03:14 0000 -------
why does it fix it and does it work with ppc,sparc... ? 

------- Comment #9 From Michal Januszewski 2003-09-01 10:38:33 0000 -------
struct statfs is first declared in bits/statfs.h (which is referred from
sys/statfs.h which is referred from sys/vfs.h). Then comes:
sys/capability.h -> linux/capability.h -> linux/fs.h -> linux/vfs.h (as seen in
the compilation error). linux/vfs.h refers to asm/statfs.h, which has yet
another declaration of struct statfs in it. All code in asm/statfs.h is between
#ifndef _I386_STATFS_H and #endif, so by defining _I386_STATFS_H' in
/fs/samba/include/config.h we actually skip all contents asm/statfs.h and thus
avoid redeclaration of struct statfs. Since the 'I386' part suggests that this
is platform-dependent, we could use _LINUX_VFS_H:

sed -i '/#define HAVE_SYS_CAPABILITY_H 1/a#define _LINUX_VFS_H
vfs/samba/include/config.h

By doing this we skip linux/vfs.h (which only has #include <asm/statfs.h> in
it). I think it should work on PPC, SPARC, ... but I have no way of checking
it. Perhaps Chris could help us here?

------- Comment #10 From Heinrich Wendel (RETIRED) 2003-09-01 13:41:07 0000 -------
*** Bug 27713 has been marked as a duplicate of this bug. ***

------- Comment #11 From Chris Lyttle 2003-09-01 16:36:47 0000 -------
Created an attachment (id=16934) [details]
ebuild with sed hack

------- Comment #12 From Chris Lyttle 2003-09-01 16:38:07 0000 -------
Ok I tested the attached ebuild with the changes suggested by Michal on PPC.
Seemed to work fine and I got the smb menu.

------- Comment #13 From Heinrich Wendel (RETIRED) 2003-09-01 17:54:46 0000 -------
and why does this problem not occur on every pc?

------- Comment #14 From Heinrich Wendel (RETIRED) 2003-09-01 18:00:31 0000 -------
please post your vfs/samba/include/config.h (without your patch)

------- Comment #15 From Chris Lyttle 2003-09-01 18:18:19 0000 -------
Created an attachment (id=16940) [details]
config.h

------- Comment #16 From Chris Lyttle 2003-09-01 18:19:53 0000 -------
I've no idea what you mean about every pc, it happens on both ppc and my x86
box here (athlon). I've not enough knowledge of how this is supposed to work to
say why it may work ok on some platforms.

------- Comment #17 From Heinrich Wendel (RETIRED) 2003-09-02 03:41:08 0000 -------
i have two gentoo pc's here and both built mc fine with all use vars 

------- Comment #18 From Heinrich Wendel (RETIRED) 2003-09-02 03:42:41 0000 -------
the difference is that on my systems i have 
 
/* #undef HAVE_SYS_CAPABILITY_H */ 
 
but you have 
 
#define HAVE_SYS_CAPABILITY_H 1 
 
why does this happen? 

------- Comment #19 From Michal Januszewski 2003-09-02 06:08:30 0000 -------
Do you have /usr/include/sys/capability.h in your system?
If you do, check <mc_source_dir>/vfs/samba/config.log for information why sys/capability.h detection failed (perhaps you could post your config.log here so that other people could compare it with whatever results they get).

------- Comment #20 From Heinrich Wendel (RETIRED) 2003-09-02 06:13:16 0000 -------
hm, i have linux/capability.h but not sys/capability.h, provided by 
 
*  sys-kernel/linux-headers 
      Latest version available: 2.4.19-r1 
      Latest version installed: 2.4.19-r1 
      Size of downloaded files: 25,432 kB 
      Homepage:    http://www.kernel.org/ http://www.gentoo.org/ 
      Description: Full sources for the Gentoo Linux kernel 
 
where does your sys/capability.h come from? 

------- Comment #21 From Alberto Ornaghi 2003-09-02 06:30:24 0000 -------
here is mine:

epm -qf /usr/include/sys/capability.h
libcap-1.10-r2

epm -qf /usr/include/linux/capability.h
linux-headers-2.4.19-r1

and i've the same problem. mc does not compile. it compiles only with USE="-samba"

bye

------- Comment #22 From Michal Januszewski 2003-09-02 06:40:31 0000 -------
The same here. I had sys-libs/libcap-1.10 at first but now I have upgraded to
libcap-1.10-r2 and I still get the same error.

------- Comment #23 From Heinrich Wendel (RETIRED) 2003-09-02 06:45:19 0000 -------
ok so the problem is libcap, so what about just replacing 
 
#define HAVE_SYS_CAPABILITY_H 1 
 
with 
 
/* #undef HAVE_SYS_CAPABILITY_H */ 
 
this should work 

------- Comment #24 From Michal Januszewski 2003-09-02 06:51:44 0000 -------
This will work but this will also remove any useable features provided by
sys/capability.h (if there are any). #define _LINUX_VFS_H makes it possible to
skip only the part that causes problems and use all the rest.

------- Comment #25 From Heinrich Wendel (RETIRED) 2003-09-02 06:59:26 0000 -------
ok, i now understand the problem ;) 
 
will apply your fix later today 

------- Comment #26 From Heinrich Wendel (RETIRED) 2003-09-02 09:06:33 0000 -------
ok, fixed and marked stable :)