[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSK(OSS) compilation problem
From: |
mwoehlke |
Subject: |
Re: NSK(OSS) compilation problem |
Date: |
Mon, 09 Oct 2006 15:11:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.0 |
Paul Eggert wrote:
mwoehlke <address@hidden> writes:
So what would be your recommendation? Remove all use of 64-bit
integers? (i.e. make intmax_t also 'long' rather than 'long long'?)
No, I'd make uintmax_t 32-bit and intmax_t 64 bit, if those are
the widest unsigned and signed types. Then I'd fix any bugs
that crop up.
Ok... Attaching an initial attempt at a patch for stdint_.h. The
configure script (or more appropriately, I suppose, configure.in) needs
to be patched additionally, but alas, I do not speak autotools :-), and
didn't spot the sources anyway in my brief exploration looking for them.
So ignore that part of the patch.
And remind me to *NEVER* try to update configure on this box; each run
takes an *hour* (yes, this box sucks :-)). Trying to do so basically
killed making any headway Friday.
At any rate, this is enough to get me started; I will have additional
patches as bugs in single programs manifest themselves, but this at
least gets things further along.
Anyway, this got me as far as sha512.c where the compiler croaked with:
...
0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL,
0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
"/home/tandem_oss/floss/src/coreutils-6.3/lib/sha512.c", line 399:
error(764):
invalid unsigned type
Error limit reached.
100 errors detected in the compilation of "sha512.c".
Compilation terminated.
(So, yes... "yike"... Since this thread is already getting old (and
likely to get a lot older before I'm done), should I continue this
thread even if/when it starts falling off NTP, or start new ones?)
What exactly is sha512 used for? It is clear that this code is totally
non-portable from the explicit use of 'uint64_t' in sha512.h. (Is this
supposed to be excluded from the build, or what? It clearly would not
build on any system without a 64-bit integer type...)
I also tried the patch on Solaris x86 (manually changing config.h and
config.status); there were warnings in fsusage.c, and it failed 'make
check' at cp:sparse, dd:skip-seek, du:basic, misc:printf,
misc:split-fail, pr:pr-tests (and OMG was that a noisy failure!),
tr:tr-tests (not as bad, but still noisy), and uniq:uniq-tests.
On an unrelated note, when running configure, I get these two header
compilation failures:
...
configure: WARNING: sys/statvfs.h: present but cannot be compiled
...
configure: WARNING: sys/ioctl.h: present but cannot be compiled
...
For now I'm ignoring the ioctl.h one as I don't remember it being a
problem. I'll look into the statvfs.h failure when I try to get 'stat'
to build (contrary to my previous bug report, statvfs() looks OK so I'm
not sure why I couldn't get 'stat' to build on 5.97 - I'm going to try
harder this time). My guess, however, is that this is a case of needing
_TANDEM_SOURCE defined ala http://savannah.gnu.org/bugs/?17172, but
since this would need to be changed in autoconf I'm not sure what, if
anything, should or could be done.
For statvfs.h:
"/usr/include/sys/statvfs.h", line 50: error(114): identifier "u_long"
is undefined
(I get this on lines 35-43, 45, 46, 48-50)
Similarly for ioctl.h it complains about 'u_short', 'u_char', 'caddr_t',
etc in "/usr/include/net/if_arp.h" and "/usr/include/net/if.h" which are
of course inet headers, i.e. this failure exactly matches my description
in the bug report.
I think there may be some problems with files that double-include
<config.h>. That is a no-no nowadays, since <stdint.h> redefines
uintmax_t and the like. I'll try to look into it.
Thanks. (Hmm, that sounds like you got off on a tangent talking about
my Tru64 problem?)
I think the issues are related.
I don't see what including config.h twice has to do with HP NSK/OSS not
having an 'unsigned long long' type? But thanks again for fixing that
(assuming the patch worked, not sure when I might get around to trying it).
--
Matthew
"What's Cygwin?" you ask.
'Tis mostly absurd software
Concerning hippos.
diff -ur coreutils-6.3-orig/configure coreutils-6.3/configure
--- coreutils-6.3-orig/configure 2006-09-30 02:09:13.000000000 -0700
+++ coreutils-6.3/configure 2006-10-09 10:29:25.000000000 -0700
@@ -715,6 +715,7 @@
LIBICONV
LTLIBICONV
HAVE_LONG_LONG_INT
+HAVE_UNSIGNED_LONG_LONG_INT
HAVE_WCHAR_H
HAVE_INTTYPES_H
HAVE_SYS_TYPES_H
@@ -17568,9 +17569,14 @@
cat >>confdefs.h <<\_ACEOF
#define HAVE_UNSIGNED_LONG_LONG_INT 1
_ACEOF
fi
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ HAVE_UNSIGNED_LONG_LONG_INT=1
+ else
+ HAVE_UNSIGNED_LONG_LONG_INT=0
+ fi
@@ -62390,6 +62399,7 @@
LIBICONV!$LIBICONV$ac_delim
LTLIBICONV!$LTLIBICONV$ac_delim
HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim
+HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim
HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim
HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim
HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim
@@ -62457,7 +62467,7 @@
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 80; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -ur coreutils-6.3-orig/lib/Makefile.in coreutils-6.3/lib/Makefile.in
--- coreutils-6.3-orig/lib/Makefile.in 2006-09-30 02:09:23.000000000 -0700
+++ coreutils-6.3/lib/Makefile.in 2006-10-06 09:59:50.000000000 -0700
@@ -317,6 +317,7 @@
HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -1093,6 +1094,7 @@
-e 's|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_INTTYPES_H)|g' \
-e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e
's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
-e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
@@ -1171,6 +1173,7 @@
-e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e
's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
diff -ur coreutils-6.3-orig/lib/stdint_.h coreutils-6.3/lib/stdint_.h
--- coreutils-6.3-orig/lib/stdint_.h 2006-08-28 13:51:12.000000000 -0700
+++ coreutils-6.3/lib/stdint_.h 2006-10-09 12:27:14.000000000 -0700
@@ -133,7 +133,9 @@
# define uint64_t unsigned __int64
#elif @HAVE_LONG_LONG_INT@
# define int64_t long long int
-# define uint64_t unsigned long long int
+/* Test for 'unsigned long long' seperately, because HP NSK/OSS is
+ broken^H^H^H^H^H^H^H different and has signed 64-bit integers but not
+ unsigned 64-bit integers. */
+# if @HAVE_UNSIGNED_LONG_LONG_INT@
+# define uint64_t unsigned long long int
+# endif
#endif
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
@@ -164,6 +166,8 @@
#define uint_least32_t uint32_t
#ifdef int64_t
# define int_least64_t int64_t
+#endif
+#ifdef uint64_t
# define uint_least64_t uint64_t
#endif
@@ -193,6 +197,8 @@
#define uint_fast32_t unsigned int_fast32_t
#ifdef int64_t
# define int_fast64_t int64_t
+#endif
+#ifdef uint64_t
# define uint_fast64_t uint64_t
#endif
@@ -209,15 +215,22 @@
public header files. */
#undef intmax_t
-#undef uintmax_t
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define intmax_t long long int
-# define uintmax_t unsigned long long int
#elif defined int64_t
# define intmax_t int64_t
-# define uintmax_t uint64_t
#else
# define intmax_t long int
+#endif
+
+/* Define seperately, because HP NSK/OSS is broken^H^H^H^H^H^H^H different
+ and has 'long long' but not 'unsigned long long'. */
+#undef uintmax_t
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# define uintmax_t unsigned long long int
+#elif defined uint64_t
+# define uintmax_t uint64_t
+#else
# define uintmax_t unsigned long int
#endif
@@ -257,6 +270,8 @@
#ifdef int64_t
# define INT64_MIN (~ INT64_MAX)
# define INT64_MAX INTMAX_C (9223372036854775807)
+#endif
+#ifdef uint64_t
# define UINT64_MAX UINTMAX_C (18446744073709551615)
#endif
@@ -293,6 +308,8 @@
#ifdef int64_t
# define INT_LEAST64_MIN INT64_MIN
# define INT_LEAST64_MAX INT64_MAX
+#endif
+#ifdef uint64_t
# define UINT_LEAST64_MAX UINT64_MAX
#endif
@@ -329,6 +346,8 @@
#ifdef int64_t
# define INT_FAST64_MIN INT64_MIN
# define INT_FAST64_MAX INT64_MAX
+#endif
+#ifdef uint64_t
# define UINT_FAST64_MAX UINT64_MAX
#endif
@@ -349,9 +368,12 @@
#define INTMAX_MIN (~ INTMAX_MAX)
#ifdef INT64_MAX
# define INTMAX_MAX INT64_MAX
-# define UINTMAX_MAX UINT64_MAX
#else
# define INTMAX_MAX INT32_MAX
+#endif
+#ifdef UINT64_MAX
+# define UINTMAX_MAX UINT64_MAX
+#else
# define UINTMAX_MAX UINT32_MAX
#endif
@@ -442,12 +464,16 @@
#undef UINTMAX_C
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define INTMAX_C(x) x##LL
-# define UINTMAX_C(x) x##ULL
#elif defined int64_t
# define INTMAX_C(x) INT64_C(x)
-# define UINTMAX_C(x) UINT64_C(x)
#else
# define INTMAX_C(x) x##L
+#endif
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define UINTMAX_C(x) x##ULL
+#elif defined uint64_t
+# define UINTMAX_C(x) UINT64_C(x)
+#else
# define UINTMAX_C(x) x##UL
#endif
- NSK(OSS) compilation problem, mwoehlke, 2006/10/04
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/05
- Re: NSK(OSS) compilation problem, mwoehlke, 2006/10/06
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/06
- Re: NSK(OSS) compilation problem,
mwoehlke <=
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/11
- Re: NSK(OSS) compilation problem, mwoehlke, 2006/10/11
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/11
- Re: NSK(OSS) compilation problem (change to m4/extensions.m4), Paul Eggert, 2006/10/11
- Message not available
- Re: NSK(OSS) compilation problem (change to m4/extensions.m4), Ralf Wildenhues, 2006/10/12
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/11
- Re: NSK(OSS) compilation problem, Paul Eggert, 2006/10/11
- proposed patch to allocsa, vasnprintf for Tandem NSK (OSS), Paul Eggert, 2006/10/11
- Re: [bug-gnulib] proposed patch to allocsa, vasnprintf for Tandem NSK (OSS), Bruno Haible, 2006/10/11
- Re: [bug-gnulib] proposed patch to allocsa, vasnprintf for Tandem NSK (OSS), Bruno Haible, 2006/10/11