Subject: Compilation problems under Linux

From: Lindsay Haisley <[email-masked]>
Date: Wed, 9 Oct 1996 20:37:28 -0500 (CDT)

I've tried compiling two different versions of wu-ftpd under Linux and both
of them fail to compile.  With wu-ftpd-2.4-fixed I managed to compile all of
the utilites, but ftpd failed with an error in the compilation of glob.o.  I
tried compiling wu-ftpd-2_4_2-beta-11, and didn't even get that far.  The
only utility which compiled was ckconfig.  I'm running Linux kernel 2.0.21,
gcc 2.7.2, libc's 4.7.2 and 5.2.18 as recommended for the Linux 2.0.x kernel
series.  Any help would be very much appreciated.  I might note that I've
compiled a good number of packages on this system and although some of them
need a bit of touch-up, I've yet to find one that wouldn't compile.

The output of an aborted build is as follows:

# build lnx
make args are : 
make opts are : 

Linking Makefiles.

Making support library.
rm -f libsupport.a
ar cq libsupport.a fnmatch.o strcasestr.o authuser.o 
ranlib libsupport.a

Making ftpd.
gcc -O2 -fomit-frame-pointer -I.. -I../support -I/usr/include/bsd -L../support -s   -c glob.c -o glob.o
glob.c: In function `matchdir':
glob.c:284: dereferencing pointer to incomplete type
make: *** [glob.o] Error 1

Making ftpcount.
gcc -O2 -fomit-frame-pointer -I.. -I../support -I/usr/include/bsd -L../support -s -o ftpcount ftpcount.c vers.o -lsupport -lbsd 
gcc: vers.o: No such file or directory
make: *** [ftpcount] Error 1

Making ftpshut.
gcc -O2 -fomit-frame-pointer -I.. -I../support -I/usr/include/bsd -L../support -s -o ftpshut ftpshut.c vers.o -lsupport -lbsd 
gcc: vers.o: No such file or directory
make: *** [ftpshut] Error 1

Making ckconfig.
make: `ckconfig' is up to date.

Links to executables are in bin directory:
size: bin/ftpd: No such file or directory
size: bin/ftpcount: No such file or directory
size: bin/ftpshut: No such file or directory
size: bin/ftpwho: No such file or directory
text	data	bss	dec	hex	filename
1092   	1873   	92     	3057   	bf1    	bin/ckconfig
Done

-- 
Lindsay Haisley          | "Everything works     |   PGP public key
FMP Computer Services    |       if you let it"  |   available via
[email-masked]           |    (The Roadie)       |   Internet finger
http://www.fmp.com       |                       |

---

From: "Peter C. Norton" <[email-masked]>
Date: Thu, 10 Oct 1996 12:17:37 -0400 (EDT)

Could you detail your system?  Distribution, kernel version, etc?  If you're
using redhat or debian, there are pre-built packages for wu-ftpd, and you
can get the source packages for these systems as well.

-- 
Faster isn't better.  Better is better.

[email-masked] 
http://www.sensenet.com
Systems Administrator, Sensenet, Inc.

---

From: Perry Rovers <[email-masked]>
Date: Thu, 10 Oct 1996 21:06:06 +0200 (MET DST)

> the utilites, but ftpd failed with an error in the compilation of glob.o.  I
I'd like to know the solution to this one as well.. It is a known problem 
cos' I've seen it referenced on some linux mailinglists but I never saw 
the patch for it. The vers.o problem will go away if you run sh 
newvers.sh in the src directory. Apparently the sh newvers.sh line in the 
makefile is not always run for some reason. If you do this manually, it 
will work and all programs will compile except ftpd (but that's the other 
problem, with glob)

Perry Rovers, Amsterdam (and a number of other places), The Netherlands
Mail: mailto:[email-masked]       | Amsterdam is zo'n gezellige stad
FTP : ftp://ftp.iaehv.nl/pub/users/perry | omdat er zo verdomd veel
WWW : http://www.iaehv.nl/users/perry    | Brabanders wonen - Hans van Mierlo

---

From: "Walter Harms" <[email-masked]>
Date: Fri, 11 Oct 1996 10:24:38 +0200 (MET DST)

> make: *** [ftpshut] Error 1
	please check your paths, exspecialy includes via gcc -v
	it looks like that some how your inlcude path are scrued up.

	walter

-- 
-----
"Let's just say that on *this* ship--or probably any other--
 you don't want to wear a red shirt on landing-party duty."
-----

---

From: Brian Beaulieu <[email-masked]>
Date: Fri, 11 Oct 1996 13:12:14 -0400 (EDT)

> will work and all programs will compile except ftpd (but that's the other 

To get around that, I commented out lines 240 and 241 in glob.c .. it
compiles after that.

Brian

==================================
CAPE Internet System Administrator
http://www.capecod.net
http://despair.capecod.net
[email-masked]
==================================

---

From: Bill Levering <[email-masked]>
Date: Fri, 11 Oct 1996 10:30:02 -0700

>will work and all programs will compile except ftpd (but that's the other
I'm getting sick of this problem...

This was compiled in a Linux 1.2.13 machine... just place it in the src
tree and go.

Ftp compiled fine on a Linux 2.0.21 machine once the glob.c file was placed.
Bill Levering                            ISP Manager
[email-masked]                          Seattle, Wa
-----------------------------------------------------
DluxNet                                (206) 812-2769
Fax                                    (206) 622-3066
http://www.dlux.net/                   (206) 812-2772
-----------------------------------------------------

---

From: Vincent Cojot <[email-masked]>
Date: Fri, 11 Oct 1996 13:39:11 -0400 (EDT)

IF the error is something like:

> > > > When compiling I get the following error: 
> > > > glob.c: in function 'matchdir': 
> > > > glob.c: 240: dereferencing pointer to incomplete type 
> > > > make: *** [glob.c] error 1 

Then, in your CFLAGS, add "-DDIRENT_ILLEGAL_ACCESS". That will fix the 
problem under Linux.

,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
Vincent S. Cojot, Computer Engineering. STEP project. _.,-*~'`^`'~*-,._.,-*~
Ecole Polytechnique de Montreal, Comite Micro-Informatique. _.,-*~'`^`'~*-,.
Linux Xview/OpenLook resources page _.,-*~'`^`'~*-,._ [email-masked]
http://www.info.polymtl.ca/~coyote  _.,-*~'`^`'~*-,._ [email-masked]

They cannot scare me with their empty spaces
Between stars - on stars where no human race is
I have it in me so much nearer home
To scare myself with my own desert places.       - Robert Frost

---

From: James Sneeringer <[email-masked]>
Date: Fri, 11 Oct 1996 13:00:14 -0500 (CDT)

On Thu, 10 Oct 1996, Perry Rovers wrote:
| On Wed, 9 Oct 1996, Lindsay Haisley wrote:
| > I've tried compiling two different versions of wu-ftpd under Linux and
| > both of them fail to compile.  With wu-ftpd-2.4-fixed I managed to
| > compile all of the utilites, but ftpd failed with an error in the
| > compilation of glob.o.  I
|
| I'd like to know the solution to this one as well.. It is a known
| problem cos' I've seen it referenced on some linux mailinglists but I
| never saw the patch for it. 

Under Linux, I've observed the following (for beta11):

wu-ftpd will not compile on very recent distributions.  For instance, it
will not compile with out-of-the-box Slackware 3.1.

wu-ftpd will compile with older distributions.  I was able to successfully
compile it with Slackware 3.0 and 2.3 systems.  Libraries don't seem to be
an issue, since all were using recent ELF libs, and with 2.x kernels.

| The vers.o problem will go away if you run sh newvers.sh in the src
| directory. Apparently the sh newvers.sh line in the makefile is not
| always run for some reason. If you do this manually, it will work and
| all programs will compile except ftpd (but that's the other problem,
| with glob) 

It normally is run when ftpd is compiled, just before it links the
daemon.  In this case, it doesn't get run because glob.c fails, so make
aborts compilation for the ftpd rule and jumps to the next rule (which of
course also fails, because vers.c is missing).

-James

---

From: Brian Beaulieu <[email-masked]>
Date: Fri, 11 Oct 1996 14:02:52 -0400 (EDT)

> 	it looks like that some how your inlcude path are scrued up.

You will get those compilation errors when you don't successfully compile
ftpd.  (vers.c is compiled after glob.c) ... 

Brian

---

From: Tony Hriczo <[email-masked]>
Date: Fri, 11 Oct 1996 02:05:04 -0500 (EST)

I also experienced this problem, however, a fix was posted on comp.os.linux
the following is a reproduction of the post:

> Mark Andrew DePristo <[email-masked]> wrote:
> 
> > I just downloaded wu-ftpd-2.4.fixed from sunsite.unc.edu.  Having
> > already installed shadowed passwords, I tried to compile wu-ftpd with
> > gcc 2.7.2.  However, I recieved the following error
>  
> > Making ftpd.
> > gcc -O2 -I.. -I../support -I/usr/include/bsd -I/usr/include/netinet
> > -L../support
> >    -c glob.c -o glob.o
> > glob.c:240: dereferencing pointer to incomplete type
> > Help! 
> You are not the only one to have hit this problem.  I spent some time fishing
> around, leading me into /usr/include/dirent.h of the libc5.3.12 include file
> where it seems certain accesses to the directory structure have been made
> illegal or "use at your own risk."
>  
> I SEEM to have fixed the problem by adding a line
>         #define DIRENT_ILLEGAL_ACCESS
> into the glob.c source file inside of the first clause of type
>         #ifdef HAVE_DIRENT
>         >> put above line here !! <<
>         #include <dirent.h>
>         #else
>         BLAHBLAH
>  
> I am quite new to Linux and Unix codeing, so I would feel more comfortable
> if someone with more experience could assure us both that my mod was correct.
>  
> In the meantime, it seems to work ok.
>  
> Hope this helps.
>  
> -Stan

///Tony

---

From: Lindsay Haisley <[email-masked]>
Date: Fri, 11 Oct 1996 16:12:42 -0500 (CDT)

The quick and dirty solution, actually sanctioned by Academ Software, is pretty
easy.  Just place the line:

in glob.c before the #includes.  If you're having this problem, look in
/usr/include/dirent.h and you'll see the reason for it.  The code goes rather
out of its way to hide the details of the DIR structure.  This #define
essentially says "Yes, I know I'm doing a Bad Thing, but let me do it anyway"
and everything compiles properly.

The problem is supposed to be fixed in beta 12, and apparently only affects
people who have upgraded their libs.

---

From: [email-masked] (Alvin Oga)
Date: Fri, 11 Oct 1996 15:38:11 -0700 (PDT)

Hi
> I'd like to know the solution to this one as well..

I fixed my compilation problems for wu-ftpd-2.4-fixed  by:
	a. running build lnx
	b. modifying src/pathnames.h 
	c. watch out for shadow stuff too if you have it vs don't have it

Otherwise, it compiles fine on my linux-2.0.0 w/ gcc-2.7.2

Maybe you also need to add:
	typedef int pid_t;	in src/config.h ???

hope that helps..
alvin

> It is a known problem