guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix build of guile-3.0 trunk with gcc-8 on hpux11.11


From: John David Anglin
Subject: [PATCH] Fix build of guile-3.0 trunk with gcc-8 on hpux11.11
Date: Mon, 23 Mar 2020 12:40:57 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

The following change fixes the build of guile-3.0 using gcc-8 on hpux11.11.
There are three issues addressed:

1) The printf function does not support %zu.  Since all the type sizes are 
small,
we can use %u and cast the sizeof results to unsigned int.

2) HP-UX 11.11 does not have readdir64 or readdir64_r.  The change adds back the
checks for readdir64 and readdir64_r.  I added support for readdir64 similar to 
that
for readdir64_r to gen-scmconfig.c and syscalls.h.

3) I needed to link libguile against gcc's libatomic. I don't have a configure 
fix yet.
So, I export "LIBS=-latomic" in my guild to get gcc's atomic routines. This 
fixed segmentation
fault building the texi documentation.

With these changes, all tests pass except the following:

wrote `/mnt/gnu/guile/objdir/cache/guile/ccache/3.0-BE-4-4.2/mnt/gnu/guile/guile
/test-suite/standalone/test-out-of-memory.go'
GC Warning: Failed to expand heap by 67239936 bytes
GC Warning: Failed to expand heap by 67108864 bytes
GC Warning: Out of Memory! Heap size: 1 MiB. Returning NULL!
GC Warning: Failed to expand heap by 1000132608 bytes
GC Warning: Failed to expand heap by 1000001536 bytes
GC Warning: Out of Memory! Heap size: 1 MiB. Returning NULL!
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 8388608 bytes
GC Warning: Failed to expand heap by 65536 bytes
GC Warning: Out of Memory! Heap size: 37 MiB. Returning NULL!
GC Warning: Failed to expand heap by 65536 bytes
GC Warning: Out of Memory! Heap size: 37 MiB. Returning NULL!
Warning: Unwind-only out of memory exception; skipping pre-unwind handler.
FAIL: test-out-of-memory
==================================
1 of 38 tests failed
(1 test was not run)
Please report to address@hidden
==================================

Please install if okay.

Guile is part of the build and test environment that I use for gcc.  HP-UX is 
still the only
environment where we have a working 64-bit compiler.  It is needed to build the 
64-bit linux
kernel.

Regards,
Dave Anglin

diff --git a/configure.ac b/configure.ac
index 6198c7e6e..0edb31ba7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -483,7 +483,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
 AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid                
\
   fesetround ftime ftruncate fchown fchmod getcwd geteuid getsid       \
   gettimeofday getuid getgid gmtime_r ioctl lstat mkdir mknod nice     \
-  readlink rename rmdir setegid seteuid                                        
\
+  readdir64 readdir64_r readlink rename rmdir setegid seteuid           \
   setlocale setuid setgid setpgid setsid sigaction siginterrupt stat64 \
   strptime symlink sync sysconf tcgetpgrp tcsetpgrp uname waitpid      \
   strdup system usleep atexit on_exit chown link fcntl ttyname getpwent        
\
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 8d77dfaf2..5ae831d53 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -239,21 +239,27 @@ main (int argc, char *argv[])
   pf ("\n");
   pf ("/* Standard types. */\n");

-  pf ("#define SCM_SIZEOF_CHAR %zu\n", sizeof (char));
-  pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %zu\n", sizeof (unsigned char));
-  pf ("#define SCM_SIZEOF_SHORT %zu\n", sizeof (short));
-  pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %zu\n", sizeof (unsigned short));
-  pf ("#define SCM_SIZEOF_LONG %zu\n", sizeof (long));
-  pf ("#define SCM_SIZEOF_UNSIGNED_LONG %zu\n", sizeof (unsigned long));
-  pf ("#define SCM_SIZEOF_INT %zu\n", sizeof (int));
-  pf ("#define SCM_SIZEOF_UNSIGNED_INT %zu\n", sizeof (unsigned int));
-  pf ("#define SCM_SIZEOF_SIZE_T %zu\n", sizeof (size_t));
-  pf ("#define SCM_SIZEOF_LONG_LONG %zu\n", sizeof (long long));
-  pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %zu\n", sizeof (unsigned long 
long));
-  pf ("#define SCM_SIZEOF_INTMAX %zu\n", sizeof (intmax_t));
-  pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %zu\n", sizeof (ptrdiff_t));
-  pf ("#define SCM_SIZEOF_INTPTR_T %zu\n", sizeof (intptr_t));
-  pf ("#define SCM_SIZEOF_UINTPTR_T %zu\n", sizeof (uintptr_t));
+  pf ("#define SCM_SIZEOF_CHAR %u\n", (unsigned int)sizeof (char));
+  pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %u\n",
+      (unsigned int)sizeof (unsigned char));
+  pf ("#define SCM_SIZEOF_SHORT %u\n", (unsigned int)sizeof (short));
+  pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %u\n",
+      (unsigned int)sizeof (unsigned short));
+  pf ("#define SCM_SIZEOF_LONG %u\n", (unsigned int)sizeof (long));
+  pf ("#define SCM_SIZEOF_UNSIGNED_LONG %u\n",
+      (unsigned int)sizeof (unsigned long));
+  pf ("#define SCM_SIZEOF_INT %u\n", (unsigned int)sizeof (int));
+  pf ("#define SCM_SIZEOF_UNSIGNED_INT %u\n",
+      (unsigned int)sizeof (unsigned int));
+  pf ("#define SCM_SIZEOF_SIZE_T %u\n", (unsigned int)sizeof (size_t));
+  pf ("#define SCM_SIZEOF_LONG_LONG %u\n", (unsigned int)sizeof (long long));
+  pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %u\n",
+      (unsigned int)sizeof (unsigned long long));
+  pf ("#define SCM_SIZEOF_INTMAX %u\n", (unsigned int)sizeof (intmax_t));
+  pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %u\n",
+      (unsigned int)sizeof (ptrdiff_t));
+  pf ("#define SCM_SIZEOF_INTPTR_T %u\n", (unsigned int)sizeof (intptr_t));
+  pf ("#define SCM_SIZEOF_UINTPTR_T %u\n", (unsigned int)sizeof (uintptr_t));

   pf ("\n");
   pf ("/* same as POSIX \"struct timespec\" -- always defined */\n");
@@ -313,6 +319,13 @@ main (int argc, char *argv[])
   pf ("#define SCM_HAVE_STRUCT_DIRENT64 %d /* 0 or 1 */\n",
       SCM_I_GSC_HAVE_STRUCT_DIRENT64);

+  pf ("/* Define to 1 if `readdir64 ()' is available.  */\n");
+#ifdef HAVE_READDIR_R
+  pf ("#define SCM_HAVE_READDIR64 1 /* 0 or 1 */\n");
+#else
+  pf ("#define SCM_HAVE_READDIR64 0 /* 0 or 1 */\n");
+#endif
+
   pf ("/* Define to 1 if `readdir64_r ()' is available.  */\n");
 #ifdef HAVE_READDIR64_R
   pf ("#define SCM_HAVE_READDIR64_R 1 /* 0 or 1 */\n");
diff --git a/libguile/syscalls.h b/libguile/syscalls.h
index 30b99c193..9d443afb5 100644
--- a/libguile/syscalls.h
+++ b/libguile/syscalls.h
@@ -58,7 +58,11 @@
 #define lstat_or_lstat64                CHOOSE_LARGEFILE(lstat,lstat64)
 #define off_t_or_off64_t                CHOOSE_LARGEFILE(off_t,off64_t)
 #define open_or_open64                  CHOOSE_LARGEFILE(open,open64)
-#define readdir_or_readdir64            CHOOSE_LARGEFILE(readdir,readdir64)
+#if SCM_HAVE_READDIR64 == 1
+# define readdir_or_readdir64           CHOOSE_LARGEFILE(readdir,readdir64)
+#else
+# define readdir_or_readdir64           readdir
+#endif
 #if SCM_HAVE_READDIR64_R == 1
 # define readdir_r_or_readdir64_r       CHOOSE_LARGEFILE(readdir_r,readdir64_r)
 #else



reply via email to

[Prev in Thread] Current Thread [Next in Thread]