Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36200 - net-fs/samba-3.0.1 does not compile: quotas.c
Summary: net-fs/samba-3.0.1 does not compile: quotas.c
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
: 36218 36275 36387 (view as bug list)
Depends on:
Blocks: 36454
  Show dependency tree
 
Reported: 2003-12-20 13:34 UTC by FieldySnuts
Modified: 2004-02-27 14:38 UTC (History)
16 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portage log (1732-samba-3.0.1.log,31.14 KB, text/plain)
2003-12-20 13:34 UTC, FieldySnuts
Details
portage log (using /usr/src/linux-2.4.23 instead of /usr/src/linux-2.6.0) (1732-samba-3.0.1.log,62.29 KB, text/plain)
2003-12-20 13:41 UTC, FieldySnuts
Details
The patch that fixed problems with quotas.c for me (samba-3.0.1-quotas.patch,394 bytes, patch)
2003-12-21 02:53 UTC, Michal Januszewski (RETIRED)
Details | Diff
emerge log (proto.h error) (samba-3.0.1.log.bz2,6.68 KB, application/x-bzip2)
2003-12-21 09:37 UTC, JG
Details
Ebuild that applies the patch (samba-3.0.1.ebuild,10.97 KB, text/plain)
2003-12-23 14:06 UTC, David Li
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FieldySnuts 2003-12-20 13:34:14 UTC
net-fs/samba-3.0.1 fails to compile. The problem seems to be at quotas.c.

Please see my upcoming portage log attachment.


Portage 2.0.49-r7 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0)
=================================================================
System uname: 2.6.0 i686 AMD Athlon(TM) XP 1800+
distcc 2.11 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -funroll-loops -fprefetch-loop
-arrays -pipe -mmmx -msse -m3dnow -mfpmath=sse,387"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/confi
g /usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/co
nfig"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -funroll-loops -fprefetch-lo
op-arrays -pipe -mmmx -msse -m3dnow -mfpmath=sse,387"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox autoaddcvs buildpkg ccache notitles"
GENTOO_MIRRORS="http://gentoo.noved.org/ http://mirrors.tds.net/gentoo http://cu
dlug.cudenver.edu/gentoo/ http://mirror.tucdemonic.org/gentoo/ http://www.gtlib.
cc.gatech.edu/pub/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 oss apm avi crypt cups foomaticdb gif jpeg libg++ libwww mad mikmod mpe
g ncurses nls png quicktime spell xml2 xv zlib alsa gdbm berkdb slang readline a
alib svga java sdl tcpd pam ssl python imlib qt motif opengl mozilla ldap X gtk 
gtk2 gpm gnome 3dnow cdr dv encode kde mmx oggvorbis pdflib perl sse tiff truety
pe xmms -arts -esd -ipv6"
Comment 1 FieldySnuts 2003-12-20 13:34:41 UTC
Created attachment 22497 [details]
portage log
Comment 2 FieldySnuts 2003-12-20 13:40:33 UTC
In the portage log, I see this:

configure: WARNING: linux/quota.h: present but cannot be compiled
configure: WARNING: linux/quota.h: check for missing prerequisite headers?
configure: WARNING: linux/quota.h: proceeding with the preprocessor's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to bug-autoconf@gnu.org. ##
configure: WARNING:     ## ------------------------------------ ##

I realized that i had forgotten to change my /usr/src/linux symlink away from linux-2.6.0 , back to linux-2.4.23, recitfied this, and tried again.

This did not solve the problem. Attaching new log.
Comment 3 FieldySnuts 2003-12-20 13:41:36 UTC
Created attachment 22499 [details]
portage log (using /usr/src/linux-2.4.23 instead of /usr/src/linux-2.6.0)
Comment 4 FieldySnuts 2003-12-20 13:42:24 UTC
The warning about linux/quotas.h is in the second log, as well.
Comment 5 True 2003-12-20 13:49:43 UTC
I have this problem as well.
Comment 6 Christopher Rude 2003-12-20 14:03:37 UTC
same problem here as well
Comment 7 André Lemos 2003-12-20 15:32:11 UTC
o/
Comment 8 Jan Schubert 2003-12-20 16:50:08 UTC
same problem here running 2.6 on amd64
Comment 9 Jan-Peter Arndt 2003-12-20 17:44:51 UTC
I have the same Problem as well.

I searched a bit if this is problem is known anywhere and found this mail:
http://article.gmane.org/gmane.network.samba.internals/11457

According to this mail it seems that the problem may come from possible differences between the kernel headers and the functions actually provided by the kernel.

Portage 2.0.49-r18 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20031212-r0, 2.4.22-gentoo-r1)
=================================================================
System uname: 2.4.22-gentoo-r1 i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.3.12
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -mcpu=pentium3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apm arts avi berkdb crypt cups curl dga directfb doc dvd emacs encode fbcon foomaticdb gd gdbm ggi gif gnome gphoto2 gpm gtk gtk2 gtkhtml imap imlib java jikes jpeg kde libg++ libwww lirc mad maildir matroska mbox mikmod mmx motif mpeg ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png pnp python qt quicktime readline samba sdl slang spell sse ssl svga tcltk tcpd tetex tiff truetype trusted usb x86 xinerama xml xml2 xmms xv zlib"

Comment 10 Simon Cooper 2003-12-21 02:03:42 UTC
same problem, but mine spit out a little more debugging info:

Compiling smbd/quotas.c
In file included from /usr/include/linux/quota.h:40,
                 from smbd/quotas.c:65:
/usr/include/linux/spinlock.h: In function `bit_spin_lock':
/usr/include/linux/spinlock.h:413: error: invalid type argument of `->'
/usr/include/linux/spinlock.h: In function `bit_spin_trylock':
/usr/include/linux/spinlock.h:430: error: invalid type argument of `->'
/usr/include/linux/spinlock.h:433: error: invalid type argument of `->'
/usr/include/linux/spinlock.h:433: error: `TIF_NEED_RESCHED' undeclared (first use in this function)
/usr/include/linux/spinlock.h:433: error: (Each undeclared identifier is reported only once
/usr/include/linux/spinlock.h:433: error: for each function it appears in.)
/usr/include/linux/spinlock.h: In function `bit_spin_unlock':
/usr/include/linux/spinlock.h:451: error: invalid type argument of `->'
/usr/include/linux/spinlock.h:451: error: `TIF_NEED_RESCHED' undeclared (first use in this function)
smbd/quotas.c: In function `get_smb_linux_vfs_quota':
smbd/quotas.c:135: error: storage size of `D' isn't known
make: *** [smbd/quotas.o] Error 1

so what do we do about it?
Comment 11 Michal Januszewski (RETIRED) gentoo-dev 2003-12-21 02:52:48 UTC
I have experienced similar problems with quotas.c (storage size of D..). In my case a simple patch I created was enough to get samba to compile successfully. However, I had to disable rcptorture in the ebuild as they were name conflicts with global_myname (declared as pstring and as a function).
Comment 12 Michal Januszewski (RETIRED) gentoo-dev 2003-12-21 02:53:38 UTC
Created attachment 22515 [details, diff]
The patch that fixed problems with quotas.c for me
Comment 13 Patrick Fourniols 2003-12-21 04:42:14 UTC
for me updating linux-headers to 2.4.22 worked
Comment 14 Jan-Peter Arndt 2003-12-21 04:49:16 UTC
I simply emerged the same version of linux-headers as my kernelversion.
Previous: kernel gentoo-sources-2.4.22-r1 and linux-headers-2.4.21-r1.
Now: kernel gentoo-sources-2.4.22-r1 and linux-headers-2.4.22.
This solved my problems compiling samba-3.0.1

Like mentioned above I too noticed that there is a problem with rpctorture. It couldn't be build on my System but samba compiled anyway.
Comment 15 JG 2003-12-21 05:37:12 UTC
i'm using kernel 2.4.19 (nothing newer works on my system, either acpi or other stuff crashes) with linux-headers 2.4.19-r1, same error with quota.h...

JG
Comment 16 David Holm (RETIRED) gentoo-dev 2003-12-21 07:19:32 UTC
*** Bug 36218 has been marked as a duplicate of this bug. ***
Comment 17 Daniel Harik 2003-12-21 07:23:00 UTC
the patch worked fine for me
Comment 18 Haldir 2003-12-21 08:38:35 UTC
Updating kernel headers from 2.4.21 to 2.4.23 (my running kernel) fixed the problem here
Comment 19 JG 2003-12-21 09:37:18 UTC
Created attachment 22524 [details]
emerge log (proto.h error)

i guess there's also something wrong with the ebuild (or something else),
because it still doesn't compile. but i can compile it with the same configure
flags by hand.
attached is my samba emerge log. proto.h isn't found when emerging samba with
the ebuild, but it works when compiling by hand:

# make everything
Using FLAGS =  -O  -Iinclude
-I/usr/portage/distfiles/samba-3.0.1/source/include
-I/usr/portage/distfiles/samba-3.0.1/source/ubiqx
-I/usr/portage/distfiles/samba-3.0.1/source/smbwrapper	-I.
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-I/usr/portage/distfiles/samba-3.0.1/source
      LIBS = -lcrypt -lresolv -lnsl -ldl
      LDSHFLAGS = -shared
      LDFLAGS =
Generating smbd/build_options.c
Building include/proto.h
creating /usr/portage/distfiles/samba-3.0.1/source/include/proto.h
Building include/wrepld_proto.h
creating /usr/portage/distfiles/samba-3.0.1/source/include/wrepld_proto.h
Building include/build_env.h
creating /usr/portage/distfiles/samba-3.0.1/source/nsswitch/winbindd_proto.h
creating /usr/portage/distfiles/samba-3.0.1/source/web/swat_proto.h
creating /usr/portage/distfiles/samba-3.0.1/source/client/client_proto.h
creating /usr/portage/distfiles/samba-3.0.1/source/utils/net_proto.h
Compiling dynconfig.c
Compiling param/loadparm.c
Compiling param/params.c
Compiling smbd/files.c
Compiling smbd/chgpasswd.c
Compiling smbd/connection.c
Compiling smbd/utmp.c
[...]

i also needed to apply the patch for quotas.c when compiling by hand.

JG
Comment 20 Tony Vroon (RETIRED) gentoo-dev 2003-12-21 12:42:06 UTC
Just emerging linux-headers-2.4.22 fixed this.
Could ~x86 be added for this ebuild so people can compile samba again?
Comment 21 FieldySnuts 2003-12-22 09:11:00 UTC
I downgraded headers to 2.4.22 and I see the same problem.
Comment 22 Martin Holzer (RETIRED) gentoo-dev 2003-12-22 11:56:13 UTC
*** Bug 36275 has been marked as a duplicate of this bug. ***
Comment 23 FieldySnuts 2003-12-22 12:42:33 UTC
Regarding my earlier comment: "I downgraded headers to 2.4.22 and I see the same problem."...

I take care of my kernel sources and what not manually. I have in /usr/src/ linux-2.4.22 linux-2.4.23 linux-2.6.0 .

I simply point the symlink linux at any one of those to get the headers I want.

As far as I know this is the proper way. Or, am I wrong?
Comment 24 Dan Stephans II 2003-12-22 12:46:18 UTC
The problem I am seeing is the storage size of D.  It's in this section of quotas.c of the smbd compile:

#ifdef LINUX_QUOTAS_1
        struct dqblk D;
        ZERO_STRUCT(D);
        dp->bsize = (SMB_BIG_UINT)1024;
#else /* LINUX_QUOTAS_2 */
        struct mem_dqblk D;
        ZERO_STRUCT(D);

My /usr/include/linux/quota.h has a struct definition for dqblk but not for mem_dqblk (2.4.21-r1 linux-headers).  However, it appears as though the config script is not properly recognizing that I don't have mem_dqblk because the compile fails on struct mem_dqblk D; (ie something should be defining LINUX_QUOTAS_1 and isn't)

Dan
Comment 25 Dead Schorsch 2003-12-23 00:31:03 UTC
With respect to the patch from comment #12, how do I proceed from there, how do I prevent emerge from unpacking the unpatched source again?
Comment 26 Michal Januszewski (RETIRED) gentoo-dev 2003-12-23 00:46:18 UTC
> (ie something should be defining LINUX_QUOTAS_1 and isn't)

Defining LINUX_QUOTAS_1 instead of LINUX_QUOTAS_2 is exactly what the patch does. It's also worth noting that in the comments in quotas.c it says:

 * This shouldn't be neccessary - it should be /usr/include/sys/quota.h                                              
 * Unfortunately, RH7.1 ships with a different quota system using struct mem_dqblk                                   
 * rather than the struct dqblk defined in /usr/include/sys/quota.h.   

Since we are not RH7.1, changing the default LINUX_QUOTAS_2 to _1 seems to be the right thing to do.
Comment 27 Torsten Flammiger 2003-12-23 04:14:33 UTC
the patch worked fine for me
Comment 28 Ulrich Plate (RETIRED) gentoo-dev 2003-12-23 05:41:57 UTC
Don't like what I see, but Samba builds fine after changing LINUX_QUOTAS_2 
to LINUX_QUOTAS_1 in quotas.c

Anybody worried about rpctorture not compiling?
Comment 29 Donny Davies (RETIRED) gentoo-dev 2003-12-23 07:37:34 UTC
No.  You see it failing because I changed the ebuild to
show me it failing.  It hasnt built correctly in a while
but I wanted to keep informed about whats happening with it.

As for the quota patch; I personally flipped my headers
around so I could compile, before I released.

If people really want to see the submitted patch included
I guess I'll do that... but it's kind of a bummer.
Comment 30 Andrew Gaffney (RETIRED) gentoo-dev 2003-12-23 11:55:42 UTC
I was getting this same error. I'm running vanilla 2.6.0_beta8. I upgraded linux-headers to 2.6.0_beta11. I recompiled glibc and then samba. It compiled quotas.c without a hitch.
Comment 31 SpanKY gentoo-dev 2003-12-23 12:44:54 UTC
*** Bug 36387 has been marked as a duplicate of this bug. ***
Comment 32 Andrew Gaffney (RETIRED) gentoo-dev 2003-12-23 12:46:50 UTC
Hmm, so maybe that wasn't the way to go.

<snip>
Compiling utils/ntlm_auth.c
Compiling libsmb/spnego.c
libsmb/spnego.c: In function `read_negTokenInit':
libsmb/spnego.c:51: warning: passing arg 2 of `asn1_read_OID' from incompatible pointer type
libsmb/spnego.c: In function `read_negTokenTarg':
libsmb/spnego.c:186: warning: passing arg 2 of `asn1_read_OID' from incompatible pointer type
libsmb/spnego.c: In function `free_spnego_data':
libsmb/spnego.c:321: warning: passing arg 1 of `free' discards qualifiers from pointer target type
libsmb/spnego.c:330: warning: passing arg 1 of `free' discards qualifiers from pointer target type
Linking bin/ntlm_auth
Compiling utils/smbcquotas.c
Linking bin/smbcquotas
Compiling client/smbmount.c
In file included from /usr/include/linux/fs.h:9,
                 from /usr/include/linux/smb_fs.h:15,
                 from client/smbmount.c:27:
/usr/include/linux/config.h:4:28: linux/autoconf.h: No such file or directory
In file included from /usr/include/linux/fs.h:16,
                 from /usr/include/linux/smb_fs.h:15,
                 from client/smbmount.c:27:
/usr/include/linux/list.h:576:2: warning: #warning "don't include kernel headers in userspace"
make: *** [client/smbmount.o] Error 1

!!! ERROR: net-fs/samba-3.0.1 failed.
!!! Function src_compile, Line 164, Exitcode 2
!!! SAMBA pieces
Comment 33 David Li 2003-12-23 14:06:16 UTC
Created attachment 22596 [details]
Ebuild that applies the patch

This ebuild will apply the already posted patch. Just make sure the patch is in
the files folder.
Comment 34 Bryan Whitehead 2003-12-23 15:01:47 UTC
I get the same problem:
Compiling smbd/quotas.c
smbd/quotas.c: In function `get_smb_linux_vfs_quota':
smbd/quotas.c:135: error: storage size of `D' isn't known
make: *** [smbd/quotas.o] Error 1
 
!!! ERROR: net-fs/samba-3.0.1 failed.
!!! Function src_compile, Line 164, Exitcode 2
!!! SAMBA pieces
 

Some info that might help:
ls -al /usr/src/
total 33
drwxr-xr-x    5 root     root          240 Dec 23 11:46 .
drwxr-xr-x   15 root     root          520 Dec  4 17:07 ..
-rw-r--r--    1 root     root        25328 Dec  2 00:31 .config
-rw-r--r--    1 root     root            0 Dec  1 20:27 .keep
lrwxrwxrwx    1 root     root           19 Dec  2 00:18 linux -> linux-2.4.22-gentoo
drwxr-xr-x   16 root     root          808 Dec  2 00:51 linux-2.4.22-gentoo
drwxr-xr-x   16 root     root          808 Dec  2 15:31 linux-2.4.22-gentoo-r1
drwxr-xr-x   16 root     root          624 Dec 23 12:01 linux-2.4.22-gentoo-r2

I do not use quotas but have it built into the kernel:
# cd /usr/src/linux-`uname -r`
# grep -i quota .config
CONFIG_QUOTA=y
CONFIG_XFS_QUOTA=y
Comment 35 Donny Davies (RETIRED) gentoo-dev 2003-12-24 14:51:14 UTC
#define LINUX_QUOTAS_1 patch added to samba-3.0.1-r1

Many thanks to all,

Greetings.
Comment 36 FieldySnuts 2003-12-26 09:52:09 UTC
It now compiles for me.

Thanks a lot, great work!