Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-09 Thread Jean-Louis Martineau

Pieter Bowman wrote:

This is the case on both IRIX and OSF/1.  These compilers can't
handle:

#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
  


I fix it in the 2.5.2 tree, but the next release will require that 
syntax, which is in the C99 standard.

Do you have a C99 compiler on IRIX and OSF/1 ?

Jean-Louis


2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Jean-Francois Malouin
First go at amanda-2.5.2 on a system running irix-6.5.x
and compile fails with the error:


cc-1040 cc: ERROR File = amanda.h, Line = 623
  An identifier is expected.

  #define vstrallocf(...)
debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
 ^

cc-1204 cc: WARNING File = amanda.h, Line = 957
  The indicated declaration is not visible outside of the function.

  extern int check_security(struct sockaddr_storage *, char *,
unsigned long, char **);
   ^

1 error detected in the compilation of alloc.c.
make[1]: *** [alloc.lo] Error 1
make[1]: Leaving directory
`/stuff/amanda-source/amanda-2.5.2/common-src'
make: *** [all-recursive] Error 1


jf
-- 
° 


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread dustin
This is the same error as in
  http://groups.yahoo.com/group/amanda-hackers/message/5401
the same patch is attached here -- could you let us know if it fixes the
compile?

Dustin

On Mon, May 07, 2007 at 12:05:44PM -0400, Jean-Francois Malouin wrote:
 First go at amanda-2.5.2 on a system running irix-6.5.x
 and compile fails with the error:
 
 
 cc-1040 cc: ERROR File = amanda.h, Line = 623
   An identifier is expected.
 
   #define vstrallocf(...)
 debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
  ^
 
 cc-1204 cc: WARNING File = amanda.h, Line = 957
   The indicated declaration is not visible outside of the function.
 
   extern int check_security(struct sockaddr_storage *, char *,
 unsigned long, char **);
^
 
 1 error detected in the compilation of alloc.c.
 make[1]: *** [alloc.lo] Error 1
 make[1]: Leaving directory
 `/stuff/amanda-source/amanda-2.5.2/common-src'
 make: *** [all-recursive] Error 1
 
 
 jf
 -- 
 ? 

-- 
Dustin J. Mitchell
Storage Software Engineer, Zmanda, Inc.
http://www.zmanda.com/
diff -u -r --show-c-function --new-file 
--exclude-from=/home/martinea/src.orig/amanda.diff 
--ignore-matching-lines='$Id:' amanda-2.5.2/common-src/amanda.h 
amanda-2.5.2.sockaddr_storage/common-src/amanda.h
--- amanda-2.5.2/common-src/amanda.h2007-04-10 06:56:00.0 -0400
+++ amanda-2.5.2.sockaddr_storage/common-src/amanda.h   2007-05-04 
16:40:18.0 -0400
@@ -268,6 +268,9 @@ struct iovec {
 #include arpa/inet.h
 #endif
 
+#define sockaddr_storage sockaddr_in
+#define ss_family sin_family
+
 /* Calculate the length of the data in a struct sockaddr_storage.
  * THIS IS A HACK.
  *


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Jean-Francois Malouin
* Pieter Bowman [EMAIL PROTECTED] [20070507 13:27]:
 
  ...
  First go at amanda-2.5.2 on a system running irix-6.5.x
  and compile fails with the error:
  ...
 
 This is the case on both IRIX and OSF/1.  These compilers can't
 handle:
 
 #define vstrallocf(...) 
 debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
 
 The patch for sockaddr_storage seems to work with the addition of
 these two definitions in amanda.h:
 
 
 /* Needed on SGI IRIX 6.5 */
 #ifdef WORKING_IPV6
 #define INET6
 #endif
 
 #ifndef INET_ADDRSTRLEN
 #define INET_ADDRSTRLEN 16
 #endif
 
 Pieter

Thanks Jean-Louis and Pieter but still no go:


Making all in gnulib
make[1]: Entering directory `/stuff/amanda-source/amanda-2.5.2/gnulib'
rm -f stdbool.h-t stdbool.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
  sed -e 's/@''HAVE__BOOL''@/0/g'  ./stdbool_.h; \
}  stdbool.h-t
mv stdbool.h-t stdbool.h
rm -f string.h-t string.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'  \
  sed -e 's|@''ABSOLUTE_STRING_H''@|///usr/include/string.h|g' \
  -e 's|@''HAVE_DECL_MEMMEM''@|1|g' \
  -e 's|@''HAVE_MEMPCPY''@|1|g' \
  -e 's|@''HAVE_DECL_MEMRCHR''@|1|g' \
  -e 's|@''HAVE_STPCPY''@|1|g' \
  -e 's|@''HAVE_STPNCPY''@|1|g' \
  -e 's|@''HAVE_DECL_STRNCASECMP''@|1|g' \
  -e 's|@''HAVE_STRCHRNUL''@|1|g' \
  -e 's|@''HAVE_DECL_STRDUP''@|1|g' \
  -e 's|@''HAVE_STRNDUP''@|1|g' \
  -e 's|@''HAVE_DECL_STRNDUP''@|1|g' \
  -e 's|@''HAVE_DECL_STRNLEN''@|1|g' \
  -e 's|@''HAVE_STRPBRK''@|1|g' \
  -e 's|@''HAVE_STRSEP''@|1|g' \
  -e 's|@''HAVE_DECL_STRTOK_R''@|1|g' \
  -e 's|@''REPLACE_STRCASECMP''@|0|g' \
  -e 's|@''REPLACE_STRSTR''@|0|g' \
  -e 's|@''REPLACE_STRCASESTR''@|0|g' \
   ./string_.h; \
}  string.h-t
mv string.h-t string.h
/usr/local/bin/make  all-am
make[2]: Entering directory `/stuff/amanda-source/amanda-2.5.2/gnulib'
source='lock.c' object='lock.lo' libtool=yes \
DEPDIR=.deps depmode=sgi /bin/sh ../config/depcomp \
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. 
-I../config   -I/usr/freeware/include -D_GNU_SOURCE  -c -o lock.lo 
lock.c
mkdir .libs
 cc -DHAVE_CONFIG_H -I. -I. -I../config -I/usr/freeware/include -D_GNU_SOURCE 
-c lock.c -Wp,-MDupdate,.deps/lock.TPlo  -DPIC -o .libs/lock.o
 cc -DHAVE_CONFIG_H -I. -I. -I../config -I/usr/freeware/include -D_GNU_SOURCE 
-c lock.c -Wp,-MDupdate,.deps/lock.TPlo -o lock.o /dev/null 21
source='asnprintf.c' object='asnprintf.lo' libtool=yes \
DEPDIR=.deps depmode=sgi /bin/sh ../config/depcomp \
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. 
-I../config   -I/usr/freeware/include -D_GNU_SOURCE  -c -o asnprintf.lo 
asnprintf.c
 cc -DHAVE_CONFIG_H -I. -I. -I../config -I/usr/freeware/include -D_GNU_SOURCE 
-c asnprintf.c -Wp,-MDupdate,.deps/asnprintf.TPlo  -DPIC -o .libs/asnprintf.o
 cc -DHAVE_CONFIG_H -I. -I. -I../config -I/usr/freeware/include -D_GNU_SOURCE 
-c asnprintf.c -Wp,-MDupdate,.deps/asnprintf.TPlo -o asnprintf.o /dev/null 21
source='gai_strerror.c' object='gai_strerror.lo' libtool=yes \
DEPDIR=.deps depmode=sgi /bin/sh ../config/depcomp \
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. 
-I../config   -I/usr/freeware/include -D_GNU_SOURCE  -c -o 
gai_strerror.lo gai_strerror.c
 cc -DHAVE_CONFIG_H -I. -I. -I../config -I/usr/freeware/include -D_GNU_SOURCE 
-c gai_strerror.c -Wp,-MDupdate,.deps/gai_strerror.TPlo  -DPIC -o 
.libs/gai_strerror.o
cc-1084 cc: ERROR File = /usr/include/sys/socket.h, Line = 66
  The indicated declaration has an invalid combination of type specifiers.

  typedef int socklen_t;
  ^

cc-1101 cc: ERROR File = getaddrinfo.h, Line = 37
  addrinfo has already been declared in the current scope.

  struct addrinfo
 ^

cc-1143 cc: ERROR File = getaddrinfo.h, Line = 116
  Declaration is incompatible with int getaddrinfo(const char *, const char *,
  const struct addrinfo *, struct addrinfo **) (declared at line 148
  of /usr/include/netdb.h).

  extern int getaddrinfo (const char *restrict nodename,
 ^

cc-1143 cc: ERROR File = getaddrinfo.h, Line = 126
  Declaration is incompatible with void freeaddrinfo(struct addrinfo *)
  (declared at line 146 of /usr/include/netdb.h).

  extern void freeaddrinfo (struct addrinfo *ai);
  ^

cc-1143 cc: ERROR File = getaddrinfo.h, Line = 140
  Declaration is incompatible with int getnameinfo(const struct sockaddr *,
  int, char *, int, char *, int, unsigned int) (declared at line 144
  of /usr/include/netdb.h).

  extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
 ^

5 errors detected in the compilation of gai_strerror.c.
make[2]: *** [gai_strerror.lo] Error 1
make[2]: Leaving directory `/stuff/amanda-source/amanda-2.5.2/gnulib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/stuff/amanda-source/amanda-2.5.2/gnulib'
make: *** [all-recursive] 

Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Pieter Bowman

 ...
 First go at amanda-2.5.2 on a system running irix-6.5.x
 and compile fails with the error:
 ...

This is the case on both IRIX and OSF/1.  These compilers can't
handle:

#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)

The patch for sockaddr_storage seems to work with the addition of
these two definitions in amanda.h:


/* Needed on SGI IRIX 6.5 */
#ifdef WORKING_IPV6
#define INET6
#endif

#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif

Pieter


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Jean-Louis Martineau

Pieter, Jean-Francois,

Can you try the attached patch for the vstrallocf problem.

Jean-Louis

Pieter Bowman wrote:

...
First go at amanda-2.5.2 on a system running irix-6.5.x
and compile fails with the error:
...
  


This is the case on both IRIX and OSF/1.  These compilers can't
handle:

#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)

The patch for sockaddr_storage seems to work with the addition of
these two definitions in amanda.h:


/* Needed on SGI IRIX 6.5 */
#ifdef WORKING_IPV6
#define INET6
#endif

#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif

Pieter
  


diff -u -r --show-c-function --new-file --exclude-from=/home/martinea/src.orig/amanda.diff --ignore-matching-lines='$Id:' amanda-2.5.2/common-src/alloc.c amanda-2.5.2.vstralloc/common-src/alloc.c
--- amanda-2.5.2/common-src/alloc.c	2007-05-04 07:39:08.0 -0400
+++ amanda-2.5.2.vstrallocf/common-src/alloc.c	2007-05-07 14:27:57.0 -0400
@@ -389,8 +389,6 @@ arglist_function1(
  */
 char *
 debug_vstrallocf(
-const char *file,
-int line,
 const char *fmt,
 ...)
 {
@@ -398,9 +396,10 @@ debug_vstrallocf(
 size_t  size;
 va_list argp;
 
-malloc_enter(debug_caller_loc(file, line));
+debug_alloc_pop();
+malloc_enter(debug_caller_loc(saved_file, saved_line));
 
-result = debug_alloc(file, line, MIN_ALLOC);
+result = debug_alloc(saved_file, saved_line, MIN_ALLOC);
 if (result != NULL) {
 
 	arglist_start(argp, fmt);
@@ -409,7 +408,7 @@ debug_vstrallocf(
 
 	if (size = (size_t)MIN_ALLOC) {
 	amfree(result);
-	result = debug_alloc(file, line, size + 1);
+	result = debug_alloc(saved_file, saved_line, size + 1);
 
 	arglist_start(argp, fmt);
 	(void)vsnprintf(result, size + 1, fmt, argp);
@@ -417,7 +416,7 @@ debug_vstrallocf(
 	}
 }
 
-malloc_leave(debug_caller_loc(file, line));
+malloc_leave(debug_caller_loc(saved_file, saved_line));
 return result;
 }
 
diff -u -r --show-c-function --new-file --exclude-from=/home/martinea/src.orig/amanda.diff --ignore-matching-lines='$Id:' amanda-2.5.2/common-src/amanda.h amanda-2.5.2.vstralloc/common-src/amanda.h
--- amanda-2.5.2/common-src/amanda.h	2007-05-04 07:39:08.0 -0400
+++ amanda-2.5.2.vstrallocf/common-src/amanda.h	2007-05-07 14:22:45.0 -0400
@@ -577,8 +577,6 @@ extern void *debug_newalloc   (const cha
 extern char *debug_stralloc   (const char *c, int l, const char *str);
 extern char *debug_newstralloc(const char *c, int l, char *oldstr,
 			   const char *newstr);
-extern char *debug_vstrallocf(const char *file, int line, const char *fmt,
-			  ...) __attribute__ ((format (printf, 3, 4)));
 extern const char *debug_caller_loc (const char *file, int line);
 extern int debug_alloc_push (char *file, int line);
 extern void debug_alloc_pop (void);
@@ -620,10 +618,12 @@ extern void debug_alloc_pop (void);
 
 #define vstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc
 #define newvstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_newvstralloc
-#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
+#define vstrallocf debug_alloc_push(__FILE__,__LINE__)?0:debug_vstrallocf
 
 extern char  *debug_vstralloc(const char *str, ...);
 extern char  *debug_newvstralloc(char *oldstr, const char *newstr, ...);
+extern char  *debug_vstrallocf(const char *fmt, ...)
+			   __attribute__ ((format (printf, 1, 2)));
 
 #define	stralloc2(s1,s2)  vstralloc((s1),(s2),NULL)
 #define	newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL)


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Pieter Bowman

 ...
 cc-1084 cc: ERROR File = /usr/include/sys/socket.h, Line = 66
   The indicated declaration has an invalid combination of type specifiers.
 
   typedef int socklen_t;
 ...

I'm guessing that Jean-Francois' release of IRIX is probably newer
than the one I have (IRIX 6.5.4m here).  The socket.h here doesn't
have a typedef for socklen_t.  This also probably means that defining
INET6 might be a bad idea.  After looking through the amanda source
and /usr/include/netinet/in.h a little more, I've found that:

INET_ADDRSTRLEN is only defined if INET6 is defined.

However, one thing I hadn't looked at is that on our IRIX system,
WORKING_IPV6 is not being defined.

From the Solaris version of netinet/in.h:

/*
 * Miscellaneous IPv6 constants.
 */
#define INET_ADDRSTRLEN 16  /* max len IPv4 addr in ascii dotted */
/* decimal notation. */
#define INET6_ADDRSTRLEN46  /* max len of IPv6 addr in ascii */
/* standard colon-hex notation. */

This seems to imply that INET_ADDRSTRLEN should not be used on systems
which can't do IPV6.  Or an alternate definition set up.

I was able to complete a build of amanda 2.5.2 on IRIX with the
following addition to amanda.h and using gcc (SGI's cc won't handle
the vstrallocf definition):

#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif

Pieter


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Jean-Francois Malouin
* Pieter Bowman [EMAIL PROTECTED] [20070507 15:09]:
 
  ...
  cc-1084 cc: ERROR File = /usr/include/sys/socket.h, Line = 66
The indicated declaration has an invalid combination of type specifiers.
  
typedef int socklen_t;
  ...
 
 I'm guessing that Jean-Francois' release of IRIX is probably newer
 than the one I have (IRIX 6.5.4m here).  The socket.h here doesn't

Wow! You have 6.5.4m!?! Brave man! :)

I have a mixture between 6.5.14m to 6.5.27m. My main amanda server is
6.5.19f but I'm having strange problems trying to configure on this
host (configure coredumps with a memory error -- seen this before and
a reboot seems to fix it).

I patched and put your #defines in and using either gcc 3.3.2 or
native irix C compiler seems to compile fine on a 6.5.14m host. I will
install and do further tests tomorrow...

thanks jf


 have a typedef for socklen_t.  This also probably means that defining
 INET6 might be a bad idea.  After looking through the amanda source
 and /usr/include/netinet/in.h a little more, I've found that:
 
   INET_ADDRSTRLEN is only defined if INET6 is defined.
 
 However, one thing I hadn't looked at is that on our IRIX system,
 WORKING_IPV6 is not being defined.
 
 From the Solaris version of netinet/in.h:
 
 /*
  * Miscellaneous IPv6 constants.
  */
 #define INET_ADDRSTRLEN 16  /* max len IPv4 addr in ascii dotted 
 */
 /* decimal notation. */
 #define INET6_ADDRSTRLEN46  /* max len of IPv6 addr in ascii */
 /* standard colon-hex notation. */
 
 This seems to imply that INET_ADDRSTRLEN should not be used on systems
 which can't do IPV6.  Or an alternate definition set up.
 
 I was able to complete a build of amanda 2.5.2 on IRIX with the
 following addition to amanda.h and using gcc (SGI's cc won't handle
 the vstrallocf definition):
 
 #ifndef INET_ADDRSTRLEN
 #define INET_ADDRSTRLEN 16
 #endif
 
 Pieter

-- 
° 


Re: 2.5.2 compilation failure on irix-6.5.x

2007-05-07 Thread Pieter Bowman

 ...
 Can you try the attached patch for the vstrallocf problem.
 ...

That corrected the problem for both IRIX and OSF/1 for me.

Pieter