guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-1-53-g86c


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-1-53-g86cfb42
Date: Tue, 11 Aug 2009 18:25:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=86cfb42d56907c77e557b760328bfcee0d3be20c

The branch, master has been updated
       via  86cfb42d56907c77e557b760328bfcee0d3be20c (commit)
      from  f5d7662fc86462fef68477fbfed994d2cf228e3e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 86cfb42d56907c77e557b760328bfcee0d3be20c
Author: Andy Wingo <address@hidden>
Date:   Tue Aug 11 20:25:19 2009 +0200

    include objcode cookie in the fallback path
    
    * libguile/_scm.h (SCM_OBJCODE_COOKIE): Move the objcode cookie define
      here, so that load.c can use it. This is a private header.
    
    * libguile/load.c (FALLBACK_DIR): Include the objcode cookie in the
      fallback path. Should fix problems when objcode changes incompatibly
      during the 1.9 series.
    
    * libguile/objcodes.c: Adapt to SCM_OBJCODE_COOKIE move.
    
    This should fix http://article.gmane.org/gmane.lisp.guile.devel/9059.

-----------------------------------------------------------------------

Summary of changes:
 libguile/_scm.h     |   21 ++++++++++++++++++++-
 libguile/load.c     |    2 +-
 libguile/objcodes.c |   37 +++++++++----------------------------
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/libguile/_scm.h b/libguile/_scm.h
index 429e87b..693ec1d 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -3,7 +3,7 @@
 #ifndef SCM__SCM_H
 #define SCM__SCM_H
 
-/* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008 Free Software 
Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008, 2009 Free Software 
Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -59,6 +59,7 @@
 #endif
 
 #include <errno.h>
+#include <verify.h>
 #include "libguile/__scm.h"
 
 /* Include headers for those files central to the implementation.  The
@@ -156,6 +157,24 @@
 #define scm_from_off64_t  scm_from_int64
 
 
+/* The endianness marker in objcode.  */
+#ifdef WORDS_BIGENDIAN
+# define SCM_OBJCODE_ENDIANNESS "BE"
+#else
+# define SCM_OBJCODE_ENDIANNESS "LE"
+#endif
+
+#define _SCM_CPP_STRINGIFY(x)  # x
+#define SCM_CPP_STRINGIFY(x)   _SCM_CPP_STRINGIFY (x)
+
+/* The word size marker in objcode.  */
+#define SCM_OBJCODE_WORD_SIZE  SCM_CPP_STRINGIFY (SIZEOF_VOID_P)
+
+/* The objcode magic header.  */
+#define SCM_OBJCODE_COOKIE                                             \
+  "GOOF-0.9-" SCM_OBJCODE_ENDIANNESS "-" SCM_OBJCODE_WORD_SIZE "---"
+
+
 #endif  /* SCM__SCM_H */
 
 /*
diff --git a/libguile/load.c b/libguile/load.c
index 890b0f8..b27bb82 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -253,7 +253,7 @@ scm_init_load_path ()
     struct passwd *pwd;
 #endif
 
-#define FALLBACK_DIR "guile/ccache/"SCM_EFFECTIVE_VERSION
+#define FALLBACK_DIR "guile/ccache/"SCM_EFFECTIVE_VERSION"/"SCM_OBJCODE_COOKIE
 
     if ((e = getenv ("XDG_CACHE_HOME")))
       snprintf (cachedir, sizeof(cachedir), "%s" FALLBACK_DIR, e);
diff --git a/libguile/objcodes.c b/libguile/objcodes.c
index 91691a7..19c2406 100644
--- a/libguile/objcodes.c
+++ b/libguile/objcodes.c
@@ -28,33 +28,14 @@
 #include <sys/types.h>
 #include <assert.h>
 
-#include <verify.h>
-
 #include "_scm.h"
 #include "vm-bootstrap.h"
 #include "programs.h"
 #include "objcodes.h"
 
-/* The endianness marker in objcode.  */
-#ifdef WORDS_BIGENDIAN
-# define OBJCODE_ENDIANNESS "BE"
-#else
-# define OBJCODE_ENDIANNESS "LE"
-#endif
-
-#define _OBJCODE_STRINGIFY(x)  # x
-#define OBJCODE_STRINGIFY(x)   _OBJCODE_STRINGIFY (x)
-
-/* The word size marker in objcode.  */
-#define OBJCODE_WORD_SIZE  OBJCODE_STRINGIFY (SIZEOF_VOID_P)
-
-/* The objcode magic header.  */
-#define OBJCODE_COOKIE                                         \
-  "GOOF-0.9-" OBJCODE_ENDIANNESS "-" OBJCODE_WORD_SIZE "---"
-
+/* SCM_OBJCODE_COOKIE is defined in _scm.h */
 /* The length of the header must be a multiple of 8 bytes.  */
-verify (((sizeof (OBJCODE_COOKIE) - 1) & 7) == 0);
-
+verify (((sizeof (SCM_OBJCODE_COOKIE) - 1) & 7) == 0);
 
 
 /*
@@ -77,7 +58,7 @@ make_objcode_by_mmap (int fd)
   if (ret < 0)
     SCM_SYSERROR;
 
-  if (st.st_size <= sizeof (struct scm_objcode) + strlen (OBJCODE_COOKIE))
+  if (st.st_size <= sizeof (struct scm_objcode) + strlen (SCM_OBJCODE_COOKIE))
     scm_misc_error (FUNC_NAME, "object file too small (~a bytes)",
                    scm_list_1 (SCM_I_MAKINUM (st.st_size)));
 
@@ -88,18 +69,18 @@ make_objcode_by_mmap (int fd)
       SCM_SYSERROR;
     }
 
-  if (memcmp (addr, OBJCODE_COOKIE, strlen (OBJCODE_COOKIE)))
+  if (memcmp (addr, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE)))
     {
       SCM args = scm_list_1 (scm_from_locale_stringn
-                             (addr, strlen (OBJCODE_COOKIE)));
+                             (addr, strlen (SCM_OBJCODE_COOKIE)));
       (void) close (fd);
       (void) munmap (addr, st.st_size);
       scm_misc_error (FUNC_NAME, "bad header on object file: ~s", args);
     }
 
-  data = (struct scm_objcode*)(addr + strlen (OBJCODE_COOKIE));
+  data = (struct scm_objcode*)(addr + strlen (SCM_OBJCODE_COOKIE));
 
-  if (data->len + data->metalen != (st.st_size - sizeof (*data) - strlen 
(OBJCODE_COOKIE)))
+  if (data->len + data->metalen != (st.st_size - sizeof (*data) - strlen 
(SCM_OBJCODE_COOKIE)))
     {
       (void) close (fd);
       (void) munmap (addr, st.st_size);
@@ -109,7 +90,7 @@ make_objcode_by_mmap (int fd)
                                                   + data->metalen)));
     }
 
-  SCM_NEWSMOB3 (sret, scm_tc16_objcode, addr + strlen (OBJCODE_COOKIE),
+  SCM_NEWSMOB3 (sret, scm_tc16_objcode, addr + strlen (SCM_OBJCODE_COOKIE),
                 SCM_PACK (SCM_BOOL_F), fd);
   SCM_SET_SMOB_FLAGS (sret, SCM_F_OBJCODE_IS_MMAP);
 
@@ -270,7 +251,7 @@ SCM_DEFINE (scm_write_objcode, "write-objcode", 2, 0, 0,
   SCM_VALIDATE_OBJCODE (1, objcode);
   SCM_VALIDATE_OUTPUT_PORT (2, port);
   
-  scm_c_write (port, OBJCODE_COOKIE, strlen (OBJCODE_COOKIE));
+  scm_c_write (port, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE));
   scm_c_write (port, SCM_OBJCODE_DATA (objcode),
                sizeof (struct scm_objcode) + SCM_OBJCODE_TOTAL_LEN (objcode));
 


hooks/post-receive
-- 
GNU Guile




reply via email to

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