Hello, Was looking in the archives... and haven't seen this one listed. When I compile openssh-1.2pre17 on AIX v4.3.3 with the native compiler I get the following errors. I haven't see this __attribute__ code.. What compiler/libraries are needed to compile this? I have seen that people have compiled openssh on AIX.. Just wondering what you have used. # make cc -g -I/usr/local/include -DETCDIR=\"//etc\" -DSSH_PROGRAM=\"//bin/ssh\" -DSSH_ASKPASS_DEFAULT=\"//libexec/ssh/ssh-askpass\" -DHAVE_CONFIG_H -c atomicio.c "ssh.h", line 494.36: 1506-276 (S) Syntax error: possible missing '{'? make: 1254-004 The error code from the last command is 1. The code is below... /* Output a message to syslog or stderr */ void fatal(const char *fmt,...) __attribute__((format(printf, 1, 2))); void error(const char *fmt,...) __attribute__((format(printf, 1, 2))); void log(const char *fmt,...) __attribute__((format(printf, 1, 2))); void verbose(const char *fmt,...) __attribute__((format(printf, 1, 2))); void debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); Any suggestions? Any help would be greatly appreciated! EdGy
> void fatal(const char *fmt,...) __attribute__((format(printf, 1, 2)));try this: Index: cipher.c ==================================================================RCS file: /cvs/src/usr.bin/ssh/cipher.c,v retrieving revision 1.18 diff -u -r1.18 cipher.c --- cipher.c 1999/11/24 19:53:45 1.18 +++ cipher.c 1999/12/07 13:30:41 @@ -106,7 +106,7 @@ void (*cipher_attack_detected) (const char *fmt,...) = fatal; -static inline void +static INLINE void detect_cbc_attack(const unsigned char *src, unsigned int len) { Index: includes.h ==================================================================RCS file: /cvs/src/usr.bin/ssh/includes.h,v retrieving revision 1.11 diff -u -r1.11 includes.h --- includes.h 1999/11/24 19:53:47 1.11 +++ includes.h 1999/12/07 13:30:41 @@ -57,6 +57,18 @@ #include "version.h" +#ifdef __GNUC__ +# if __GNUC__ < 2 +# define INLINE inline +# define __attribute__(x) +# else +# define INLINE __inline__ +# endif /* __GNUC__ < 2 */ +#else +# define __attribute__(x) +# define INLINE +#endif /* __GNUC__ */ + /* Define this to be the path of the xauth program. */ #define XAUTH_PATH "/usr/X11R6/bin/xauth"
Thanks for your help, That patch fixed the first error I encountered.. Here is another perhaps you might have a suggestion. It is having problems with two extern declarations with different types and same name. Sorry to keep posting but I just started looking at this source tree and I am not comfortable making changes.. There are much better people to decide what to change then I :) cc -g -I/usr/local/include -DETCDIR=\"//etc\" -DSSH_PROGRAM=\"//bin/ssh\" -DSSH_ASKPASS_DEFAULT=\"//libexec/ssh/ssh-askpass\" -DHAVE_CONFIG_H -c channels.c "channels.c", line 390.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 418.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 448.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 1014.34: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "channels.c", line 1021.55: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "channels.c", line 1121.30: 1506-343 (S) Redeclaration of options differs from previous declaration on line 884 of "channels.c". "channels.c", line 1121.30: 1506-382 (I) The type "struct {...}" of identifier options differs from previous type "struct {...}". "channels.c", line 1230.49: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. make: 1254-004 The error code from the last command is 1. void channel_request_local_forwarding(u_short port, const char *host, u_short host_port) { int ch, sock, on = 1; struct sockaddr_in sin; extern Options options; and the other is char * x11_create_display_inet(int screen_number) { extern ServerOptions options; int display_number, sock; Just wondering if the warnings could be fixed... "channels.c", line 390.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. newsock = accept(ch->sock, &addr, &addrlen); addrlen is declared as int but my docs say... #include <sys/types.h> #include <sys/socket.h> int accept (Socket, Address, AddressLength) int Socket; struct sockaddr *Address; size_t *AddressLength; EdGy
edgy at us.ibm.com wrote:> That patch fixed the first error I encountered.. Here is anotherperhaps> you might have a suggestion. It is having problems with two externdeclarations> with different types and same name. Sorry to keep posting but I juststarted> looking at this source tree and I am not comfortable making changes..There> are much better people to decide what to change then I :)Excuse the bad parsing of this message, Outlook at fixed width may or may not butcher this message badly (please send any replies and/or CC: to my work address, Darren_Hall at progressive.com I can't seem to get Outlook to added Reply-to headers either =( ) Btw: I have a patch for configure.in to incorporate looking for GNU C compiler and #ifndef the "attribute(x)", as well as check against a native inline. I've been attempting to port over openssh to AIX 4.2.1 (and correspondingly to 4.3.2 / 4.3.3) The problem is "Options options" and "ServerOptions options", defined within ssh.c and sshd.c respectively. I believe channels.c attempt to locally define them within individual functions, unfortunately AIX's native compiler produces a more global scope. What side effects would occur if the ServerOptions options variable was changed to soptions? I just downloaded the source last night, and have been tinkering with it during the day. I've gotten it _very_ close to compiling (linker complained about an undefined options somewhere), before the end of the day. I also have done a lot of type casting to remove the frivilous warnings regarding (int *) != (unsigned int *). Let me know if I'm repeating any work done.
Darren_Hall at progressive.com
1999-Dec-14 19:12 UTC
openssh on AIX v4.3.3 with native compiler
The inline patch for configure.in *** configure.in Tue Dec 14 13:41:19 1999 --- configure.in~ Wed Dec 8 18:48:58 1999 *************** *** 55,63 **** AC_CHECK_LIB(dl, dlopen, , ) AC_CHECK_LIB(pam, pam_authenticate, , ) - dnl Checks for compiler characteristics - AC_C_INLINE - dnl Checks for header files. AC_CHECK_HEADERS(endian.h lastlog.h login.h maillock.h netgroup.h paths.h pty. h shadow.h util.h utmp.h utmpx.h sys/select.h sys/stropts.h sys/time.h) --- 55,60 ---- (autoheader should fixup the config.h.in) Someone already sent a nice #ifndef __GNUC__ to fix the __attribute__ issue to the list.>> I also have done a lot of type casting to remove the frivilous >> warnings regarding (int *) != (unsigned int *). Let me know if >> I'm repeating any work done.> i'll will look into these if time permits, could you please mail > the warnings to markus at openssh.com. it's .com not .org, alas."canohost.c", line 39.61: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "canohost.c", line 128.32: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "canohost.c", line 194.61: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "canohost.c", line 216.59: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 390.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 418.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 448.67: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "channels.c", line 1014.34: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "channels.c", line 1021.55: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "channels.c", line 1230.49: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshconnect.c", line 915.39: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 707.82: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "sshd.c", line 1144.42: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1427.57: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1450.57: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1498.54: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1786.50: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1831.59: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1832.58: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 1909.61: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "sshd.c", line 2167.58: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "ssh-keygen.c", line 104.52: 1506-280 (W) Function argument assignment between types "unsigned int*" and "int*" is not allowed. "ssh-agent.c", line 430.93: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed. "scp.c", line 1187.33: 1506-280 (W) Function argument assignment between types "void(*)(int)" and "void*" is not allowed.
Had a little more time to think about this, instead of just reacting to the compiler warnings. canohost.c line 39 getpeername, changed fromlen to size_t line 128 getsockopt, changed option_size to size_t line 194 getpeername, changed fromlen to size_t line 216 getpeername, changed fromlen to size_t A majority of these problems arise from AIX's compiler being fussy. I noticed on my current dist of Linux, getpeername's 3rd arg is defined as (int *) in the man page, and (socklen_t *) within the include file (which isn't defined within aix). channels.c line 390 accept, changed addrlen to size_t line 418 accept, changed addrlen to size_t line 448 accept, changed len to size_t line 1014 packet_get_string, host_len as size_t line 1021 packet_get_string, originator_len as size_t line 1230 packet_get_string, remote_len as size_t sshconnect.c line 915 packet_get_string, payload_len as size_t After digging around my dist to find exactly what typedef size_t was set to, I'll have to guess it's an unsigned long. It was far easier setting these variable to size_t, then going through and typecasting (size_t *) for each declaration of that function.>>>> Markus Friedl wrote: > channels.c has been fixed in OpenSSH-currentIs this the CVS version? I'm relatively new to openssh, so I haven't looked carefully at the relationship between the CVS/BSD version, as it compares to the ported version. Also with a little coax'ing, the Makefile is understood by non-gnu make; any consideration towards a more generic Makefile format?