Subject: Can't compile pine for Linux

From: Frank Ansari <[email-masked]>
Date: Sun, 19 May 1996 13:19:06 +0200

Hi!

I just got your package 'pine3.93.tar.gz'. I want to build it for
Linux. I use the S.u.S.E. distribution Dec 95 with Kernel 1.2.13 
and gcc version 2.7.0.

I unpacked the tar-file and hopefully entered 'build lnx'.
Obviously the compiler started its work and even brought up
'pico' and 'pilot'.

The problem is that there are several errors and the binary for
'pine' isn't built. 

Perhaps I have to take care for something *before* I start 'build'.
I hope you can help me to solve this problem.

Here is what the compiler says:

make args are "CC=cc "

Making c-client library, mtest and imapd
make build SYSTYPE=ANSI OS=lnx
make[1]: Entering directory `/home/fansari/ftp/pine/pine3.93/imap'
echo lnx > OSTYPE
rm -rf systype
ln -s ANSI systype
cd ANSI/c-client; make lnx
make[2]: Entering directory `/home/fansari/ftp/pine/pine3.93/imap/ANSI/c-client'
make mtest OS=lnx EXTRADRIVERS="" \
	STDPROTO=bezerkproto MAILSPOOL=/var/spool/mail \
	ACTIVEFILE=/usr/lib/news/active NEWSSPOOL=/var/spool/news \
	RSHPATH=/usr/bin/rsh CFLAGS="-g -O -DNFSKLUDGE "
make[3]: Entering directory `/home/fansari/ftp/pine/pine3.93/imap/ANSI/c-client'
./drivers  imap nntp pop3 mh tenex mtx mmdf bezerk news phile dummy
rm -f CCTYPE CFLAGS LDFLAGS osdep.h
echo cc > CCTYPE
echo -g -O -DNFSKLUDGE  > CFLAGS
echo   > LDFLAGS
ln -s os_lnx.h osdep.h
cc -g -O -DNFSKLUDGE    -c mail.c -o mail.o
cc -g -O -DNFSKLUDGE    -c bezerk.c -o bezerk.o
cc -g -O -DNFSKLUDGE    -c mtx.c -o mtx.o
cc -g -O -DNFSKLUDGE    -c tenex2.c -o tenex2.o
cc -g -O -DNFSKLUDGE    -c mbox.c -o mbox.o
cc -g -O -DNFSKLUDGE    -c mh.c -o mh.o
mh.c: In function `mh_ping':
mh.c:811: warning: passing arg 3 of `scandir' from incompatible pointer type
mh.c:811: warning: passing arg 4 of `scandir' from incompatible pointer type
mh.c: In function `mh_append':
mh.c:1053: warning: passing arg 3 of `scandir' from incompatible pointer type
mh.c:1053: warning: passing arg 4 of `scandir' from incompatible pointer type
cc -g -O -DNFSKLUDGE    -c mmdf.c -o mmdf.o
cc -g -O -DNFSKLUDGE    -c imap2.c -o imap2.o
cc -g -O -DNFSKLUDGE    -c pop3.c -o pop3.o
cc -g -O -DNFSKLUDGE    -c news.c -o news.o
news.c: In function `news_open':
news.c:313: warning: passing arg 3 of `scandir' from incompatible pointer type
news.c:313: warning: passing arg 4 of `scandir' from incompatible pointer type
cc -g -O -DNFSKLUDGE    -c nntpcunx.c -o nntpcunx.o
cc -g -O -DNFSKLUDGE    -c phile.c -o phile.o
cc -g -O -DNFSKLUDGE    -c dummy.c -o dummy.o
cc -g -O -DNFSKLUDGE    -c smtp.c -o smtp.o
cc -g -O -DNFSKLUDGE    -c nntp.c -o nntp.o
cc -g -O -DNFSKLUDGE    -c rfc822.c -o rfc822.o
cc -g -O -DNFSKLUDGE    -c misc.c -o misc.o
cc -g -O -DNFSKLUDGE  -DSTDPROTO=bezerkproto -DMAILSPOOL=\"/var/spool/mail\" \
-DACTIVEFILE=\"/usr/lib/news/active\" -DNEWSSPOOL=\"/var/spool/news\" \
-DRSH=\"rsh\" -DRSHPATH=\"/usr/bin/rsh\" \
 -c os_lnx.c
In file included from /usr/include/linux/socket.h:6,
                 from /usr/include/sys/socket.h:5,
                 from os_lnx.c:42:
/usr/include/linux/uio.h:18: redefinition of `struct iovec'
writev.c: In function `safe_writev':
In file included from env_unix.c:68,
                 from os_lnx.c:56:
writev.c:63: warning: passing arg 2 of `writev' from incompatible pointer type
env_unix.c: In function `env_init':
In file included from os_lnx.c:56:
env_unix.c:258: warning: passing arg 1 of `cpystr' discards `const' from pointer target type
tcp_unix.c: In function `tcp_open':
In file included from os_lnx.c:58:
tcp_unix.c:216: warning: passing arg 1 of `cpystr' discards `const' from pointer target type
tcp_unix.c: In function `tcp_aopen':
tcp_unix.c:293: warning: passing arg 1 of `cpystr' discards `const' from pointer target type
make[3]: *** [osdep.o] Error 1
make[3]: Leaving directory `/home/fansari/ftp/pine/pine3.93/imap/ANSI/c-client'
make[2]: *** [lnx] Error 2
make[2]: Leaving directory `/home/fansari/ftp/pine/pine3.93/imap/ANSI/c-client'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/fansari/ftp/pine/pine3.93/imap'
make: *** [lnx] Error 2

Making Pico and Pilot
rm -f osdep.c
cp os_unix.c osdep.c
rm -f osdep.h
cp os_unix.h osdep.h
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE attach.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE ansi.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE basic.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE bind.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE browse.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE buffer.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE composer.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE display.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE file.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE fileio.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE line.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE osdep.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE pico.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE random.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE region.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE search.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE spell.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE tcap.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE window.c
cc -c  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE word.c
ar ru libpico.a attach.o ansi.o basic.o bind.o browse.o buffer.o composer.o display.o file.o fileio.o line.o osdep.o pico.o random.o region.o search.o spell.o tcap.o window.o word.o
ar: creating libpico.a
ranlib libpico.a
cc  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE main.c libpico.a  -ltermcap -o pico
bfd assertion fail /opt/release/pub/bin/binutils/bfd/elfcode.h:4716
bfd assertion fail /opt/release/pub/bin/binutils/bfd/elf32-i386.c:624
cc  -g -Dlnx -DPOSIX -DJOB_CONTROL -DMOUSE pilot.c libpico.a  -ltermcap -o pilot
bfd assertion fail /opt/release/pub/bin/binutils/bfd/elfcode.h:4716
bfd assertion fail /opt/release/pub/bin/binutils/bfd/elf32-i386.c:624

Making Pine.
rm -f os.h
ln -s osdep/os-lnx.h os.h
./cmplhlp2.sh  < pine.hlp > helptext.h
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c addrbook.c -o addrbook.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c adrbklib.c -o adrbklib.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c args.c -o args.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c context.c -o context.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c filter.c -o filter.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c folder.c -o folder.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c help.c -o help.o
./cmplhelp.sh  < pine.hlp > helptext.c
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c helptext.c -o helptext.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c imap.c -o imap.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c init.c -o init.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c mailcap.c -o mailcap.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c mailcmd.c -o mailcmd.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c mailindx.c -o mailindx.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c mailpart.c -o mailpart.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c mailview.c -o mailview.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c newmail.c -o newmail.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c other.c -o other.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c pine.c -o pine.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c reply.c -o reply.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c screen.c -o screen.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c send.c -o send.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c signals.c -o signals.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c status.c -o status.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c strings.c -o strings.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c ttyin.c -o ttyin.o
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c ttyout.c -o ttyout.o
cd osdep; make includer os-lnx.c; cd ..
make[1]: Entering directory `/home/fansari/ftp/pine/pine3.93/pine/osdep'
cc -o includer includer.c
./includer < os-lnx.ic > os-lnx.c
make[1]: Leaving directory `/home/fansari/ftp/pine/pine3.93/pine/osdep'
rm -f os.c
ln -s osdep/os-lnx.c os.c
cc   -g -DDEBUG  -DLNX -DSYSTYPE=\"LNX\" -DMOUSE   -c os.c -o os.o
os.c: In function `canonical_name':
os.c:1013: warning: return discards `const' from pointer target type
make: *** No rule to make target `../c-client/c-client.a', needed by `pine'.  Stop.

Links to executables are in bin directory:
size: bin/pine: No such file or directory
size: bin/mtest: No such file or directory
size: bin/imapd: No such file or directory
text	data	bss	dec	hex	filename
152692 	22377  	2228   	177297 	2b491  	bin/pico
151620 	22256  	2228   	176104 	2afe8  	bin/pilot
Done

------------------------
Frank Ansari
[email-masked]
------------------------

---

From: Mark Crispin <[email-masked]>
Date: Sun, 19 May 1996 12:32:20 -0700

This problem depends upon what version of Linux you have, and is fixed
once and for all in Pine 3.94 (which should be released Real Soon Now).
The fix is fairly complex, so there isn't a patch.  Until 3.94 is out, you
can get prebuilt Linux binaries from our FTP server.  Our Linux systems
never have these problems...

If you're curious about what's wrong, read on.

The basic problem is that some organization which declared itself to be a
"Unix standards committee" decreed that the iov_base member of the iovec
struct used by writev() should be a void* instead of a caddr_t.  This
imbecilic change was made in spite of the fact that writev() was invented
on BSD, where it has been a caddr_t for many years.

Ordinarily, this would just be a minor footnote in the sordid history of
"Not Leaving Well Enough Alone on Unix", except for the fact that a
caddr_t can be indexed and a void* can't be.  It's not even a compiler
warning; it's a fatal error.  OK, so we put in the correct definition
since in other respects a void* and a caddr_t are equivalent.

But now let Linux rear its chameleon face.  Not only did Linux foolishly
adopt that change (some versions of Linux have the right one), but on the
systems which have it wrong, the wrong definition keeps on moving!  It's
been in sys/types.h, uio.h, socket.h(!), linux/uio.h -- seemingly every
time I nail down where it is, it moves someplace else.

If I were paranoid, I'd think that Richard Stallman was instigating it as
a plot to kill Pine. ;-)  [No wonder nothing ever came out of GNU OS
project...]

Anyway, writev() is gone in 3.94.  Most of the reasons for using it in the
past have become irrelevant.  It's been a long and frustrating process,
but as of 3.94 this problems should be gone forever.

> 151620 	22256  	2228   	176104 	2afe8  	bin/pilot

-- Mark --

DoD #0105, R90/6 pilot, FAX: (206) 685-4045  ICBM: N 47 39'35" W 122 18'39"
Science does not emerge from voting, party politics, or public debate.