Change 30045 by [EMAIL PROTECTED] on 2007/01/27 23:04:25
Integrate:
[ 28609]
Subject: [PATCH] Tru64: if cc given both -O and -g, -g must be -g3
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Sun, 23 Jul 2006 10:18:11 +0300 (EEST)
Message-Id: <[EMAIL PROTECTED]>
[ 28633]
Subject: [PATCH] (back) towards g++ compilation (in Tru64, and
elsewhere)
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Mon, 31 Jul 2006 23:44:55 +0300
Message-ID: <[EMAIL PROTECTED]>
Just the hints/dec_osf.sh changes from this set of patches.
[ 28654]
Subject: [PATCH] more g++ in Tru64
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Thu, 03 Aug 2006 09:04:45 +0300
Message-ID: <[EMAIL PROTECTED]>
[ 28655]
Subject: [PATCH] Tru64 oops
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Thu, 3 Aug 2006 22:59:37 +0300 (EEST)
Message-Id: <[EMAIL PROTECTED]>
[ 28689]
Subject: [PATCH] g++: gethostbyaddr, and more Tru64 defines
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Thu, 10 Aug 2006 09:00:44 +0300
Message-ID: <[EMAIL PROTECTED]>
[ 28741]
Subject: [PATCH] g++/Tru64: got perl linking once got the linkage right
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Fri, 18 Aug 2006 13:03:17 +0300 (EEST)
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.8/perl/hints/dec_osf.sh#14 integrate
... //depot/maint-5.8/perl/perl.h#147 integrate
... //depot/maint-5.8/perl/perlio.c#98 integrate
... //depot/maint-5.8/perl/pp_sys.c#138 integrate
Differences ...
==== //depot/maint-5.8/perl/hints/dec_osf.sh#14 (text) ====
Index: perl/hints/dec_osf.sh
--- perl/hints/dec_osf.sh#13~26742~ 2006-01-08 14:06:18.000000000 -0800
+++ perl/hints/dec_osf.sh 2007-01-27 15:04:25.000000000 -0800
@@ -161,6 +161,17 @@
# Be nauseatingly ANSI
ccflags="$ccflags $_ccflags_strict_ansi"
+# g++ needs a lot of definitions to see the same set of
+# prototypes from <unistd.h> et alia as cxx/cc see.
+# Note that we cannot define _XOPEN_SOURCE_EXTENDED or
+# its moral equivalent, _XOPEN_SOURCE=500 (which would
+# define a lot of the required prototypes for us), because
+# the gcc-processed version of <sys/wait.h> contains fatally
+# conflicting prototypes for wait3().
+case "$cc" in
+*g++*) ccflags="$ccflags -D_XOPEN_SOURCE -D_OSF_SOURCE -D_AES_SOURCE -D_BSD
-D_POSIX_C_SOURCE=199309L -D_POSIX_PII_SOCKET" ;;
+esac
+
# for gcc the Configure knows about the -fpic:
# position-independent code for dynamic loading
@@ -179,10 +190,21 @@
;;
esac
+case "$isgcc" in
+gcc) ;;
+*) case "$optimize" in
+ *-O*) # With both -O and -g, the -g must be -g3.
+ optimize="`echo $optimize | sed 's/-g[1-4]*/-g3/'`"
+ ;;
+ esac
+ ;;
+esac
+
## Optimization limits
case "$isgcc" in
gcc) # gcc 3.2.1 wants a lot of memory for -O3'ing toke.c
cat >try.c <<EOF
+#include <stdio.h>
#include <sys/resource.h>
int main ()
@@ -359,7 +381,7 @@
extern int foo;
EOF
$cc -c pthread.c 2> pthread.err
- if grep -q "unrecognized compiler" pthread.err; then
+ if egrep -q "unrecognized compiler|syntax error" pthread.err; then
cat >&4 <<EOF
***
*** I'm sorry but your C compiler ($cc) cannot be used to
==== //depot/maint-5.8/perl/perl.h#147 (text) ====
Index: perl/perl.h
--- perl/perl.h#146~30040~ 2007-01-27 10:56:32.000000000 -0800
+++ perl/perl.h 2007-01-27 15:04:25.000000000 -0800
@@ -1083,6 +1083,13 @@
# endif
#endif
+#if defined(__osf__) && defined(__cplusplus) &&
!defined(_XOPEN_SOURCE_EXTENDED)
+EXTERN_C int fchdir(int);
+EXTERN_C int flock(int, int);
+EXTERN_C int fseeko(FILE *, off_t, int);
+EXTERN_C off_t ftello(FILE *);
+#endif
+
#if defined(__SUNPRO_CC)
EXTERN_C char *crypt(const char *, const char *);
#endif
==== //depot/maint-5.8/perl/perlio.c#98 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#97~30040~ 2007-01-27 10:56:32.000000000 -0800
+++ perl/perlio.c 2007-01-27 15:04:25.000000000 -0800
@@ -112,6 +112,11 @@
else \
SETERRNO(EBADF, SS_IVCHAN)
+#if defined(__osf__) && _XOPEN_SOURCE < 500
+extern int fseeko(FILE *, off_t, int);
+extern off_t ftello(FILE *);
+#endif
+
#ifndef USE_SFIO
EXTERN_C int perlsio_binmode(FILE *fp, int iotype, int mode);
==== //depot/maint-5.8/perl/pp_sys.c#138 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#137~30033~ 2007-01-27 08:40:35.000000000 -0800
+++ perl/pp_sys.c 2007-01-27 15:04:25.000000000 -0800
@@ -4572,7 +4572,7 @@
STRLEN addrlen;
Netdb_host_t addr = (Netdb_host_t) SvPVbyte(addrsv, addrlen);
- hent = PerlSock_gethostbyaddr((const void*)addr, (Netdb_hlen_t)
addrlen, addrtype);
+ hent = PerlSock_gethostbyaddr((const char*)addr, (Netdb_hlen_t)
addrlen, addrtype);
#else
DIE(aTHX_ PL_no_sock_func, "gethostbyaddr");
#endif
End of Patch.