Bug 75 - Error compiling in ssh-agent.c
Summary: Error compiling in ssh-agent.c
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: ix86 Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-23 15:10 AEDT by Adrian Sanabria
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Sanabria 2002-01-23 15:10:13 AEDT
I am compiling with all the defaults, using the latest versions of ZLIB and OpenSSL. I am also using 
GNU Make, GCC, and all the other standards. Nothing out of the ordinary.

After compiling 
quite a bit of code, it fails with the following error:

gcc -g -02 -Wall -Wpointer-arith -Wno-
uninitialized -I. -I. 
-I/usr/local/ssl/inlclude -DETCDIR=\"/usr/local/etc\" 
-
D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" 
-
D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" 
-
D_PATH_SFTP_SERVER=\"/usr/local/libexec/sftp-server\" 
-
D_PATH_SSH_PIDDIR=\"/var/run\" 
-DHAVE_CONFIG_H -c ssh-agent.c
ssh-agent.c:1018: macro 
'atexit' used with just one arg
make: *** [ssh-agent.o] Error 1
Comment 1 Damien Miller 2002-01-23 17:16:06 AEDT
AFAIK atexit() should only take one arg. It looks like configure might not be
finding your libc atexit() and is using the compat macro in defines.h. What does
configure report when it looks for atexit()?

Ben, the compat macro looks wrong too. It is currently defined as:

# define atexit(a, NULL) on_exit(a, NULL)

shouldn't it be:

# define atexit(a) on_exit(a, NULL)

??


Comment 2 Adrian Sanabria 2002-01-24 15:21:14 AEDT
The configure report has both HAVE_XATEXIT and HAVE_ATEXIT commented out. It
looks like 
so:

/* If you have no atexit() but xatexit(), and want to use xatexit() */
/* #undef 
HAVE_XATEXIT */

and also

/* Define if you have the 'atexit' function. */
/* #undef 
HAVE_ATEXIT */

Is there a library I'm missing? I'm not familiar with the atexit 
function
and I'm not sure what I need to install to satisfy it.
Comment 3 Damien Miller 2002-01-24 15:39:33 AEDT
What linux distribution are you using? What version of libc? Can you grep
through /usr/include/stdlib.h for an atexit() definition?
Comment 4 Adrian Sanabria 2002-01-24 23:18:29 AEDT
I am using Peanut Linux 8.4 (http://www.peanutlinux.org), which is just a stripped down version 
of linux that uses BSD-style init scripts. I am running kernel 2.2.19 with pretty standard 
features, nothing strange or experimental compiled in.

I am using GLibc 2.2.4, libc6 
ELF.

The atexit definition(s) I have in stdlib.h are as follows:
(I wasn't sure which one 
was more pertinent)

/* Register a function to be called when 'exit' is called. */
extern int 
atexit __P ((void (*__func) (void)));

/* Call all functions registered with 'atexit' and 
'on_exit',
   in the reverse of the order in which they were registered
   perform stdio cleanup, 
and terminate program execution with STATUS. */
extern void exit __P ((int __status)) 
__attribute__ ((__noreturn__));
Comment 5 Adrian Sanabria 2002-01-27 00:59:07 AEDT
After doing some research, and noticing that I get similar errors when compiling other software 
(like the GMP library), it looks like my problem may be GLibc and/or GCC related. When I try to 
compile GMP, I get undefined reference to 'atexit()'. It looks like a patch for this issue for GCC-
2.95.3 is available. Here are the links I used to come to this 
conclusion

http://www.winehq.com/hypermail/wine-
users/2001/06/0049.html
http://sources.redhat.com/ml/libc-alpha/2001-
03/msg00048.html
http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01187.html

So, in 
short, it looks like the bug may not be with the SSH source, but with the tools I'm using. I will let 
you know if patching GCC resolves this problem so we can get this bug closed out.
Comment 6 Kevin Steves 2002-04-05 18:58:28 AEST
ssh-agent doesn't use atexit() now.
closing.
should we remove atexit stuff from portable defines.h etc?
Comment 7 Adrian Sanabria 2002-04-07 05:20:30 AEST
I now believe this whole problem was due to a library version conflict I was having with this Linux 
box. I wouldn't worry too much about atexit(), this is the only box I've ever had this problem with, 
and I got similar errors when trying to compile other stuff.

Keep up the good work!
Comment 8 Damien Miller 2004-04-14 12:24:17 AEST
Mass change of RESOLVED bugs to CLOSED