guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 05/05: Bump objcode version in a compatible way


From: Andy Wingo
Subject: [Guile-commits] 05/05: Bump objcode version in a compatible way
Date: Tue, 18 Apr 2017 15:38:37 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit e0502f3c7711e2f505126297e66cafa43d232685
Author: Andy Wingo <address@hidden>
Date:   Tue Apr 18 21:37:36 2017 +0200

    Bump objcode version in a compatible way
    
    * libguile/_scm.h (SCM_OBJCODE_MINIMUM_MINOR_VERSION): New definition,
      indicating the oldest objcode version that we support.
      (SCM_OBJCODE_MINOR_VERSION): Bump.
    * libguile/loader.c (process_dynamic_segment): Support a range of
      versions.
    * module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
---
 libguile/_scm.h                |  3 ++-
 libguile/loader.c              | 10 ++++------
 module/system/vm/assembler.scm |  2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/libguile/_scm.h b/libguile/_scm.h
index e482b7e..093815d 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -248,7 +248,8 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
 
 /* Major and minor versions must be single characters. */
 #define SCM_OBJCODE_MAJOR_VERSION 3
-#define SCM_OBJCODE_MINOR_VERSION 9
+#define SCM_OBJCODE_MINIMUM_MINOR_VERSION 9
+#define SCM_OBJCODE_MINOR_VERSION A
 #define SCM_OBJCODE_MAJOR_VERSION_STRING        \
   SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
 #define SCM_OBJCODE_MINOR_VERSION_STRING        \
diff --git a/libguile/loader.c b/libguile/loader.c
index 7b1adc9..54bf1bf 100644
--- a/libguile/loader.c
+++ b/libguile/loader.c
@@ -296,12 +296,10 @@ process_dynamic_segment (char *base, Elf_Phdr *dyn_phdr,
               {
               case 0x0202:
                 bytecode_kind = BYTECODE_KIND_GUILE_2_2;
-                /* As we get closer to 2.2, we will allow for backwards
-                   compatibility and we can change this test to ">"
-                   instead of "!=".  However until then, to deal with VM
-                   churn it's best to keep these things in
-                   lock-step.  */
-                if (minor != SCM_OBJCODE_MINOR_VERSION)
+                if (minor < SCM_OBJCODE_MINIMUM_MINOR_VERSION)
+                  return "incompatible bytecode version";
+                /* FIXME for 3.0: Go back to integers.  */
+                if (minor > SCM_OBJCODE_MINOR_VERSION_STRING[0])
                   return "incompatible bytecode version";
                 break;
               default:
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index cfccd5b..8d71dc5 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -1807,7 +1807,7 @@ needed."
 
 ;; FIXME: Define these somewhere central, shared with C.
 (define *bytecode-major-version* #x0202)
-(define *bytecode-minor-version* 9)
+(define *bytecode-minor-version* (char->integer #\A))
 
 (define (link-dynamic-section asm text rw rw-init frame-maps)
   "Link the dynamic section for an ELF image with bytecode @var{text},



reply via email to

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