Bug 1017 - socklen_t test in configure fails/configure stops
Summary: socklen_t test in configure fails/configure stops
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 4.0p1
Hardware: PPC AIX
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: low-hanging-fruit
Depends on:
Blocks:
 
Reported: 2005-04-19 00:20 AEST by Mark Lucking
Modified: 2006-10-07 11:39 AEST (History)
0 users

See Also:


Attachments
config.log for openssh socklen_t problem (31.96 KB, text/plain)
2005-04-19 00:24 AEST, Mark Lucking
no flags Details
config.log (the right one this time) (556.53 KB, text/plain)
2005-04-19 16:45 AEST, Mark Lucking
no flags Details
Fresh tar ball, fresh configure ... (556.53 KB, text/plain)
2005-04-19 20:22 AEST, Mark Lucking
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lucking 2005-04-19 00:20:41 AEST
Running 
libgcc-3.3.2-5
gcc-3.3.2-5
gcc-c++-3.3.2-5
AIX 5200-05
Run configure --with-cflags="-O -D__STR31__" --with-ssl-dir=/usr/local/ssl
Fails on socklen_t test with message

checking for socklen_t... no
checking for socklen_t equivalent... configure: error: Cannot find a type to 
use in place of socklen_t

Also issues warnings agains't 32 modules that are apprently present but cannot 
be compiled... eg...

configure: WARNING: zlib.h: present but cannot be compiled
configure: WARNING: zlib.h:     check for missing prerequisite headers?
configure: WARNING: zlib.h: see the Autoconf documentation
configure: WARNING: zlib.h:     section "Present But Cannot Be Compiled"
configure: WARNING: zlib.h: proceeding with the preprocessor's result
configure: WARNING: zlib.h: in the future, the compiler will take precedence
configure: WARNING:     ## ---------------------------------- ##
configure: WARNING:     ## Report this to the OpenSSH lists.  ##
configure: WARNING:     ## ---------------------------------- ##

Modules that appear to fail?

crypt.h
 dirent.h
 glob.h
 libgen.h
 limits.h
 login.h
 netdb.h
 netinet/in_systm.h
 paths.h
 rpc/types.h
 security/pam_appl.h
 stddef.h
 sys/audit.h
 sys/cdefs.h
 sys/dir.h
 sys/mman.h
 sys/select.h
 sys/stream.h
 sys/stropts.h
 sys/sysmacros.h
 sys/time.h
 sys/timers.h
 sys/un.h
 time.h
 ttyent.h
 usersec.h
 utime.h
 utmp.h
 utmpx.h
 zlib.h
Comment 1 Mark Lucking 2005-04-19 00:24:10 AEST
Created attachment 880 [details]
config.log for openssh socklen_t problem
Comment 2 Darren Tucker 2005-04-19 00:55:32 AEST
(In reply to comment #0)
> Run configure --with-cflags="-O -D__STR31__" --with-ssl-dir=/usr/local/ssl

Why are you adding -D__STR31__ and does the configure fail if you omit this?

> checking for socklen_t... no
> checking for socklen_t equivalent... configure: error: Cannot find a type to 
> use in place of socklen_t

Could you please attach the file "config.log" from the build directory (as
opposed to the output of configure, the former contains far more details).
Comment 3 Mark Lucking 2005-04-19 16:45:46 AEST
Created attachment 881 [details]
config.log (the right one this time)
Comment 4 Mark Lucking 2005-04-19 16:56:27 AEST
Hi,

Noted the output from the configure script on my box for these sizes was wrong, 
I got all 0's. Surely significant.

checking size of char... 1
checking for short int... yes
checking size of short int... 2
checking for int... yes
checking size of int... 4
checking for long int... yes
checking size of long int... 4
checking for long long int... yes
checking size of long long int... 8
Comment 5 Darren Tucker 2005-04-19 17:27:14 AEST
(In reply to comment #4)
> Noted the output from the configure script on my box for these sizes was
> wrong, I got all 0's. Surely significant.

Yeah, that'll do it.  This appears to be the underlying cause:

> checking for sys/types.h... no

Do you have /usr/include/sys/types.h, and is it world readable?  On my 5.2 box:

$ ls -l /usr/include/sys/types.h
-r--r--r--   1 bin  bin  15489 Jun 23 2004  /usr/include/sys/types.h

For the record, Mark also reports that the IBM build instructions for OpenSSH
include the "-D__STR31__" although I'm not sure why.  It doesn't seem to make
any difference on my box, it works with and without it.

http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/aixbman/security/openssh.htm

Hmm, it appears that -D__STR31__ will prevent many string functions (including
memset() from being inlined):
http://www.unet.univie.ac.at/aix/aixbman/prftungd/desnimpl.htm

Perhaps that's something that we should add to CFLAGS or config.h for all AIXes?
Comment 6 Darren Tucker 2005-04-19 17:42:18 AEST
Comment on attachment 881 [details]
config.log (the right one this time)

>It was created by OpenSSH configure Portable, which was
>generated by GNU Autoconf 2.58.  Invocation command line was

Hey, did you edit configure.ac and rebuild configure?  The configure that ships
with 4.0p1 was built with autoconf-2.59.
Comment 7 Mark Lucking 2005-04-19 18:01:43 AEST
Ok,

Check for gvasrcsm01(lucm02a):/usr/include/sys $ ls -l types*
-r--r--r--   1 bin      bin           15489 Jun 22 2004  types.h
Its there and has correct permissions.

Yes I installed and rebuilt configure to try and fix the problem, although I 
did not change the *.ac file. I have tried it again with the original configure 
and I get the same problem. Sorry I forgot to mention that. No other changes 
made honest.

Mark
Comment 8 Mark Lucking 2005-04-19 18:07:56 AEST
Ok,

Check for gvasrcsm01(lucm02a):/usr/include/sys $ ls -l types*
-r--r--r--   1 bin      bin           15489 Jun 22 2004  types.h
Its there and has correct permissions.

Yes I installed and rebuilt configure to try and fix the problem, although I 
did not change the *.ac file. I have tried it again with the original configure 
and I get the same problem. Sorry I forgot to mention that. No other changes 
made honest.

Looked more carefully @ the config.log. The programs to test the sizes of the 
various types don't seem correct to me...

 int
| main ()
| {
| if ((char *) 0)
|   return 0;
| if (sizeof (char))
|   return 0;
|   ;
|   return 0;
| }
configure:15236: result: no
configure:15239: checking size of char

This will surely always return 0??
Comment 9 Darren Tucker 2005-04-19 18:37:15 AEST
Actually it appears to come of the rails earlier than the types tests.  The
sys/types.h test fails because it's looking for a file "conftest.":

> configure:6648: checking for sys/types.h
> configure:6664: gcc -c  -O -D__STR31__  conftest.c >&5
> configure:6670: $? = 0
> configure:6674: test -z 
> 			 || test ! -s conftest.err
> configure:6677: $? = 0
> configure:6680: test -s conftest.
> configure:6683: $? = 1

This appears to be because configure can't figure out what the suffix of object
files is:

> checking for suffix of executables... 
> checking for suffix of object files... 

I can't figure out why as the config.log does not seem to match the code in
configure.  Could you please unpack a fresh openssh-4.0p1 tarball, run configure
and attach that config.log?
Comment 10 Mark Lucking 2005-04-19 20:22:50 AEST
Created attachment 882 [details]
Fresh tar ball, fresh configure ...

Fresh tar ball, fresh config, same problem... sorry.
Comment 11 Darren Tucker 2005-04-19 20:42:21 AEST
I'm still not sure what's fooling configure.  Can you try the compiling the
following test program with "gcc -c conftest.c" (preferably in an otherwise
empty directory)?  Check for any error messages and check which files gcc creates.

int main ()
{
  ;
  return 0;
}

You can also try adding "ac_cv_objext=.o" to the top of configure and see if
that helps.  It's not a proper fix obviously but it may get it built.
Comment 12 Mark Lucking 2005-04-19 21:44:47 AEST
Compiled ... here are the results..

gvasrcsm01(lucm02a):/home/lucm02a $ cd test
gva(lucm02a):/home/lucm02a/test $ ls
conftest.c  conftest.o
gva(lucm02a):/home/lucm02a/test $ cat conftest.c
int main ()
{
  ;
  return 0;
}
gva(lucm02a):/home/lucm02a/test $gvasrcsm01(lucm02a):/home/lucm02a/test 
$ ./conftest.o
Could not load program ./conftest.o:
        The .loader section does not exist.

Working on configure with the option you mentioned...
Comment 13 Mark Lucking 2005-04-19 21:58:22 AEST
FOUND IT...

Sorry your all going to kill me. We're running a logging environment here that 
intercepts some commands and logs their use. Not sure yet which one is on the 
cuprit but it appears to be upsetting the configure.

Disabling environment fixes the problem!

Mark
Comment 14 Darren Tucker 2006-10-07 11:39:41 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.